From db922cd613598ed86e00d053fd4e2034319a78ee Mon Sep 17 00:00:00 2001 From: glaporteavatar <108930059+glaporteavatar@users.noreply.github.com> Date: Mon, 18 Jul 2022 10:23:13 +0200 Subject: [PATCH] GLTFSceneImporter: handles the case where the mesh has 0 vertice. (avoid load exception) --- UnityGLTF/Assets/UnityGLTF/Runtime/Scripts/GLTFSceneImporter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnityGLTF/Assets/UnityGLTF/Runtime/Scripts/GLTFSceneImporter.cs b/UnityGLTF/Assets/UnityGLTF/Runtime/Scripts/GLTFSceneImporter.cs index e9f9334d1..2606b4770 100644 --- a/UnityGLTF/Assets/UnityGLTF/Runtime/Scripts/GLTFSceneImporter.cs +++ b/UnityGLTF/Assets/UnityGLTF/Runtime/Scripts/GLTFSceneImporter.cs @@ -1398,7 +1398,7 @@ protected virtual async Task ConstructNode(Node node, int nodeIndex, Cancellatio } } - if (node.Mesh != null) + if (node.Mesh != null && node.Mesh.Value.Primitives != null) { var mesh = node.Mesh.Value; await ConstructMesh(mesh, node.Mesh.Id, cancellationToken);