diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-03-17 09:58:09 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-03-17 09:58:09 +0300 |
commit | e5bde5ec2e6880729896937b65e9097246a558b6 (patch) | |
tree | 2da11659e66cc34594f125eb5639b157c32aa0fc /io_scene_gltf2 | |
parent | b815b9d233888833aae8b252e38939ebe71fe4df (diff) |
glTF exporter: ignore solo mode in NLA, to export all tracks
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-x | io_scene_gltf2/__init__.py | 2 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index 46a8ccda..9dd4f9b8 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (1, 2, 43), + "version": (1, 2, 44), 'blender': (2, 82, 7), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', 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 05615053..118a112e 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -43,6 +43,14 @@ def gather_animations(blender_object: bpy.types.Object, current_action = None if blender_object.animation_data and blender_object.animation_data.action: current_action = blender_object.animation_data.action + # Remove any solo (starred) NLA track. Restored after export + solo_track = None + if blender_object.animation_data: + for track in blender_object.animation_data.nla_tracks: + if track.is_solo: + solo_track = track + track.is_solo = False + break # Export all collected actions. for blender_action, track_name in blender_actions: @@ -78,6 +86,7 @@ def gather_animations(blender_object: bpy.types.Object, tracks[track_name].append(offset + len(animations)-1) # Store index of animation in animations # Restore action status + # TODO: do this in a finally if blender_object.animation_data: if blender_object.animation_data.action is not None: if current_action is None: @@ -86,6 +95,8 @@ def gather_animations(blender_object: bpy.types.Object, elif blender_object.animation_data.action.name != current_action.name: # Restore action that was active at start of exporting blender_object.animation_data.action = current_action + if solo_track is not None: + solo_track.is_solo = True return animations, tracks |