blendergltf
blendergltf copied to clipboard
Objects with bone as parent exports with wrong orientation
When setting a bone as the parent of an object, the object exports with the wrong rotation.
I have created a simple test case to demonstrate the issue.
In Blender, the red object has the top bone as a parent:

When viewing the exported file (using glTF Viewer), the red object has now rotated 90 degrees along the X axis:

Zip containing .blend, .gltf and .bin:
parent-bone.zip
While some initial support for bone parents was added, they are not quite ready for use. Since you have expressed a need for them, I will try to make bone parent support a priority in the next minor release.
There is a bit of a space conversion from world space to the space the bones are in that is happening at the root node. When leaving the bone hierarchy, this conversion is not undone. There will need to be some discussion on how to handle this conversion in a way that makes sense for users. I am currently thinking about two options. Either insert an extra node with the proper transform, or to apply the transform to the bone child's node.
Thanks for looking into this. I'll have to admit my understanding of how this exporter works is limited so I'm not sure how much help I can be in discussing tactics.
What would be the advantage of an extra node instead of directly applying the transform? What exactly would the extra node be? A new Object3D that becomes a new child of the bone and the parent of the original child object?
The more I look into this, the more it looks like the bone child's matrix should be fixed. In this case an extra node would provide little to no benefit. Updating the tags to mark this as a bug, and adding it to the 1.2.1 milestone.
+1 for this feature. I'm using this for rigid binding model to certain bone in glTF.