Fbx exporting custom frame rate as 12.5fps

Hi, I’ve been trying to export some animation to go in unity via FBX. I want a fps that gets set on export but have found that when the frame rate is not one of the presets it the fbx gets set to 12.5 and then the key frames are scaled.
An example would be
desired 21 frames at 84fps
result ~3 frames at 12.5fps

Any ideas how to fix it?

Export at 30fps (standard for game animations) then change the fps in Unity. Why are you using such weird frame rates anyway? Just scale your animation to work in 30fps and you are good to go. The extra interpolated frames won’t matter.

It’s a complicated unity setup where all the locomotion animations need to move at the same velocity then the anim speed gets modified based on the gameobject world velocity

Still seems like an easy thing to program, but I’m no programmer.

I haven’t tried it yet, but perhaps this will help you?

http://www.gamefromscratch.com/post/2015/12/17/Better-FBX-Support-in-Blender-Using-The-Autodesk-FBX-SDK.aspx

I’m not really a programmer either but spent quite a lot of time scripting a pipeline where it would be ideal if I the custom fps got stored in the fbx. Not sure if I fancy reworking the exporter bit but will take a look, thanks.

I got a few questions for you, trying to help best I can, since I’m about to have to export via fbx. Anyways, I don’t see any options for frame rate in fbx exporter, so have you tried exporting in ascii fbx and opening the readable file and see if you can find the setting for it

The fbx frame rate is the blender scene frame rate, you can see if you use a preset that it appears correctly in unity and the end frame is correct in auto desk fbx viewer.

Have you tried setting the Simplify value under animation in the fbx export to 0?

Looking at the export script it looks like a double int type. Hmm, have you tried a whole number frame rate? I currently don’t have Unity installed or I would test it.

Thanks for the suggestions, no luck with either I’m afraid.

I’m pretty sure it’s a bug so have reported it, https://developer.blender.org/T48610

There is a work around for this inside Unity. The animation data isn’t actually lost in the FBX but unity resamples it and that is where data loss occurs, you can turn off resampling in the animation to get the data back.
However I’m not sure of the repercussions, presumably it is beneficial for unity to resample the animation or it wouldn’t be on by default.

How is it a Blender bug if Unity is resampling the animation? :stuck_out_tongue:

I tested exporting an 84fps animation and importing it again in Blender and it worked fine.

you’re right blender reimports the fbx fine. I guess the problem is the FBX format. The reason I think its a blender bug is that unity AND the official fbx viewer thinks any blender custom fbx file is a 12.5 fps file. I’m not sure fact that blender reopens means its working correctly, however I don’t think max or maya does either :expressionless:

In the bug report someone replied saying they would need an example behaving as expected from max or may to compare. I asked a few people to try and make me an example files as I don’t have either installed but they seemed unable to export at a non standard fps.
I don’t suppose anyone here is in a position to try? The only requirement is that it uses FBX 7.4 (or 7.3)(those are ‘2014’ or ‘2013’ versions). and the fps is non standard eg 37fps