glTF importer: Fix bug adding armature when there is already an armature in anthoer scene

This commit is contained in:
Julien Duroure 2019-03-01 06:53:14 +01:00
parent 9999dada60
commit 044a574f37
1 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,9 @@ class BlenderGlTF():
threshold = 0.001
for armobj in [obj for obj in bpy.data.objects if obj.type == "ARMATURE"]:
# Take into account only armature from this scene
if armobj.name not in bpy.context.view_layer.objects:
continue
bpy.context.view_layer.objects.active = armobj
armature = armobj.data
bpy.ops.object.mode_set(mode="EDIT")