Animation jitter on FBX export #77811

Closed
opened 2020-06-12 20:24:32 +02:00 by Michael · 18 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: AMD Radeon (TM) R9 200 Series ATI Technologies Inc. 4.5.13559 Core Profile Context 26.20.12028.2

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: blender/blender@211b6c29f7
Worked: Has been happening since I started using Blender (~2015, 2.76).

Short description of error
When exporting animations into Fbx there are randomly placed spikes in the rotation curves that weren't there before.

Exact steps for others to reproduce the error
Based on this file:
JitterLegBug.blend

  • Export to fbx (as of now I have not found any setting that seems to change the outcome).
  • On a new blender file, import the fbx.
  • Play the animation/open the graph editor, there's noticeable jitter on frame 3. Here's my result:
    JitterLegBug.fbx

I've been using the same humanoid armature for a long time, though at first the issue was rare, so maybe the origin is in some sort of armature corruption. The attached file contains the isolated bones of a character that started to show the issue. I would be really grateful for any help.

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: AMD Radeon (TM) R9 200 Series ATI Technologies Inc. 4.5.13559 Core Profile Context 26.20.12028.2 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `blender/blender@211b6c29f7` Worked: Has been happening since I started using Blender (~2015, 2.76). **Short description of error** When exporting animations into Fbx there are randomly placed spikes in the rotation curves that weren't there before. **Exact steps for others to reproduce the error** Based on this file: [JitterLegBug.blend](https://archive.blender.org/developer/F8612469/JitterLegBug.blend) - Export to fbx (as of now I have not found any setting that seems to change the outcome). - On a new blender file, import the fbx. - Play the animation/open the graph editor, there's noticeable jitter on frame 3. Here's my result: [JitterLegBug.fbx](https://archive.blender.org/developer/F8612473/JitterLegBug.fbx) I've been using the same humanoid armature for a long time, though at first the issue was rare, so maybe the origin is in some sort of armature corruption. The attached file contains the isolated bones of a character that started to show the issue. I would be really grateful for any help.
Author

Added subscriber: @Nib

Added subscriber: @Nib

#82303 was marked as duplicate of this issue

#82303 was marked as duplicate of this issue

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can confirm the change in animation. The original FCurves are all smooth, but the exported-then-imported one is the thick green curve showing the glitch:

image.png

I can confirm the change in animation. The original FCurves are all smooth, but the exported-then-imported one is the thick green curve showing the glitch: ![image.png](https://archive.blender.org/developer/F8625455/image.png)
Author

I have managed to replicate the issue on a new file:
ReplicationNewIK.blend
Exported FBX:
ReplicationNewIK.fbx

Once again, export FBX and reimport into an empty scene, go to frames 37-39, and zoom on the foot. There's as slight movement where the foot "jumps" from the IK control. I would say it's related to compression somehow, I would also say it's related to constraints but the problem has appeared at times on unconstrained bones.

For my original armature the problem seems to have gone worse with the years, and where in this file there is only a slight misplacement, my character have bones jumping all over the place.

Honestly this is quite terrible, old files seem completely unrecoverable and I'm scared that any new work I do will end up the same.

I have managed to replicate the issue on a new file: [ReplicationNewIK.blend](https://archive.blender.org/developer/F8700055/ReplicationNewIK.blend) Exported FBX: [ReplicationNewIK.fbx](https://archive.blender.org/developer/F8700058/ReplicationNewIK.fbx) Once again, export FBX and reimport into an empty scene, go to frames 37-39, and zoom on the foot. There's as slight movement where the foot "jumps" from the IK control. I would say it's related to compression somehow, I would also say it's related to constraints but the problem has appeared at times on unconstrained bones. For my original armature the problem seems to have gone worse with the years, and where in this file there is only a slight misplacement, my character have bones jumping all over the place. Honestly this is quite terrible, old files seem completely unrecoverable and I'm scared that any new work I do will end up the same.

Added subscriber: @anotheryeti

Added subscriber: @anotheryeti

Seeing this bug as well, seems to be related to the IK solver in my particular rig.

There's a bone which jumps around all over the place when exporting. This behavior stops if the IK rotation limits are turned off for that particular bone.

This bug makes the export unusable with the constraints turned on. Behavior happens from frames ~120 to ~150 on right shin. Wild 180deg rotational changes.

riggedShroomie3.blend

Seeing this bug as well, seems to be related to the IK solver in my particular rig. There's a bone which jumps around all over the place when exporting. This behavior stops if the IK rotation limits are turned off for that particular bone. This bug makes the export unusable with the constraints turned on. Behavior happens from frames ~120 to ~150 on right shin. Wild 180deg rotational changes. [riggedShroomie3.blend](https://archive.blender.org/developer/F8729526/riggedShroomie3.blend)

Added subscriber: @mont29

Added subscriber: @mont29

Possibly related to #53908?

Possibly related to #53908?

Added subscribers: @MikeFromHere, @ankitm

Added subscribers: @MikeFromHere, @ankitm

Added subscriber: @LucasVeber

Added subscriber: @LucasVeber

I have pinned the possible cause but without being able to fix it. Any insight on this would be appreciated.

The get_matrix_local() function returns incorrect rotations, which I try to illustrate with these screenshots of the graph editor.
On the left are quaternion curves of the "legUp" bone. They were obtained by printing the get_matrix_local() returned matrix> to_quaternion() of this bone for the first 5 frames, then keyframing by hand the bone with each printed value.
Notice the jumps that witness the incorrect rotations.
On the right, same quaternion curves but obtained by skipping the parent bone matrix inverse multiplication in the get_matrix_local() function. No jumps, rotations are correct.

1.jpg

When printing quaternions of the bone parent matrix, values are constants. Which is correct, since this bone is not animated. Then, it should not be the root cause.
Thus, the cause seems to be either an imprecision/error in the matrix multiplication (par_mat_inv @ bone.matrix) or the matrix to rotation (euler/quat) conversion.

I have pinned the possible cause but without being able to fix it. Any insight on this would be appreciated. The get_matrix_local() function returns incorrect rotations, which I try to illustrate with these screenshots of the graph editor. On the left are quaternion curves of the "legUp" bone. They were obtained by printing the get_matrix_local() returned matrix> to_quaternion() of this bone for the first 5 frames, then keyframing by hand the bone with each printed value. Notice the jumps that witness the incorrect rotations. On the right, same quaternion curves but obtained by skipping the parent bone matrix inverse multiplication in the get_matrix_local() function. No jumps, rotations are correct. ![1.jpg](https://archive.blender.org/developer/F9389358/1.jpg) When printing quaternions of the bone parent matrix, values are constants. Which is correct, since this bone is not animated. Then, it should not be the root cause. Thus, the cause seems to be either an imprecision/error in the matrix multiplication (par_mat_inv @ bone.matrix) or the matrix to rotation (euler/quat) conversion.

This can be stated clearly using a simple python script.
Bug reported here:
https://developer.blender.org/T83196

This can be stated clearly using a simple python script. Bug reported here: https://developer.blender.org/T83196
Proposal to fix it: https://developer.blender.org/D9674

So this have been fixed by blender/blender@814b2787ca as well right?

So this have been fixed by blender/blender@814b2787ca as well right?

Absolutely! My patch can be removed.

Absolutely! My patch can be removed.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Bastien Montagne self-assigned this 2020-12-01 10:29:42 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#77811
No description provided.