[Bf-extensions-cvs] [4e69d972] master: glTF exporter: sanity check action / multiple armature with different bone names

Julien Duroure noreply at git.blender.org
Fri Sep 20 22:38:48 CEST 2019


Commit: 4e69d972bd4fea632b75ac60b302672f6b289c4e
Author: Julien Duroure
Date:   Fri Sep 20 22:38:00 2019 +0200
Branches: master
https://developer.blender.org/rBA4e69d972bd4fea632b75ac60b302672f6b289c4e

glTF exporter: sanity check action / multiple armature with different bone names

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 5114367c..28bd34f2 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
 bl_info = {
     'name': 'glTF 2.0 format',
     'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
-    "version": (0, 9, 71),
+    "version": (0, 9, 72),
     'blender': (2, 81, 6),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
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 53375779..59b30bd1 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py
@@ -79,13 +79,17 @@ def bonecache(func):
 
         if not hasattr(func, "__current_action_name"):
             func.__current_action_name = None
+            func.__current_armature_name = None
             func.__bonecache = {}
-        if args[6] != func.__current_action_name:
+        if args[6] != func.__current_action_name or args[0] != func.__current_armature_name:
             result = func(*args)
             func.__bonecache = result
             func.__current_action_name = args[6]
+            func.__current_armature_name = args[0]
+            print("Using cache (first) for bone ", pose_bone_if_armature.name)
             return result[args[7]][pose_bone_if_armature.name]
         else:
+            print("Using cache for bone ", pose_bone_if_armature.name)
             return func.__bonecache[args[7]][pose_bone_if_armature.name]
     return wrapper_bonecache



More information about the Bf-extensions-cvs mailing list