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.48k stars 316 forks source link

Bug while exporting 'full collection hierarchy' elements with animation in .glTF #2294

Closed EGFrosch closed 1 month ago

EGFrosch commented 1 month ago

Describe the bug Can't export object with animation and "full collection hierarchy" in glTF. When trying to export object with the full collection hierarchy it say "AttributeError: 'Collection' object has no attribute 'animation_data' . Did you mean: 'animation_data_clear' " and don't export the element.

To Reproduce

  1. Create animation (already done in the .zip project)
  2. Go to 'export > glTF 2.0 (.glb/.gltf)'
  3. Click on 'Data > SceneGraph > Full Collection Hierarchy'
  4. Click on Animation and Select Animation mode all other mode than 'NLA Tracks' ('Actions', 'Active actions merged', 'Broadcat actions', 'Scene') → 'NLA Tracks' doesn't stop the export but the animations are not exported
  5. Click on 'Export glTF 2.0'

Expected behavior glTF export of a model that include the objects wanted (based on the 'Include' element selected during export)

Screenshots image image

.blend file IssueExportingHierarchy.zip

Version

julienduroure commented 1 month ago

Hello, Thanks for the reporting. This bug is already fixed in main branch. Commit is candidate to be backported to 4.2.x LTS