diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2022-02-10 00:08:47 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2022-02-10 00:08:47 +0300 |
commit | d015eee1f40752baac62e9771498a6b2e878d2e9 (patch) | |
tree | 442e51343cfc5e63681bdf434727ad03984d8e04 | |
parent | d3043e6b429d70c01dd73767465cfb301d8d8671 (diff) |
glTF exporter: fix bug when no animation at all on file, and export only selection
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py | 4 |
1 files changed, 4 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 a4088b87..f4a6843b 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -25,6 +25,10 @@ from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extension def __gather_channels_baked(obj_uuid, export_settings): channels = [] + # If no animation in file, no need to bake + if len(bpy.data.actions) == 0: + return None + start_frame = min([v[0] for v in [a.frame_range for a in bpy.data.actions]]) end_frame = max([v[1] for v in [a.frame_range for a in bpy.data.actions]]) |