Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / animate on -- setting rotations also offsetting and keying translation
  RSS 2.0 ATOM  

animate on -- setting rotations also offsetting and keying translation
Rate this thread
 
22325
 
Permlink of this thread  
avatar
  • AlecF
  • Posted: 04 February 2009 01:27 PM
  • Location: San Rafael, CA
  • Total Posts: 17
  • Joined: 31 August 2006 02:54 PM

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
        
(
              
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



Replies: 0
avatar

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 == undefinedthen (
  
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.

Replies: 0
avatar
  • AlecF
  • Posted: 05 February 2009 01:00 PM

Awesome!  Thanks for the tip.  It’s really helpful.

Alec



Replies: 0