diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-08-05 20:16:16 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-08-05 20:16:51 +0300 |
commit | 7f732e373a236a12f3c6c694abf44006a4efa4f1 (patch) | |
tree | b66a0ab95d144058bf4a5b505e72c8c11df40763 /io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | |
parent | 19166e3172c39a7231bdb885543c9665bbf254cc (diff) |
glTF exporter: take into account NLA tracks for shapekeys animation
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 | 15 |
1 files changed, 12 insertions, 3 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 7a4f1213..4a65bcd9 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -193,9 +193,18 @@ def __get_blender_actions(blender_object: bpy.types.Object if blender_object.type == "MESH" \ and blender_object.data is not None \ and blender_object.data.shape_keys is not None \ - and blender_object.data.shape_keys.animation_data is not None \ - and blender_object.data.shape_keys.animation_data.action is not None: - blender_actions.append(blender_object.data.shape_keys.animation_data.action) + and blender_object.data.shape_keys.animation_data is not None: + + if blender_object.data.shape_keys.animation_data.action is not None: + blender_actions.append(blender_object.data.shape_keys.animation_data.action) + + for track in blender_object.data.shape_keys.animation_data.nla_tracks: + # Multi-strip tracks do not export correctly yet (they need to be baked), + # so skip them for now and only write single-strip tracks. + if track.strips is None or len(track.strips) != 1: + continue + for strip in track.strips: + blender_actions.append(strip.action) # Remove duplicate actions. blender_actions = list(set(blender_actions)) |