Author Topic: Strange X,Z camera rotation on FBX import to Maya  (Read 1096 times)

Offline yesmine

  • Member
  • *
  • Posts: 57
Strange X,Z camera rotation on FBX import to Maya
« on: March 18, 2015, 12:06:27 AM »
I have an camera with animation exported from TG3 in FBX format that I am trying to import into Maya. It's been a bit frustrating because while the Y rotation appears to be workable, the X and Z rotation present this strange result (see the image below.) I have no idea why the sudden spike up and down appears in the midst of the X and Z animations when it is not in the camera coming from the Terragen scene. In fact, both X and Z have very little rotation in general, Y having the most, but Y seems to come through okay while these are a headache.

The image shows three screen captures from the Maya Graph Editor for the XYZ rotation.

(CORRECTION to my experiments: In fact, the odd peaks, while making it look like the movement should jerk back at some point, do not cause any unexpected movement if the shape of the graph is left as-is . If the entire graph is moved as one, or if all unnecessary baked-in keys are deleted and only keys necessary to maintain the shape of the chart--with the up/down peaks--are kept, the camera movements are fine. However, for some reason if the keys involving the spiked up/down points are deleted, such as if you wanted to clean it up so it looks like a normal graph to the eye, then the camera will completely invert in going from the first key to the last.)

Anyone know what might be causing this, or is there a better way to export a camera from TG3 to get it to Maya now? Thank you.
« Last Edit: March 18, 2015, 03:45:56 AM by yesmine »

Offline Matt

  • Planetside Staff
  • *
  • Posts: 2858
  • I'm the crazy one
Re: Strange X,Z camera rotation on FBX import to Maya
« Reply #1 on: March 24, 2015, 01:46:08 AM »
Some rotation aren't able to be represented properly with only 3 axes of rotation. This is commonly known as "gimbal lock". The closer the rotation gets to gimbal lock, the more rapidly the values change on some axes. The key thing here is that the rotation works if you leave the curves as they are. But the spike can be a problem if you want to change the animation, or if you want to render this camera with motion blur.

If you're just working in one application, you can usually avoid this problem by changing the rotation order of the camera (in apps that support this option), but you have to anticipate how you want to animate the camera and choose a rotation order before you start animating. I think what's happening here is Terragen's FBX exporter is converting the rotation values to the default rotation order for FBX (which is different from both Terragen and Maya default), and the values it produces have this odd spike, by necessity. Or it might be that the FBX importer in Maya is converting from one rotation order to another.

What does the Maya camera say its rotation order is after you import the FBX?

If you need to eliminate the spike for practical reasons, you will need to choose a different rotation order in Maya. I'm a little hazy on how this works in Maya, but I think that simply changing the rotation order will cause a completely different rotation, so that won't work. But there are ways of constraining one camera to another camera with a different rotation order and baking out a new set of keys.

There might be some changes we should make to our FBX exporter to avoid this.

Just because milk is white doesn't mean that clouds are made of milk.