Fbx export: random, weird bones rotation artefact #53908
Short description of error
First, sorry if this report is a duplicate, i've found some similar report but could not make sure they're the same.
A few bones orientation are wrong when exported to Fbx then imported in Unity or Unreal Engine. Importing back the Fbx in Blender is ok, but not in these game engines.
Exact steps for others to reproduce the error
- Import the attached fbx file in Blender, then check it's ok.
- Export it to fbx using the default options
- Import in Unity or Unreal Engine. The lips, cheeks and chin bones are distorted. After investigation, moving of +/-0.01 the bones transforms in Blender before exporting can fix it. So it seems to be an imprecision error at some point...
Dont have access to Unity/Unreal atm.
@LucasVeber : could you upload a screenshot of both Unity and Unreal as a reference?
While praying for this bug not to be forgotten in the dark, i've simplified at maximum the example blend file (attached) to help. It now only contains one mesh and two bones. When exporting to Fbx and importing in other apps, such as Unity, "bone2" is imported with Rot X = 179.8, instead of -90.
Rotating in Edit Mode bone2 1 or 2 degrees in Blender fixes the issue. However it's not a clean solution, it may happen in other situations. Seems to happen when a bone is making 180 degrees x-axis angle with its parent.
After further investigations with the Fbx exporter code, tracking the exported rotations values seems to output correct values. However it's the way these values are read in other app that is the problem. Likely to be an euler issue, if only Fbx used quaternions...
Exported rotations from Blender, using a "print" command in the Fbx script (truncated for readibility):
bone1 [-90, 0, -90]
bone 2 [179.8, 0.115, 0.035]
Imported rotations in Unity (truncated for readibility):
bone1 [0.000, -90, 89.9]
bone 2 [179.8, -0.115, 0.0]
@LucasVeber, thanks for simplifying the test case!
@mont29, not an expert, but doesn't seem to be bug in Blender, since this is another software which doesn't read values Blender is saving? Mind having a look?
I was reading this ancient post about FBX import/export in Blender, and it mentions "FBX bones are not aligned along the same axis as Blender bones (former are along -X axis I think, while later are along +Y axis)".
If this was never fixed, it might be what's causing the weirdness displayed in the previous sreenshot
No due date set.
No dependencies set.
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?