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-03-29 18:49:53 +0300
committerJulien Duroure <julien.duroure@gmail.com>2022-03-29 18:49:53 +0300
commit64f462358522f914cad4828b3a2e7a4aba900676 (patch)
treea30c937ed9c71692123231b9dbc8e3f80e5369b0
parent374c730236d226e016e1928608f80e4a719cc7e9 (diff)
glTF exporter performance. Better cache management
Better management of case of multiple object with each multiple actions
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py10
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py2
3 files changed, 10 insertions, 4 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 9d8ccca2..d08c39dd 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (3, 2, 19),
+ "version": (3, 2, 20),
'blender': (3, 1, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
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 :
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
index 4f95431c..3539b968 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
@@ -93,7 +93,7 @@ def objectcache(func):
# object is in cache, but not this action
# We need to keep other actions
elif cache_key_args[1] not in func.__objectcache[cache_key_args[0]].keys():
- result = func(*args)
+ result = func(*args, only_gather_provided=True)
func.__objectcache[cache_key_args[0]][cache_key_args[1]] = result[cache_key_args[0]][cache_key_args[1]]
return result[cache_key_args[0]][cache_key_args[1]][cache_key_args[4]]
# all is already cached