avoid null glTF_VRM_HumanoidBone.node

This commit is contained in:
ousttrue 2024-07-03 21:14:00 +09:00
parent 54e2629ce6
commit 768b77b49f

View File

@ -59,6 +59,11 @@ namespace VRM
foreach (var x in desc.human)
{
var nodeIndex = nodes.FindIndex(y => y.name == x.boneName);
if (nodeIndex < 0)
{
continue;
}
var key = x.humanBone.FromHumanBodyBone();
var found = self.humanBones.FirstOrDefault(y => y.vrmBone == key);
if (found == null)
@ -70,8 +75,7 @@ namespace VRM
self.humanBones.Add(found);
}
found.node = nodes.FindIndex(y => y.name == x.boneName);
found.node = nodeIndex;
found.useDefaultValues = x.useDefaultValues;
found.axisLength = x.axisLength;
found.center = x.center;