Animation Jitter: Rigged Character with FBX Export
Open, ConfirmedPublic

Description

System Information
Operating system and graphics card

Windows 10
Processor: Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz
RAM: 16.0GB

NVIDIA GeForce GTX 1070
Driver version: 388.13
Direct3D API Version: 12
CUDA Cores: 1920
Graphics Clock: 1607 MHz
Memory Data Rate: 8008 MHz
Total Available Graphics Memory: 16302 MB
Dedicated Video Memory: 8192 MB GDDR5

Blender Version
Broken since I started using Blender (roughly v2.77)
Specifically, broken currently using Blender v2.79a (Date 2018-02-21 10:41)

Short description of error

When exporting animations containing position and rotation animated data on armatures I prepared to map nicely to Unity's standard Mecanim Humanoid, the exported animation data does not really reflect the animation curves properly in Blender. In Blender, the position and rotation curves, using Bezier interpolation work great and are smooth as expected. The exported data, however, looks almost as if it was an audio signal with noise -- there are somewhat "random" little peaks and crevices that cause terrible jittering in my character (most notably in their arms and legs) when I export my character to an FBX file and turn on "Bake Animation" (so the FBX file has the animation with it). These results have been observed when importing that FBX file into Unity (Unity 5.x, 2017.x, and 2018.1's beta versions all alike), even when all animation curve re-sampling and compression has been turned off.

Exact steps for others to reproduce the error
Based on the attached .blend file -
Select the parent empty object I created called "Castle Knight". In the 3D view, you can press Shift + G to select all of its children, and then re-select the parent empty object again. Deselect the Knight's Halberd. Then with that selection of just the knight character and its armature, go to File > Export > FBX (.fbx). Here are my export settings:

Version: FBX 7.4 Binary

Selected Objects: true (checked)
Scale: 1.00 (Not applied, however! The button to its right has been unchecked)
Apply Scale: FBX All
Forward: Z Forward
Up: Y Up

Include: [Empty, Armature, Mesh, Other]


In the Armature tab,
Only Deform Bones: true (checked)
Add Leaf Bones: true (checked)
Primary Bone Axis: Y Axis
Secondary Bone Axis: X Axis
Armature FBXNode Type: Null


Under the Animation tab,
Baked Animation: true
Key All Bones: true
NLA Strips: true
All Actions: false
Force Start/End Keying: true
Sampling Rate: 1.00
Simplify: 1.00


So when I do this, everything is exported great, the NLA strips are nice and organized, the mesh is perfect in every other way, it's just that the animations end up with this weird (and very obvious) jittering and twitching throughout the entire animations.

Anyway, let me know if there's anything at all I can do to help. I really hope this can get fixed or circumvented somehow -- my games depend on this!

Details

Type
Bug
Carlos (ModLunar) renamed this task from Rigged Character Animation with FBX Export to Animation Jitter: Rigged Character with FBX Export.Mar 29 2018, 5:30 AM

To help narrow this down a little, when you say that there are little jumps/peaks, is this on any particular curves (i.e. rotation curves in particular), or just any/all of them? Could you include a screenshot of these?

Carlos (ModLunar) added a comment.EditedMar 29 2018, 6:17 AM

To help narrow this down a little, when you say that there are little jumps/peaks, is this on any particular curves (i.e. rotation curves in particular), or just any/all of them? Could you include a screenshot of these?

Sure, great idea thanks!

Now that you mention it, most of the curves in the FBX file are rotation because I use IK for the feet and arms with non-deform bones that are not included in the export to have a less cluttered hierarchy. The IK goal bones had position animation data, and then the other bones end up with resulting rotation animation data. However, the hips, spine/chest, and neck bones were all fine! Those bones had no jitter in my animations.

The problems occurred mainly in the shoulder, upper/lower arm, and hand bones. The shoulders are not part of the IK chain, just the upper arm and the lower arm bones are. The latter two have Inverse Kinematic limits placed on them in the Bone tab in the Properties window in Blender.


Here's the smooth position animation data of the Hand L IK Goal bone as is in Blender before export. In Blender, the other bones don't have rotation animation data because they're being controlled by the IK bone constraint.

Then in Unity with the FBX file, here's a shot of the left shoulder and left upper arm bones with the jitter (rotation animation data)

Carlos (ModLunar) updated the task description. (Show Details)

Also I forgot to add a visual -- This shows the animation in both Unity and Blender, and the differences are most obvious in the arms. The feet and legs here look pretty fine - I can't tell that there's anything wrong with them.

Philipp Oeser (lichtwerk) triaged this task as Confirmed priority.

Confirmed on first sight, will have a look shortly.
Note: I checked by exporting with the settings the report suggest, resulting in

And just importing back into blender will also result in jittering, see

Registered specifically to say that I found a solution for the same problem I was having with a different animation.

The problem for me was Unity's animation compression - on the Import window, Animation tab in Unity, you'll see the dropdown menu "Anim. Compression" towards the top. By default it will have Keyframe Reduction, which produced jitters, but if you turn it to "Off" the jitters ought to go away.