[Closed] Noob question about an align script
So I dont really know much about maxscript, but I have slowly started using little snippets on occasion. I had a series of animations where the characters hands needed to have a very specific placement, and I started using a simple script.
Basically $‘Bip01 L Hand’.transform = $‘Bip01 L Hand Guide’.Transform when I press a button.
Initially the animations were all quite short, but as the length increased I changed it to
(
$‘Bip01 L Hand’.transform = $‘Bip01 L Hand Guide’.Transform
$‘Bip01 R Hand’.transform = $‘Bip01 R Hand Guide’.Transform
(
(
tbar = maxops.trackbar this was taken from another script. I did not write it
slidertime = (at time slidertime tbar.getnextkeytime())
)
This allowed me to select the hands and then go through the timeline, but I am still pressing the button for every key in the animation.
First, can someone give me advice on how I would run the script on every key on the hand for the whole timeline.
Second, I eventually would like to use it in a more complex setup where the script is run for every key frame in a timeline, but it is aligning two separate objects.
Example would be if Bip01 has a keyframe then run $‘Bip01 R Hand’.transform = $‘Bip01 R Hand Guide’.Transform
I will always know the names of the objects I want aligned, and I will know the name of the object I want to check for keyframes.
Any help/advice/direction would be greatly appreciated
I keep messing with this, and reading help files when I have time. I thought I was getting close with this
(
local dest = $‘rig_a_Base_Control’.Position.controller
for k in $‘Bip001’.Transform. do
addNewKey dest k.time
)
But I get the error – Syntax error: at name, expected “do” or “collect” when evaluated. I will look into it more tonight after work.