From 3f13fdde052de9337df7ff425afa8a4df89ef852 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Tue, 18 May 2021 21:01:19 +0900 Subject: [PATCH] ignore freeze while exportings vrm10 --- Assets/VRM10/Runtime/IO/Model/MeshWriter.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Assets/VRM10/Runtime/IO/Model/MeshWriter.cs b/Assets/VRM10/Runtime/IO/Model/MeshWriter.cs index 452486a6f..7baaaa8f1 100644 --- a/Assets/VRM10/Runtime/IO/Model/MeshWriter.cs +++ b/Assets/VRM10/Runtime/IO/Model/MeshWriter.cs @@ -56,7 +56,7 @@ namespace UniVRM10 /// /// https://github.com/vrm-c/UniVRM/issues/800 - /// + /// /// SubMesh 単位に分割する。 /// SubMesh を Gltf の Primitive に対応させる。 /// @@ -88,14 +88,15 @@ namespace UniVRM10 foreach (var submesh in mesh.Submeshes) { var indices = meshIndices.Slice(submesh.Offset, submesh.DrawCount).ToArray(); + var hash = new HashSet(indices); // mesh - // index の順に attributes を蓄える + // index の順に attributes を蓄える var buffer = new MeshExportUtil.VertexBuffer(indices.Length, getJointIndex); usedIndices.Clear(); for (int k = 0; k < positions.Length; ++k) { - if (indices.Contains(k)) + if (hash.Contains(k)) { // indices から参照される頂点だけを蓄える usedIndices.Add(k); @@ -127,7 +128,7 @@ namespace UniVRM10 { var blendShape = new MeshExportUtil.BlendShapeBuffer(indices.Length); - // index の順に attributes を蓄える + // index の順に attributes を蓄える var morph = mesh.MorphTargets[j]; var blendShapePositions = morph.VertexBuffer.Positions.GetSpan(); SpanLike? blendShapeNormals = default;