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>2019-06-14 00:48:57 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-06-14 00:48:57 +0300
commita30fce5376c5a70cb64cff58298b8a392512ef2d (patch)
tree19e896b7e8d4395e334855b267af463a1d2c3980 /io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
parent4579db103294ac8b6b81549c6b9cfc91b37e5847 (diff)
glTF exporter: fix regression about exporting with applied modifiers, cache enhancement
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py16
1 files changed, 14 insertions, 2 deletions
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 5b00a98b..99286aea 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
@@ -13,7 +13,7 @@
# limitations under the License.
import functools
-
+import bpy
def cached(func):
"""
@@ -37,8 +37,20 @@ def cached(func):
export_settings = args[-1]
cache_key_args = args[:-1]
+ __by_name = [bpy.types.Object, bpy.types.Scene, bpy.types.Material, bpy.types.Action, bpy.types.Mesh]
+
# we make a tuple from the function arguments so that they can be used as a key to the cache
- cache_key = tuple(cache_key_args + tuple(cache_key_kwargs.values()))
+ cache_key = ()
+ for i in cache_key_args:
+ if type(i) in __by_name:
+ cache_key += (i.name,)
+ else:
+ cache_key += (i,)
+ for i in cache_key_kwargs.values():
+ if type(i) in __by_name:
+ cache_key += (i.name,)
+ else:
+ cache_key += (i,)
# invalidate cache if export settings have changed
if not hasattr(func, "__export_settings") or export_settings != func.__export_settings: