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>2022-02-10 00:08:47 +0300
committerJulien Duroure <julien.duroure@gmail.com>2022-02-10 00:08:47 +0300
commitd015eee1f40752baac62e9771498a6b2e878d2e9 (patch)
tree442e51343cfc5e63681bdf434727ad03984d8e04
parentd3043e6b429d70c01dd73767465cfb301d8d8671 (diff)
glTF exporter: fix bug when no animation at all on file, and export only selection
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py4
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]])