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.49k stars 317 forks source link

Disconnected bones export with the wrong rotation #1881

Closed ansonkao closed 1 year ago

ansonkao commented 1 year ago

Describe the bug

Disconnected bones export with the wrong rotation. It doesn't seem to be all disconnected bones in general, as I tried recreating the bug in a new .blend file, but the rotation error did not happen there. Perhaps there's some specific scenario with disconnected bones that causes the bug.

To Reproduce + Expected Behaviour

File with the issue

I've attached the original offending .blend file where the problem can be reproduced. Inside the .blend file you'll see the following mesh and rig:

image

In the NLA, you'll see a single track "IdleTrack" with a single-frame "IdlePose" action in it. This is what the pose should look like:

image

Export to GLTF

Export to .glb with the following settings:

Then re-import the resulting .glb file into a fresh new blender scene. Here, you'll that the pose has been exported with the wrong rotations on the pelvis and shoulder bones. I think some of the bones in the hand are also incorrect, but it might be simpler to see and debug the problem isolated in the other two areas.

image

You can import this .glb into other viewers and confirm that the problem is on the exporter side, not the importer side.

.blend file / .gltf

disconnected-bones-gltf-io-bug.zip

Version

Additional Context

Probably not relevant here, but FWIW I've been trying to export the Rigify rig to GLTF, and had a lot of complications there where poses would export, so I gave up and started just using the plain MetaRig without all the IK constraints etc.

julienduroure commented 1 year ago

Hello, Thanks for your report. I can confirm. Seems the issue is already solved in main branch (that will become 3.6), because 3.6 will come with a refactored code for animation export. You can test 3.6 alpha here: https://builder.blender.org/download/daily/ Let's close this ticket. If you still have an issue, feel free to comment and reopen this ticket.

ansonkao commented 1 year ago

Appreciate the reply! 🙏 Confirmed this resolves it, although I reported a new issue in 3.6 here: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1884