PDA

View Full Version : Transfer rotations from Maya to 3ds max


SuperRune
02-14-2009, 12:39 PM
I am writing a simple script in Maya to transfer animated object position and rotation into 3ds max. The way I am doing this, is by going through each frame, getting the world position and orientation of the object, and then writing out a maxscript that rotates the object similarly.

Now, I got this working OK with translations, but rotations are quite messed up. There seem to be some differences to how Maya and 3ds max reads out world orientations, and I don't know enough about rotations to see what could be different!

As a test, I took a point object in 3ds max and a null object in Maya and rotated them similarly. First, a 45 degree counter clockwise rotation in the up axis (Maya Y, 3dsmax Z). I then rotated the object 45 degrees in the local X axis. After that I queried the orientation both in 3ds max and in Maya, but the euler angles I get back are quite different:

3dsmax:
in coordsys world $Point01.rotation as eulerangles --returns:
(eulerAngles 35.2644 -30 -54.7356)

Maya:
xform -q -ws -ro null1; // returns:
// Result: -45 45 0 //

In the Maya result you can even see the specific rotations, but the 3ds max result is more mysterious. Does anyone know how I can convert the Maya rotations into the 3ds max ones?


Now, I don't know anything at all about transformation matrices (I got the Bobo DVD, planning on going through it soon), but they look quite interesting. When querying about the matrices, the conversion doesn't look as bad:

3dsmax:
(matrix3 [0.5,0.5,-0.707107] [-0.707107,0.707107,0] [0.5,0.5,0.707107] [0,0,0])

Maya:
// Result: 0.707107 0 -0.707107 0 -0.5 0.707107 -0.5 0 0.5 0.707107 0.5 0 0 0 0 1 //

There's alot more similar values here. But does anyone know what matrix math/stuff/magic I would have to do in Maya to convert this into 3ds max matrices? Is it possible to just shift them around and invert them where needed?

Any help would be much appreciated! Thanks!!

CGTalk Moderation
02-14-2009, 12:39 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.