|
Hey there. So, I’m transferring data from one animated rig to a completely different animated rig. Translations seem to be working fine, but whenever I apply a key to the rotations using this code:
for animTime in animStart to animEnd do
with animate on
at time animTime
(
p = inverse proxyName.transform.rotationPart
orientName.rotation = p
)
I end up setting keys on the orientation and translation. Conceptually, I think I know what’s going on (I could be wrong). Since the position of a rotated object in a hierarchy is also changing it’s world position and “animate on” records changes associated with objects referenced within, it sets keys on position as well. Is there a way to isolate the keys to the rotation and avoid altering the translation? Maybe I’m not setting the right rotation value.
Any hints?
Thanks,
Alec
|
|
|
|
Do this when you are collecting the transforms for your objects keys. Getting the rotation or transform data relative to the parent is very important.
if (animObj.parent == undefined) then (
obj_Transform = animObj.transform ) else (
obj_Transform = animObj.transform * (inverse animObj.parent.transform)
)
Applying that transform to the new object should work better than the method you were using before. Also, be careful with scales you may have to do a check and some math before applying this transform back.
Randall Hess
Senior Technical Animator
THQ, Volition Inc.
|
|
|
|
Awesome! Thanks for the tip. It’s really helpful.
Alec
|
|
|