I'm trying to import some animation keys into Maya, and I've run into a small problem with importing
rotation keys. Apparently, to use addKey(), I must convert my quaternions to Euler angles. I use Maya's
math functions to do it, which seems easy enough:
MQuaternion q( myquat.x, myquat.y, myquat.z, myquat.w );
MEulerRotation euler = q.asEulerRotation();
animCurve.addKey( MTime(t, MTime::kSeconds), euler.x );
(etc... for each x,y,z component)
This works OK for the most part. However, when I play back my animation in Maya, I can see some bad
rotations happening. Joints seem to be rotating in the wrong direction.
Assuming the data is good and the calculations are correct, what can I do to fix this?