From 94c52191177dbfb0862f932d3243ba6deaaba1dc Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 11 Nov 2024 13:49:52 +0900 Subject: [PATCH] skip topology that is not MeshTopology.Triangles --- .../UniGLTF/IO/MeshIO/MeshExportInfo.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs index 02611a8d5..021efbe37 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs @@ -266,12 +266,6 @@ namespace UniGLTF } } - static bool TryGetMeshInfo() - { - - return true; - } - public void CalcMeshSize( GameObject root, Renderer renderer, @@ -423,10 +417,19 @@ namespace UniGLTF } var info = new MeshExportInfo(renderer, settings); - if (info.Mesh != null) + if (info.Mesh == null) { - m_list.Add(info); + continue; } + for (int i = 0; i < info.Mesh.subMeshCount; ++i) + { + if (info.Mesh.GetTopology(i) != MeshTopology.Triangles) + { + continue; + } + } + + m_list.Add(info); } } }