🔧 Skip joints with the same name

This commit is contained in:
Edgar 2023-08-24 12:58:16 +02:00
parent b537ae779d
commit 13f1cfb4e2
No known key found for this signature in database
GPG key ID: 9AA5DDFFCBDCE46A

View file

@ -608,11 +608,15 @@ class AvatarExporter : MonoBehaviour
{
if (userBoneInfo.Value.HasHumanMapping())
{
string jointName = HUMANOID_TO_OVERTE_JOINT_NAME[userBoneInfo.Value.humanName];
var jointName = HUMANOID_TO_OVERTE_JOINT_NAME[userBoneInfo.Value.humanName];
var userJointName = removeTypeFromJointname(userBoneInfo.Key);
// Skip joints with the same name
if(jointName == userJointName)
continue;
if (!currentFst.jointMapList.Exists(x => x.From == jointName))
currentFst.jointMapList.Add(new JointMap(jointName, removeTypeFromJointname(userBoneInfo.Key)));
currentFst.jointMapList.Add(new JointMap(jointName, userJointName));
else
currentFst.jointMapList.Find(x => x.From == jointName).To = removeTypeFromJointname(userBoneInfo.Key);
currentFst.jointMapList.Find(x => x.From == jointName).To = userJointName;
}
}