KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.46k stars 314 forks source link

Incorrect skinned mesh export #2040

Open hybridherbst opened 9 months ago

hybridherbst commented 9 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Download boneStudy.zip
  2. Open in Blender 4.x
  3. Export as GLB

Expected behavior Correct skinned mesh or export warning telling me why it doesn't work image

Actually: incorrect export image

Screenshots If applicable, add screenshots to help explain your problem.

.blend file/ .gltf boneStudy.zip

Version

Additional Context:

Export is somewhat better but also not correct with "Flatten Bone Hierarchy" enabled

julienduroure commented 9 months ago

The problem come from your armature being child of an object with non uniform scaling. That leads to non decomposable transformation matrix, and this can't be express correctly in glTF. The same way you have a "Flatten Bone Hierarchy", you now have a "Flatten Object Hierarchy" in Data => Scene Graph It seems to solve the issue.

It can be tricky to detect this case, especially during animation, explaining why there is no warning or error for now. Setting as enhancement for now, checking if we can check it for still scene at export