From 0a639597dc0cfa523fda93ef402198d2e38377e8 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 25 Jun 2025 13:45:25 +0900 Subject: [PATCH 1/2] BoneLimit.boneName is null --- Assets/UniGLTF/Runtime/UniHumanoid/AvatarDescription.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/AvatarDescription.cs b/Assets/UniGLTF/Runtime/UniHumanoid/AvatarDescription.cs index 05dd9bdf0..496db8baf 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/AvatarDescription.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/AvatarDescription.cs @@ -98,7 +98,9 @@ namespace UniHumanoid { map[t.name] = t; } - return human.Select(x => (map[x.boneName], x.humanBone)); + return human + .Where(x => !string.IsNullOrEmpty(x.boneName) && map.ContainsKey(x.boneName)) + .Select(x => (map[x.boneName], x.humanBone)); } public Avatar CreateAvatarAndSetup(Transform root) From 53fd683580def26c9a2a21922ea1015f18371525 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 25 Jun 2025 13:48:22 +0900 Subject: [PATCH 2/2] add index range check --- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index 3c28d48e2..af6bdc9c1 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -590,7 +590,10 @@ namespace UniVRM10 if (gltfSpring.ColliderGroups != null) { - spring.ColliderGroups = gltfSpring.ColliderGroups.Select(x => controller.SpringBone.ColliderGroups[x]).ToList(); + spring.ColliderGroups = gltfSpring.ColliderGroups + // VRM1_Constraint_Twist_Sample_Plane.vrm + .Where(x => x >= 0 && x < controller.SpringBone.ColliderGroups.Count) + .Select(x => controller.SpringBone.ColliderGroups[x]).ToList(); } // joint foreach (var gltfJoint in gltfSpring.Joints)