glTF-Blender-IO icon indicating copy to clipboard operation
glTF-Blender-IO copied to clipboard

Exporting a scene with armature and parents, get weird result

Open ibozhilov opened this issue 5 years ago • 3 comments

Describe the bug When I have a structure of parented bones and export the scene, the result is unexpected i.e. meshes are flying all over the place. What is interesting is that if I export the file to obj and then using obj2gltf I create a gltf everything is fine.

To Reproduce Steps to reproduce the behavior:

  1. Open the attached file
  2. Export to gltf.
  3. Open the gltf file

.blend file/ .gltf 229.zip

Version

  • OS: Ubuntu 19.04
  • Blender Version 2.81

ibozhilov avatar Nov 28 '19 14:11 ibozhilov

I thought that the transform of parented objects to bones was recently fixed. In my test example, at least, that works now, tested with b2.81 and the gltf master 1.1.16. (https://github.com/capnm/b8TransportRobot/tree/master/gltf)

Your blender project generates a lot of garbage and the animation transforms look also broken. I think it could help if you try to clean up your blender file and try to make a minimal test case.

image

capnm avatar Nov 30 '19 08:11 capnm

Confirmed that the file provided is quite ... strange. Only 1 bone by armature, but lots of different armature objects ... A minimal blend will help for sure, as said by capnm

julienduroure avatar Nov 30 '19 17:11 julienduroure

After recent refactoring, it looks really better. Seems there are still some missing animation, but all still part are OK, and animated parts (that are exported) are OK too. Probable root cause : Some bone constraints between 2 armatures. Constrained armature has no action/animation_data. Even with exported selection to bake animation of all selected objects, we currently don't bake bone animation

julienduroure avatar Mar 05 '22 17:03 julienduroure

Hello, This is now fixed in current main branch, after animation refactor 64e3532f48ebdf878a1c9b81ade6d1a19c8ff890

Because some pieces are not animated directly, but using constraints, you can use "Bake all object animation" to solve the issue, and animate all object at export

julienduroure avatar Feb 26 '23 10:02 julienduroure