Skip to content

Commit

Permalink
Merge remote-tracking branch 'khronos/fix/avatar-bone-mapping-with-al…
Browse files Browse the repository at this point in the history
…ready-correct-names' into dev
  • Loading branch information
hybridherbst committed Jul 23, 2024
2 parents 0b9d9b5 + ebc6ea4 commit af78321
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions Editor/Scripts/Internal/AvatarUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,23 @@ private static HumanBone[] CreateHuman(GameObject avatarRoot)
Transform[] avatarTransforms = avatarRoot.GetComponentsInChildren<Transform>();
foreach (Transform avatarTransform in avatarTransforms)
{
if (HumanSkeletonNames.TryGetValue(avatarTransform.name, out string humanName))
string humanName = avatarTransform.name;
if (HumanSkeletonNames.TryGetValue(humanName, out string newHumanName))
humanName = newHumanName;
else
if (!HumanSkeletonNames.ContainsValue(humanName))
continue;

HumanBone bone = new HumanBone
{
HumanBone bone = new HumanBone
{
boneName = avatarTransform.name,
humanName = humanName,
limit = new HumanLimit()
};
bone.limit.useDefaultValues = true;
boneName = avatarTransform.name,
humanName = humanName,
limit = new HumanLimit()
};
bone.limit.useDefaultValues = true;

human.Add(bone);
}
}
human.Add(bone);
}
return human.ToArray();
}
}
Expand Down

0 comments on commit af78321

Please sign in to comment.