We recently ran into some behavior that we don’t quite understand whenever lights or cameras are exported.
In a simple Max scene consisting of a free camera, target direct light, and a mesh, the camera and light have an additional post rotation applied. For the camera, the postrotation is (0,-90,0). For the light, it is (-90,0,0). This also being exported with Z-up.
But I’m still not entirely clear why the rotation needs to be applied. That link doesn’t also really explain why lights need it, too.
If anyone could elaborate on this or point me towards any additional resources, I’d appreciate it. I didn’t really find anything talking about this specifically in the SDK docs (though I could’ve missed it).
So far, neither the evaluator or “scratch” global transforms match what I get when I dump the transform info with maxscript.
At this point, I’m a little lost as to what’s going on. I’ve seen similar behavior when I look at a camera node. If anyone has any insight, I would certainly appreciate it!
(I also attached the FBX file that I’ve been using)
I forwarded your question to the principal dev and the following was his answer.
“Post rotations are applied to Cameras and Lights to compensate for the default orientation they have in the FBX SDK and in the different applications (3dsMax, Maya, etc…)
In the FBX SDK, a directional light that have a 0,0,0 rotation vector is pointing toward the –Y axis. The camera, with a 0,0,0 rotation vector is pointing toward the +X axis.
In 3dsMax the target light and free camera with a 0,0,0 rotation vector are both pointing toward the –Z axis. Hence, the required compensation (obtained by the Post-Rotation) so that these objects will point in the same direction when expressed in the Y-Up system (remember that the FBX file are always saved in a Y-Up space with units expressed in centimeters).
Also, because of the FBX SDK convention mentioned above, there is an extra operation involved when exporting from 3dsMax to FBX that is : the axis conversion to bring the whole scene into a Y-Up system. This can explain why the matrices you get with the Max script do not match the ones computed with the FBX SDK/FBX plug-in.