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.5k stars 319 forks source link

animation_gather_fcurve_channel_target called twice, instead of animation_gather_fcurve_channel #2351

Closed Phrogz closed 1 month ago

Phrogz commented 2 months ago

Describe the bug Writing an exporter extension, the animation_gather_fcurve_channel_target hook gets called twice per gathered action.

Based on naming conventions alone, I think this is a copy/paste error, and the second one is supposed to be animation_gather_fcurve_channel…and possibly is intended to have additional useful information passed along?

To Reproduce

  1. Write an exporter extension with:

    def animation_gather_fcurve_channel_target(self, blender_object, bone_name, export_settings):
        print(f'####### animation_gather_fcurve_channel_target {blender_object.name}/bone"{bone_name}"')
    
    def animation_gather_fcurve_channel_sampler(self, blender_object, bone_name, export_settings):
        print(f'####### animation_gather_fcurve_channel_sampler {blender_object.name}/bone"{bone_name}"')
  2. Export a glTF without sampling animations enabled.
  3. Notice debug output like:
    ####### animation_gather_fcurve_channel_target needle/bone"None"
    ####### animation_gather_fcurve_channel_sampler needle/bone"None"
    ####### animation_gather_fcurve_channel_target needle/bone"None"

Expected behavior I think a distinct callback was intended for gather_animation_fcurves_channels.

Version

julienduroure commented 2 months ago

Confirmed