diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2022-02-16 14:03:19 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2022-02-16 14:03:19 +0300 |
commit | bfcf35f7464b9445322b2ba3bc8214339bd91317 (patch) | |
tree | 41c88facb6e57e6ab5e3cc9c6bc3048a5eb1080c /io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | |
parent | 3270966bbadee5cc6dd088dd775c0fafea56b77f (diff) |
glTF exporter: add new animation hooks
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py index abd498df..978346f4 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -122,6 +122,8 @@ def __gather_animation(blender_action: bpy.types.Action, print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(name, error)) return None + export_user_extensions('pre_gather_animation_hook', export_settings, animation, blender_action, blender_object) + if not animation.channels: return None @@ -216,6 +218,8 @@ def __get_blender_actions(blender_object: bpy.types.Object, blender_tracks = {} action_on_type = {} + export_user_extensions('pre_gather_actions_hook', export_settings, blender_object) + if blender_object.animation_data is not None: # Collect active action. if blender_object.animation_data.action is not None: @@ -258,6 +262,8 @@ def __get_blender_actions(blender_object: bpy.types.Object, blender_tracks[strip.action.name] = track.name # Always set after possible active action -> None will be overwrite action_on_type[strip.action.name] = "SHAPEKEY" + export_user_extensions('gather_actions_hook', export_settings, blender_object, blender_actions, blender_tracks, action_on_type) + # Remove duplicate actions. blender_actions = list(set(blender_actions)) # sort animations alphabetically (case insensitive) so they have a defined order and match Blender's Action list |