FBX Exporter: Wrong Bake Animation #104978
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104978
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows 10
Blender Version
Broken: 3.6.5, 4.0.0 (2023-10-30)
Short description of error
Wrong Bake Animation in FBX Exporter.
Exact steps for others to reproduce the error
Appears to be an export issue because other external software import the .fbx the same as Blender. Also present in 4.1.0a (FBX IO version 5.8.8).
The meshes are all parented to an animated Empty Object. Including Empty Objects in the export results in the animation exporting correctly.
Notably, each Mesh Object's
.matrix_parent_inverse
is not the identity matrix. Clearing the parent inverse of each Mesh Object withObject
>Parent
>Clear Parent Inverse
will result in a correct export even when Empty Objects are not exported, but clearing the parent inverse will put the meshes in the wrong positions so it's not a solution to this issue.Sometimes not, there is another offset.
Test Files:
Blender Version: 3.6.5, 4.0.0 Beta (2023-10-30), 4.1.0 Alpha (2023-10-30)
The
Control
Empty Object makes some very small movements at frame 39 and 40. The defaultBake Animation
>Simplify
value in the exporter does not export some of the baked keyframes because they are too similar. Disabling simplification by settingBake Animation
>Simplify
to0.0
will export every baked keyframe and the horizontal offset here disappears.Edit: Ah, it looks like this was also the cause of the initial issue too!
Yes,
Bake Animation
>Simplify
= 0.0 or 0.001 solves the problem for these examples.Field
Simplify
rounds the values and does not display last digits 1,2,3,4:0.00
for0.004
,0.003
,0.002
,0.001
0.000
for0.0004
,0.0003
,0.0002
,0.0001
0.0000
for0.00004
,0.00003
,0.00002
,0.00001
It is better to make this field display the full value without rounding.
The
Control
Empty Object -> RotationY
:Frame 20 = 0 degrees, Frame 21 = -0.6525 degrees, Difference = 0.6525 degrees.
Frame 39 = -89.3475 degrees, Frame 40 = -90 degrees, Difference = 0.6525 degrees.
Frames 20-21 and 39-40 have same rotation, frame 21 is exported correctly, but frame 40 is exported incorrectly.
In blend file in frames 20-40 the rotation was only on the
Y
axis.But after exporting to FBX file with
Simplify
= 1.0 we have changed values forX
andZ
axes in frame 40:X
was 0 degrees in blend file and became 85.986 degrees in FBX file.Z
was 90 degrees in blend file and became 3.6594 degrees in FBX file.File with the original test animation and imported from FBX: Test Export 2 - Compare.blend
Unfortunately, comparing rotations before export and after importing the exported .fbx isn't very useful.
Initially, there is an axis conversion on export to .fbx by default, but on top of that, the way Blender and FBX store Object transformations is very different and there's no guarantee that the imported transformations will match what they were when they were exported. Consider this simplified example of two different rotations that result in the same transformation, where exporting as .fbx and then importing again will set both to the same rotations:
The animation simplification runs on the animated transformations after their conversion to the FBX format, so there's no way to see which keyframes were simplified from within Blender. If the simplification were to leave only FBX
y
rotation on a frame, that could still result inx
,y
andz
Blender rotation after conversion.I don't think there's any bug here, it is an unfortunate consequence of Blender and FBX being different formats.
Another example:
Z
= 90 degreesY
: Frames 0-10, RotationY
from 0 to 90 degreesY
: Frames 90-100, RotationY
from 90 to 0 degreesSimplify
= 1.0Something wrong is happening with the Rotation in frames 10 and 90. Test Cube.blend
Export FBX with
Simplify
= 1.0, 0.1, 0.01 has this problem.Export FBX with
Simplify
= 0.001 can fix it.If Blender can not import this FBX file correctly, it means that other user programs may also have problems with importing such FBX files.
This problem in the above examples happens in the first and last frames in the gap between the rotation animations.
If it's hard to fix or it's not a bug, then I propose change the default value for the
Simplify
field from 1.0 to 0.001, because something is not working properly withSimplify
= 1.0.Hi @Mysteryem , I absolutely agree with @gtitaev that the default settings should change, because you cannot count on every artist will read the settings and documentations properly, 80% of artists will simply click the confirm button and call it a day.
Just because they didn't change the settings properly, thus a feeling that blender is not suit for production pipeline. If the default settings for fbx i/o can be changed to a more reasonable config, people all over the world will find blender can export fbx with no problem at all.
Here is a camera i/o version of the same issue opened by me#105058
I'm not saying whether I think the default settings should or should not be changed, just that, given how the simplification process works and the default export settings, I would say this behaviour is expected.
For your own export process, I would recommend setting your own Operator Preset with your desired export settings. For example, I work with Unity a lot, so I use a Preset with
Transform
>Apply Scalings
set toFBX All
to prevent my armatures being scaled up 100 times when imported into Unity.I think the simplification function could definitely be improved (the Graph Editor has some nice operators for decimating curves, but they can't be used easily from addons and FBX I/O currently only supports exporting keyframes with linear interpolation), but FBX I/O doesn't really see any development outside of bug fixes and community contributions (which includes myself).
If you want to contribute, the wiki can get you started https://wiki.blender.org/wiki/Developer_Intro, but otherwise the issue trackers aren't really for feedback and features requests: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests