From cd6db6d1277d394571e4aa754506aa4d03df7db1 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 5 Jun 2023 17:01:32 +0900 Subject: [PATCH] =?UTF-8?q?human=20bone=20=E3=81=AE=20index=20=E3=81=8C=20?= =?UTF-8?q?-1=20=E3=81=AB=E3=81=AA=E3=82=8A=E3=81=86=E3=82=8B=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM/Runtime/IO/VRMExporter.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/VRM/Runtime/IO/VRMExporter.cs b/Assets/VRM/Runtime/IO/VRMExporter.cs index 1aeaa7f1c..1cb958b68 100644 --- a/Assets/VRM/Runtime/IO/VRMExporter.cs +++ b/Assets/VRM/Runtime/IO/VRMExporter.cs @@ -87,7 +87,15 @@ namespace VRM var transform = animator.GetBoneTransform(key); if (transform != null) { - VRM.humanoid.SetNodeIndex(key, nodes.IndexOf(transform)); + var nodeIndex = nodes.IndexOf(transform); + if (nodeIndex < 0) + { + Debug.LogError($"ヒューマンボーンが export 対象に含まれていない?", transform); + } + else + { + VRM.humanoid.SetNodeIndex(key, nodeIndex); + } } } }