diff options
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_node.py')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_node.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_node.py index df5b5a42..0792b96d 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_node.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_node.py @@ -39,9 +39,18 @@ class BlenderNode(): instance = False if gltf.data.meshes[pynode.mesh].blender_name is not None: # Mesh is already created, only create instance - instance = True - mesh = bpy.data.meshes[gltf.data.meshes[pynode.mesh].blender_name] - else: + # Except is current node is animated with path weight + # Or if previous instance is animation at node level + if pynode.weight_animation is True: + instance = False + else: + if gltf.data.meshes[pynode.mesh].is_weight_animated is True: + instance = False + else: + instance = True + mesh = bpy.data.meshes[gltf.data.meshes[pynode.mesh].blender_name] + + if instance is False: if pynode.name: gltf.log.info("Blender create Mesh node " + pynode.name) else: @@ -49,6 +58,10 @@ class BlenderNode(): mesh = BlenderMesh.create(gltf, pynode.mesh, node_idx, parent) + if pynode.weight_animation is True: + # flag this mesh instance as created only for this node, because of weight animation + gltf.data.meshes[pynode.mesh].is_weight_animated = True + if pynode.name: name = pynode.name else: |