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

Inconsistent export extensions hook for `gather_animation_channel_hook` #2337

Closed marwie closed 1 month ago

marwie commented 2 months ago

Describe the bug

Hello, I currently have a glTF file that fails to export when i have the gather_animation_channel_hook registered in my addon and it turns out that this hook exists twice both in the readme and in the code.

The file exports fine without my addon enabled or when this hook is not added - the bug only appears when my hook is present.

Is this something I can fix on my side or is this a bug in the glTF exporter?

Traceback (most recent call last):
  File "c:\Program Files\Blender Foundation\Blender 4.2\4.2\scripts\addons_core\io_scene_gltf2\io\exp\gltf2_io_user_extensions.py", line 14, in export_user_extensions    hook(*args, export_settings)
TypeError: glTF2ExportUserExtension.gather_animation_channel_hook() takes 7 positional arguments but 8 were given

https://github.com/KhronosGroup/glTF-Blender-IO/blob/295bbf7eda4c3de5429a01a0d919f42d90aaf5f9/example-addons/example_gltf_exporter_extension/readme.md?plain=1#L22

https://github.com/KhronosGroup/glTF-Blender-IO/blob/295bbf7eda4c3de5429a01a0d919f42d90aaf5f9/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/channels.py#L129

https://github.com/KhronosGroup/glTF-Blender-IO/blob/295bbf7eda4c3de5429a01a0d919f42d90aaf5f9/addons/io_scene_gltf2/blender/exp/animation/sampled/object/channels.py#L88

Screenshots image

.blend file/ .gltf (mandatory)

waterbuffalo.zip

Version

julienduroure commented 2 months ago

Confirmed