Imported animation has incorrect sample rate

I have a number of FBX animation assets made in MotionBuilder 2013 that I have used in the past in a different engine that I am trying to bring into Unreal.

The animations are set to have a sample rate of 60fps in MotionBuilder, however when I import them into Unreal they all have an extremely high number of keys/frames detected by the importer across the correct animation length.

For example, if I try import an animation of around 70 frames in length into Unreal the importer detects over 2000 keys/frames. This is significantly increasing the import time and causing some animation glitches in the imported asset. The animation is still the correct length and mostly looks ok, there is just a huge amount of subframe data apparently being found.

Has anybody else come across something like this and what are some possible reasons that Unreal would be detecting so many keys when importing an animation?

***Edit: *** I have attempted bringing the animation into 3ds MAX 2017 and re-exporting them, the issue remains.

I have had a quick look at the Unreal FBX import code and it looks like my animations are using the default maximum possible sample rate (1920fps).

I’m going to have a more in depth look at the FFbxImporter::GetMaxSampleRate function and see if it I can find any hints as to what data my animations are missing.

1 Like

Hey there, are you using a master animation in Motion Builder i.e an animation that has all of the animations glue together? If that is the case when you export to fbx you should have a place to limit how much frames you want to export.

Hey, thanks for the reply.

No, each animation is in its own file.

When imported into Unreal the animation is the correct length in terms of time, so it seems to be correctly detecting the time span of the animation.

The issue is that Unreal is detecting that there are a huge number of extra keyed frames between the ones that should have been exported.

I built Unreal from source and stepped through the GetMaxSampleRate function. It turns out that about five different sample rates are being detected on different bones in the animations I’m importing.

I’ve been able to fix this by baking the animation to the control rig in the asset file. Although I’m not sure why this fixes the issue as I have been baking to the skeleton as part of my export process.

Turns out this was a fluke. Baking to the control rig just happened to change the number of key frames to a factor of 60.

The real issue appears to be that MotionBuilder has a global setting enabled by default called “Use Constant Key Reducer” which will remove most redundant keys on a bone when the animation is baked if there is no change in the curve. This global option overrides the options selected when baking.

Normally this is a OK, but in the case of Unreal it causes some bones in the hierarchy to be detected as having a random number of frames in them over the course of the animation (for some reason MotionBuilder most often left keys on the first, last and second last frames).
This meant that Unreal thinks it has to come up with a sample rate to accommodate bones with different frame rates (It tries to find the lowest common multiplier of those values). If those values don’t have a common multiplier Unreal maxes out the sample rate to 1920fps.

Why there isn’t the option to simply choose the sample rate of the animation I’m importing I don’t know…

I was able to fix this issue just exporting the animation from Unreal and then reimporting this Unreal exported animation again. Seems that unreal always export the animations at 30fps. Hope it helps!

Incase anyone else stumbles onto this, the fbx importer now has an option to set the sample rate.