From f1a83d7298a393e38fcf1ed944b276e5081d47e2 Mon Sep 17 00:00:00 2001 From: tsgcpp <19503967+tsgcpp@users.noreply.github.com> Date: Fri, 5 Jan 2024 23:03:54 +0900 Subject: [PATCH] fix: Ignore invalid mesh indices in MigrateFirstPersonMeshIndex --- .../Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs index b950f6603..4ed6aded1 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs @@ -70,6 +70,10 @@ namespace UniVRM10 if (meshAnnotationJsonNode.TryGet(key, out var meshIndexJsonNode)) { var meshIndex = meshIndexJsonNode.GetInt32(); + if (meshIndex < 0) + { + return default; + } // NOTE: VRM 1.0 では glTF の Node Index を記録するため、それに変換する. // TODO: mesh が共有されたノードの場合はどうなる? 0x の場合はどうなっていたかを調べて挙動を追従する.