diff options
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_node.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_node.py index 041bf1eb..8e0d7cbb 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_node.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_node.py @@ -184,6 +184,10 @@ class BlenderNode(): @staticmethod def create_mesh_object(gltf, vnode): pynode = gltf.data.nodes[vnode.mesh_node_idx] + if not (0 <= pynode.mesh < len(gltf.data.meshes)): + # Avoid traceback for invalid gltf file: invalid reference to meshes array + # So return an empty blender object) + return bpy.data.objects.new(vnode.name or mesh.name, None) pymesh = gltf.data.meshes[pynode.mesh] # Key to cache the Blender mesh by. |