-- Updated 04/27/2010 --This is Free for use! -- Created by John A. Martini -- JokerMartini@hotmail.com -- http://www.JokerMartini.com -- About Key Transfer --transfers keys from one objects transform node to another -- Things to Do -- Add Key Value Variation for intensity -- Add Relative and Absolute option --The Script-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- try (-- if possible close the existing Toolbar interface. Then it will create a new one at the bottom of this script DestroyDialog KeyTransfer_Script; ) catch(); KeyTransfer_Script; --// Variables KeysMin = -10 KeysMax = 10 ValueMin = 0 ValueMax = 0 --// The dialog rollout KeyTransfer_Script "Key Transfer" ( group "Animated Object" ( pickButton btn_pickBox "Pick Animated Object" width:160 height:24 tooltip:"Pick Animated Object" ) group "Key Stagger" ( label staggerOffset "Offset :" width:40 height:16 across: 2 offset:[-19,0] spinner spnStagger "" width:50 height:16 range:[-9999,9999,0] offset:[0,0] ) group "Key Offset Variation" ( label lbOffsetMin "Min:" width:20 height:16 across: 4 offset:[-11,0] spinner spnKeysMin "" width:50 height:16 range:[-9999,9999,KeysMin] offset:[-21,0] tooltip:"Is the value used for the minimum offset of the keys in the timeline." label lbOffsetMax "Max:" width:22 height:16 offset:[-3,0] spinner spnKeysMax "" width:50 height:16 range:[-9999,9999,KeysMax] offset:[-10,0] tooltip:"Is the value used for the maximum offset of the keys in the timeline." ) group "Key Value Variation" ( label lbCS "Coming Soon" height:16 --label lbValueMin "Min:" width:20 height:16 across: 2 offset:[-11,0] --spinner spnValueMin "" width:50 height:16 range:[-9999,9999,ValueMin] offset:[-21,0] tooltip:"Is the value used for the minimum offset of the keys value in curve editor." --label lbValueMax "Max:" width:22 height:16 offset:[-3,0] --spinner spnValueMax "" width:50 height:16 range:[-9999,9999,ValueMax] offset:[-10,0] tooltip:"Is the value used for the maximum offset of the keys value in curve editor." ) group "Position Axis's" ( checkbox chkxPos "X" across: 3 offset:[0,0] checkbox chkyPos "Y" offset:[14,0] checkbox chkzPos "Z" offset:[24,0] ) group "Orientation Axis's" ( checkbox chkxRot "X" across: 3 offset:[0,0] checkbox chkyRot "Y" offset:[14,0] checkbox chkzRot "Z" offset:[24,0] ) group "Scale Axis's" ( checkbox chkxScale "X" across: 3 offset:[0,0] checkbox chkyScale "Y" offset:[14,0] checkbox chkzScale "Z" offset:[24,0] ) label lab1 "1.Pick animated reference object." align: #left offset:[-5,0] label lab2 "2.Set desired varions." align: #left offset:[-5,0] label lab3 "3.Select Objs you wish to animate." align: #left offset:[-5,0] label lab4 "4.Choose axis's to transfer to." align: #left offset:[-5,0] label lab5 "5.Click Transfer Animation button." align: #left offset:[-5,0] button btn_scaleXYZ "Assign Scale XYZ Controller" width:170 height:16 button btn_deleteKeys "Delete All Existing Keys" width:170 height:16 button btn_transferAnimation "Transfer Animation" width:170 height:26 local userAnimatedObj = undefined local userPinObj = undefined --// Replaces the button text with the users selection on btn_pickBox picked obj do ( if obj != undefined then ( btn_pickBox.text = obj.name userAnimatedObj = obj ) ) --// Delete Existing Keys on btn_deleteKeys pressed do ( sliderTime = 0f userSel = getCurrentSelection () deleteKeys userSel #allKeys ) --// Changes the Scale Controller from the default "Bezier Scale" to "Scale XYZ" --// Scale XYZ allows us to transfer scale keys from the individual scale tracks. on btn_scaleXYZ pressed do for i in selection do ( theController = ScaleXYZ() i.scale.controller = theController ) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- on btn_transferAnimation pressed do ( modCheck = false --// The action scripts for X-Position if (chkxPos.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.position.x_position.controller.keys do ( appendKey s.position.x_position.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for Y-Position if (chkyPos.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.position.y_position.controller.keys do ( appendKey s.position.y_position.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for Z-Position if (chkzPos.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.position.z_position.controller.keys do ( appendKey s.position.z_position.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for X-Rotation if (chkxRot.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.rotation.x_rotation.controller.keys do ( appendKey s.rotation.x_rotation.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for Y-Rotation if (chkyRot.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.rotation.y_rotation.controller.keys do ( appendKey s.rotation.y_rotation.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for Z-Rotation if (chkzRot.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.rotation.z_rotation.controller.keys do ( appendKey s.rotation.z_rotation.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for X-Scale if (chkxScale.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.scale.x_scale.controller.keys do ( appendKey s.scale.x_scale.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for Y-Scale if (chkyScale.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.scale.y_scale.controller.keys do ( appendKey s.scale.y_scale.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) --// The action scripts for Z-Scale if (chkzScale.state) then ( userSel = getCurrentSelection () for s in userSel do ( for k in userAnimatedObj.scale.z_scale.controller.keys do ( appendKey s.scale.z_scale.controller.keys k ) moveKeys s (random spnKeysMin.value spnKeysMax.value) ) modCheck = true; ) if(modCheck == true) then( staggerIndex = 0 for s in userSel do ( moveKeys s ((staggerIndex * spnStagger.value) + spnStagger.value) staggerIndex += 1 ) ) ) ) createdialog KeyTransfer_Script 180 500