Maya to Unity animation timing weirdness

Been experiencing some “fps weirdness” when importing my maya models with animation. The clips you make in Unity by splitting up the animation tends to not reflect the animation in Maya. For instance an animation in maya that has idle from frame 1-10, and a runcycle from 10-30: In Unity split frame 1-9 as idle, works fine. Now split run-cycle as frame 10-30, but it doesn’t play like in Maya… To have it play correctly in Unity it must be split at 11-36 or similar.

Not that good at explaining this problem, so will try with a concrete example:

  1. Make a test animation in Maya. 1-30 frames, of a ball bouncing.
  2. Export the ball via export selection, as .mb.
  3. Import it in Unity via Assets > Import New Asset.
  4. Split it to have idle animation at 1-30, and you’ll see it doesn’t play as it does in Maya. The correct split range, to make the animation look like in Maya is something like 1-37.

If anything, I can think of, that’s causing this… Is that Maya saves with a default playback speed, maybe 24, and maybe Unity internally plays it back at 30… Maybe?

It’s gets quite bothersome with larger animations that needs to be split into many pieces inside Unity as you have to guess by trial and error when your cycles start and end…

Been giving me gray hairs for a while now, this problem… Has anyone out there found a solution yet?

I’ve been having a similar problem. I have no solution, as I found your post looking for an answer myself.
Thought it must be my fault- cause I can’t imagine such function could be broken in 3.0.

Could FBXs fault…?

Guys,

Which FBX plugins are you using? Which Maya?

The problem can appear if framerate in Maya doesn’t match framerate in exported FBX file, but I haven’t seen Maya doing that, so could you submit bugs with your files attached. I’m not saying it’s 100% bug on Unity - I having submitted bugs makes it much easier to track it.

I submitted a bug report on this very issue a few weeks back. Basically in more modern versions of Maya, you’ll run into this issue where files brought into Unity are assumed to be authored at 30 FPS even if the file is actually using something else like 24fps (which is the default in maya). I normally animate at 24fps and it was no problem until I upgraded to the latest Maya (2011) when I started noticing this very issue.

An easy workaround is to simply make sure your maya files are animated at 30fps and you’ll have perfect consistency. Kind of annoying though, and it IS a bug, though I’m not sure if its Unity’s or the FBX exporter’s fault.

MikaMobile, can you give me your case number?

I also recently upgraded to Maya 2011 around the same time I upgraded to Unity 3.0 Pro.

Thanks for the tip. I changed to 30fps in Maya prefs.
… Hadn’t considered that.

Yeah I defaulted to 30 fps after some tests. Man that was annoying :stuck_out_tongue:

For reference, my problems occured with Maya 2011.

Wow, useful tip to know. Thanks man.

Richard

Hey Paulius, the case number for my report on this issue is 375950.

I have run into similar problems using clips and found that the @ Animation naming convention will correctly read 24fps when imported.

MikaMobile, as you said the problem is in FBX 2011 plugin, so I can’t do much immediately (only suggest that you use 30fps in Maya). I raised a question here: http://area.autodesk.com/forum/autodesk-fbx/fbx-plug-ins-import-export-discussions/maya-fbx-2011-plugins-do-not-export-framerate-properly/ I’ll post here when I have more information.

I am not sure FBX automatically detect the Maya’s FPS preferences.

What you can try is to query the Maya’s FPS value and to apply to the FBX plugin before exporting.

You should be able to use this code in the Mel Script editor :

FBXExportColladaFrameRate 30;

I tried with :

float $frameRate = `playbackOptions -q -fps;

But it always return 0… O_o… I dunno why,

It used to work fine with Maya2010, so they either changed functionality on purpose or it’s a bug. In first case we have to fix Unity, in second one they have to fix the plugin.

I have the same issue, unfortunately, setting Maya playback speed to 30 in the settings doesn’t change the problem (I tried with Maya 2011 and Maya 2008)… Any idea ?

Separating animations (a file for each animation) solved the playback speed issue for me (with maya 2011 and fbx 20113_1) Hope it helps :slight_smile:

No, not really. There was a bug in Unity and I fixed it. Unity 3.2 can work with any framerate in Maya 2011 again.

Well i found the problem. Duplicate your animation and check out the tangent of the last key using Unity’s animation editor.

Did you spot it? Yes thats right unity is modifying your tangents