today i bumped with Shift + ctrl, I can not copy and paste the values Marked parameter! how it fix?
Code: Select all
xsi = Application
sel = xsi.Selection
ks = xsi.GetKeyboardState()
def copyAnim(oControls):
source = oControls[0]
target = oControls[1]
mode = ''
#Shift
if ks(1) == 1:
mode = 'siTranslationParam'
#Ctrl
elif ks(1) == 2:
mode = 'siRotationParam'
#Shift+Ctrl
elif ks(1) == 3:
mode = 'siMarkedParam'
#Ctrl+Alt
elif ks(1) == 6:
mode = 'siScalingParam'
#Default
else:
mode = 'siTransformParam'
xsi.CopyAllAnimation2(source, "siFCurveSource", mode)
xsi.PasteAllAnimation(target)
def returnPair(oControls, id):
half = oControls.Count/2
firstCtrl = oControls(id)
secondCtrl = oControls(id+half)
pair = [firstCtrl, secondCtrl]
return pair
def matchControls(oControls):
a = oControls.Count/2
for id in range (0, a):
ctrls = returnPair(oControls, id)
copyAnim(ctrls)
#Alt menu
if ks(1) == 4:
XSIUIToolkit.MsgBox( '''=============================================
=============================================
Notes about this tool:
pmCopyAnim simplifies the process of copy/pasting animation from one object to another
=============================================
What this tool does:
Running this script while having an even number of items selected will split the list halfway and copy the animation from the first object of the first half to the first object of the second half, the 2nd object with the 2nd object, etc.
=============================================
Instructions:
Select an even number of objects
Run the script:
Default: Copy all transforms
Shift: Copy translation
Ctrl: Copy rotation
Alt+Ctrl: Copy scaling
Shift+Ctrl: Copy marked parameters
=============================================
''', 0, "pmCopyAnim Info" )
else:
if sel.Count%2 ==0:
matchControls(sel)
else:
#Error message
XSIUIToolkit.MsgBox('You need to select an even number of controllers', 0, 'ERROR')Thank you for feedback !