Skip to content
Snippets Groups Projects
Commit 4e69d972 authored by Julien Duroure's avatar Julien Duroure
Browse files

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

parent b5809424
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
bl_info = { bl_info = {
'name': 'glTF 2.0 format', 'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', '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), 'blender': (2, 81, 6),
'location': 'File > Import-Export', 'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0', 'description': 'Import-Export as glTF 2.0',
......
...@@ -79,13 +79,17 @@ def bonecache(func): ...@@ -79,13 +79,17 @@ def bonecache(func):
if not hasattr(func, "__current_action_name"): if not hasattr(func, "__current_action_name"):
func.__current_action_name = None func.__current_action_name = None
func.__current_armature_name = None
func.__bonecache = {} 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) result = func(*args)
func.__bonecache = result func.__bonecache = result
func.__current_action_name = args[6] 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] return result[args[7]][pose_bone_if_armature.name]
else: else:
print("Using cache for bone ", pose_bone_if_armature.name)
return func.__bonecache[args[7]][pose_bone_if_armature.name] return func.__bonecache[args[7]][pose_bone_if_armature.name]
return wrapper_bonecache return wrapper_bonecache
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment