Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions Editor/Scripts/Internal/AvatarUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class AvatarUtils
// In this case they match the naming from the included Mixamo model on the left
// and the Unity equivalent name on the right.
// This does not need to be hard-coded.
public static Dictionary<string, string> HumanSkeletonNames = new Dictionary<string, string>()
static Dictionary<string, string> HumanSkeletonNames = new Dictionary<string, string>()
{
{"mixamorig:spine1", "Chest"},
{"mixamorig:head", "Head" },
Expand Down Expand Up @@ -170,9 +170,43 @@ internal class AvatarUtils
{"rightlegupper_jnt", "RightUpperLeg"},
{"rightleglower_jnt", "RightLowerLeg"},
{"rightfootball_jnt", "RightFoot"},
{"rightfoottoe_jnt", "RightToes"}
{"rightfoottoe_jnt", "RightToes"},

};
// Simple bone names Unity's FBX importer can detect.
Copy link

Copilot AI Jun 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The block of hard-coded bone mappings is quite large; consider externalizing this list (for example, in a JSON config or resource file) or grouping entries to simplify maintenance and updates.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this PR is to simply add some missing bone mappings. Refactoring the entire dictionary would be the subject of another task/request.

{ "lefttoe", "LeftToes" },
{ "righttoe", "RightToes" },
{ "jaw", "Jaw" },
{"leftthumb1", "Left Thumb Proximal"},
{"leftthumb2", "Left Thumb Intermediate"},
{"leftthumb3", "Left Thumb Distal"},
{"leftindex1", "Left Index Proximal" },
{"leftindex2", "Left Index Intermediate"},
{"leftindex3", "Left Index Distal"},
{"leftmiddle1", "Left Middle Proximal"},
{"leftmiddle2", "Left Middle Intermediate"},
{"leftmiddle3", "Left Middle Distal"},
{"leftring1", "Left Ring Proximal"},
{"leftring2", "Left Ring Intermediate"},
{"leftring3", "Left Ring Distal"},
{"leftpinky1", "Left Little Proximal"},
{"leftpinky2", "Left Little Intermediate"},
{"leftpinky3", "Left Little Distal"},
{"rightthumb1", "Right Thumb Proximal"},
{"rightthumb2", "Right Thumb Intermediate"},
{"rightthumb3", "Right Thumb Distal"},
{"rightindex1", "Right Index Proximal"},
{"rightindex2", "Right Index Intermediate"},
{"rightindex3", "Right Index Distal"},
{"rightmiddle1", "Right Middle Proximal"},
{"rightmiddle2", "Right Middle Intermediate"},
{"rightmiddle3", "Right Middle Distal"},
{"rightring1", "Right Ring Proximal"},
{"rightring2", "Right Ring Intermediate"},
{"rightring3", "Right Ring Distal"},
{"rightpinky1", "Right Little Proximal"},
{"rightpinky2", "Right Little Intermediate"},
{"rightpinky3", "Right Little Distal"}
};

/// <summary>
/// Create a HumanDescription out of an avatar GameObject.
Expand Down