diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2022-03-29 18:49:53 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2022-03-29 18:49:53 +0300 |
commit | 64f462358522f914cad4828b3a2e7a4aba900676 (patch) | |
tree | a30c937ed9c71692123231b9dbc8e3f80e5369b0 /io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py | |
parent | 374c730236d226e016e1928608f80e4a719cc7e9 (diff) |
glTF exporter performance. Better cache management
Better management of case of multiple object with each multiple actions
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py index 66ce11c7..e1ed19ea 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py @@ -132,7 +132,8 @@ def get_object_matrix(blender_obj_uuid: str, bake_range_end: int, current_frame: int, step: int, - export_settings + export_settings, + only_gather_provided=False ): data = {} @@ -144,11 +145,16 @@ def get_object_matrix(blender_obj_uuid: str, 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]]) + if only_gather_provided: + obj_uuids = [blender_obj_uuid] + else: + obj_uuids = [uid for (uid, n) in export_settings['vtree'].nodes.items() if n.blender_type not in [VExportNode.BONE]] + frame = start_frame while frame <= end_frame: bpy.context.scene.frame_set(int(frame)) - for obj_uuid in [uid for (uid, n) in export_settings['vtree'].nodes.items() if n.blender_type not in [VExportNode.BONE]]: + for obj_uuid in obj_uuids: blender_obj = export_settings['vtree'].nodes[obj_uuid].blender_object # if this object is not animated, do not skip : |