diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2022-02-16 14:04:11 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2022-02-16 14:04:11 +0300 |
commit | f66ad054cff00053dea113698a376acc32ae971f (patch) | |
tree | f81c0149d6f945ec096423c8e87fb6858de28a2e | |
parent | fbfa11df47d570c293e309759d3423e4079422d7 (diff) | |
parent | bfcf35f7464b9445322b2ba3bc8214339bd91317 (diff) |
Merge branch 'blender-v3.1-release'
-rwxr-xr-x | io_scene_gltf2/__init__.py | 2 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_export.py | 4 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index 636d83e2..1c717016 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -4,7 +4,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (3, 2, 5), + "version": (3, 2, 6), 'blender': (3, 1, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_export.py b/io_scene_gltf2/blender/exp/gltf2_blender_export.py index e1c85402..ddcad91d 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_export.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_export.py @@ -53,7 +53,7 @@ def __export(export_settings): buffer = __create_buffer(exporter, export_settings) exporter.finalize_images() - export_user_extensions('gather_gltf_hook', export_settings, exporter.glTF) + export_user_extensions('gather_gltf_extensions_hook', export_settings, exporter.glTF) exporter.traverse_extensions() # now that addons possibly add some fields in json, we can fix in needed @@ -69,6 +69,8 @@ def __gather_gltf(exporter, export_settings): gltf2_io_draco_compression_extension.encode_scene_primitives(scenes, export_settings) exporter.add_draco_extension() + export_user_extensions('gather_gltf_hook', export_settings, active_scene_idx, scenes, animations) + for idx, scene in enumerate(scenes): exporter.add_scene(scene, idx==active_scene_idx) for animation in animations: 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 57374a2a..39f09d52 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -111,6 +111,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 @@ -205,6 +207,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: @@ -247,6 +251,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 |