Hi there !
I have a scene with an animated object, and my main goal is to create a locator at the same spot of the object ( 1st frame ) and paste the same animation,
No constraint, no bake.
I started by the first step, which is creating the locator at the same spot. For this I used xform and the object pivot as wanted final position:
string $objs=`ls -sl`; spaceLocator -n ($objs+"_loc"); float $t = `xform -q -ws -t ($objs+".rotatePivot")`; float $r = `xform -q -ws -ro $objs`; float $s = `xform -q -ws -s $objs`; string $dest = ($objs+"_loc"); xform -ws -t $t $t $t $dest; xform -ws -ro $r $r $r $dest; xform -ws -s $s $s $s $dest;
Ok, that worked great, everything is well in place. Now I can check how to copy-paste the animation curves. For that, I used the simple way to verify:
copyKey -option curve "object1"; pasteKey -option replaceCompletely "locator1";
But this is where everything is messing up, because the curves were identical after copy-paste ( good ), but the locator was offseted. Why ?
After som searching, I figured out that the object have his pivot moved ( not because of the script. It was already like this ).
There are values in Local Rotate Pivot and Local Scale Pivot, where my locator have 0 0 0.
I can’t find a way to make everything in line. Tried to add some -rp params in my xform copy, but it creates an offset.
Do you know what I’m missing here? ( without freeze transforming )