Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2020-03-17 09:58:09 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-03-17 09:58:09 +0300
commite5bde5ec2e6880729896937b65e9097246a558b6 (patch)
tree2da11659e66cc34594f125eb5639b157c32aa0fc /io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py
parentb815b9d233888833aae8b252e38939ebe71fe4df (diff)
glTF exporter: ignore solo mode in NLA, to export all tracks
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py11
1 files changed, 11 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 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