Skip to content

Instantly share code, notes, and snippets.

@nemurigi
Last active August 27, 2023 12:30
Show Gist options
  • Select an option

  • Save nemurigi/9fe6e40b29fea0413aa922467e9de3d9 to your computer and use it in GitHub Desktop.

Select an option

Save nemurigi/9fe6e40b29fea0413aa922467e9de3d9 to your computer and use it in GitHub Desktop.
//https://github.com/bdunderscore/modular-avatar/blob/main/Packages/nadena.dev.modular-avatar/Editor/HeuristicBoneMapper.cs
dict get_bone_mapper(){
dict bone_mapper;
bone_mapper["Hips"] = {"Hips", "Hip"};
bone_mapper["LeftUpperLeg"] = {
"LeftUpperLeg", "UpperLeg_Left", "UpperLeg_L", "Leg_Left", "Leg_L", "ULeg_L", "Left leg", "LeftUpLeg",
"UpLeg.L"
};
bone_mapper["RightUpperLeg"] = {
"RightUpperLeg", "UpperLeg_Right", "UpperLeg_R", "Leg_Right", "Leg_R", "ULeg_R", "Right leg",
"RightUpLeg", "UpLeg.R"
};
bone_mapper["LeftLowerLeg"] = {
"LeftLowerLeg", "LowerLeg_Left", "LowerLeg_L", "Knee_Left", "Knee_L", "LLeg_L", "Left knee", "LeftLeg"
};
bone_mapper["RightLowerLeg"] = {
"RightLowerLeg", "LowerLeg_Right", "LowerLeg_R", "Knee_Right", "Knee_R", "LLeg_R", "Right knee",
"RightLeg"
};
bone_mapper["LeftFoot"] = {"LeftFoot", "Foot_Left", "Foot_L", "Ankle_L", "Foot.L.001", "Left ankle", "heel.L", "heel"};
bone_mapper["RightFoot"] = {"RightFoot", "Foot_Right", "Foot_R", "Ankle_R", "Foot.R.001", "Right ankle", "heel.R", "heel"};
bone_mapper["Spine"] = {"Spine"};
bone_mapper["Chest"] = {"Chest", "Bust"};
bone_mapper["Neck"] = {"Neck"};
bone_mapper["Head"] = {"Head"};
bone_mapper["LeftShoulder"] = {"LeftShoulder", "Shoulder_Left", "Shoulder_L"};
bone_mapper["RightShoulder"] = {"RightShoulder", "Shoulder_Right", "Shoulder_R"};
bone_mapper["LeftUpperArm"] = {
"LeftUpperArm", "UpperArm_Left", "UpperArm_L", "Arm_Left", "Arm_L", "UArm_L", "Left arm", "UpperLeftArm"
};
bone_mapper["RightUpperArm"] = {
"RightUpperArm", "UpperArm_Right", "UpperArm_R", "Arm_Right", "Arm_R", "UArm_R", "Right arm",
"UpperRightArm"
};
bone_mapper["LeftLowerArm"] = {"LeftLowerArm", "LowerArm_Left", "LowerArm_L", "LArm_L", "Left elbow", "LeftForeArm", "Elbow_L"};
bone_mapper["RightLowerArm"] = {"RightLowerArm", "LowerArm_Right", "LowerArm_R", "LArm_R", "Right elbow", "RightForeArm", "Elbow_R"};
bone_mapper["LeftHand"] = {"LeftHand", "Hand_Left", "Hand_L", "Left wrist", "Wrist_L"};
bone_mapper["RightHand"] = {"RightHand", "Hand_Right", "Hand_R", "Right wrist", "Wrist_R"};
bone_mapper["LeftToes"] = {
"LeftToes", "Toes_Left", "Toe_Left", "ToeIK_L", "Toes_L", "Toe_L", "Foot.L.002", "Left Toe",
"LeftToeBase"
};
bone_mapper["RightToes"] = {
"RightToes", "Toes_Right", "Toe_Right", "ToeIK_R", "Toes_R", "Toe_R", "Foot.R.002", "Right Toe",
"RightToeBase"
};
bone_mapper["LeftEye"] = {"LeftEye", "Eye_Left", "Eye_L"};
bone_mapper["RightEye"] = {"RightEye", "Eye_Right", "Eye_R"};
bone_mapper["Jaw"] = {"Jaw"};
bone_mapper["LeftThumbProximal"] = {
"LeftThumbProximal", "ProximalThumb_Left", "ProximalThumb_L", "Thumb1_L", "ThumbFinger1_L",
"LeftHandThumb1", "Thumb Proximal.L", "Thunb1_L"
};
bone_mapper["LeftThumbIntermediate"] = {
"LeftThumbIntermediate", "IntermediateThumb_Left", "IntermediateThumb_L", "Thumb2_L", "ThumbFinger2_L",
"LeftHandThumb2", "Thumb Intermediate.L", "Thunb2_L"
};
bone_mapper["LeftThumbDistal"] = {
"LeftThumbDistal", "DistalThumb_Left", "DistalThumb_L", "Thumb3_L", "ThumbFinger3_L", "LeftHandThumb3",
"Thumb Distal.L", "Thunb3_L"
};
bone_mapper["LeftIndexProximal"] = {
"LeftIndexProximal", "ProximalIndex_Left", "ProximalIndex_L", "Index1_L", "IndexFinger1_L",
"LeftHandIndex1", "Index Proximal.L"
};
bone_mapper["LeftIndexIntermediate"] = {
"LeftIndexIntermediate", "IntermediateIndex_Left", "IntermediateIndex_L", "Index2_L", "IndexFinger2_L",
"LeftHandIndex2", "Index Intermediate.L"
};
bone_mapper["LeftIndexDistal"] = {
"LeftIndexDistal", "DistalIndex_Left", "DistalIndex_L", "Index3_L", "IndexFinger3_L", "LeftHandIndex3",
"Index Distal.L"
};
bone_mapper["LeftMiddleProximal"] = {
"LeftMiddleProximal", "ProximalMiddle_Left", "ProximalMiddle_L", "Middle1_L", "MiddleFinger1_L",
"LeftHandMiddle1", "Middle Proximal.L"
};
bone_mapper["LeftMiddleIntermediate"] = {
"LeftMiddleIntermediate", "IntermediateMiddle_Left", "IntermediateMiddle_L", "Middle2_L",
"MiddleFinger2_L", "LeftHandMiddle2", "Middle Intermediate.L"
};
bone_mapper["LeftMiddleDistal"] = {
"LeftMiddleDistal", "DistalMiddle_Left", "DistalMiddle_L", "Middle3_L", "MiddleFinger3_L",
"LeftHandMiddle3", "Middle Distal.L"
};
bone_mapper["LeftRingProximal"] = {
"LeftRingProximal", "ProximalRing_Left", "ProximalRing_L", "Ring1_L", "RingFinger1_L", "LeftHandRing1",
"Ring Proximal.L"
};
bone_mapper["LeftRingIntermediate"] = {
"LeftRingIntermediate", "IntermediateRing_Left", "IntermediateRing_L", "Ring2_L", "RingFinger2_L",
"LeftHandRing2", "Ring Intermediate.L"
};
bone_mapper["LeftRingDistal"] = {
"LeftRingDistal", "DistalRing_Left", "DistalRing_L", "Ring3_L", "RingFinger3_L", "LeftHandRing3",
"Ring Distal.L"
};
bone_mapper["LeftLittleProximal"] = {
"LeftLittleProximal", "ProximalLittle_Left", "ProximalLittle_L", "Little1_L", "LittleFinger1_L",
"LeftHandPinky1", "Little Proximal.L"
};
bone_mapper["LeftLittleIntermediate"] = {
"LeftLittleIntermediate", "IntermediateLittle_Left", "IntermediateLittle_L", "Little2_L",
"LittleFinger2_L", "LeftHandPinky2", "Little Intermediate.L"
};
bone_mapper["LeftLittleDistal"] = {
"LeftLittleDistal", "DistalLittle_Left", "DistalLittle_L", "Little3_L", "LittleFinger3_L",
"LeftHandPinky3", "Little Distal.L"
};
bone_mapper["RightThumbProximal"] = {
"RightThumbProximal", "ProximalThumb_Right", "ProximalThumb_R", "Thumb1_R", "ThumbFinger1_R",
"RightHandThumb1", "Thumb Proximal.R", "Thunb1_R"
};
bone_mapper["RightThumbIntermediate"] = {
"RightThumbIntermediate", "IntermediateThumb_Right", "IntermediateThumb_R", "Thumb2_R",
"ThumbFinger2_R", "RightHandThumb2", "Thumb Intermediate.R", "Thunb2_R"
};
bone_mapper["RightThumbDistal"] = {
"RightThumbDistal", "DistalThumb_Right", "DistalThumb_R", "Thumb3_R", "ThumbFinger3_R",
"RightHandThumb3", "Thumb Distal.R", "Thunb3_R"
};
bone_mapper["RightIndexProximal"] = {
"RightIndexProximal", "ProximalIndex_Right", "ProximalIndex_R", "Index1_R", "IndexFinger1_R",
"RightHandIndex1", "Index Proximal.R"
};
bone_mapper["RightIndexIntermediate"] = {
"RightIndexIntermediate", "IntermediateIndex_Right", "IntermediateIndex_R", "Index2_R",
"IndexFinger2_R", "RightHandIndex2", "Index Intermediate.R"
};
bone_mapper["RightIndexDistal"] = {
"RightIndexDistal", "DistalIndex_Right", "DistalIndex_R", "Index3_R", "IndexFinger3_R",
"RightHandIndex3", "Index Distal.R"
};
bone_mapper["RightMiddleProximal"] = {
"RightMiddleProximal", "ProximalMiddle_Right", "ProximalMiddle_R", "Middle1_R", "MiddleFinger1_R",
"RightHandMiddle1", "Middle Proximal.R"
};
bone_mapper["RightMiddleIntermediate"] = {
"RightMiddleIntermediate", "IntermediateMiddle_Right", "IntermediateMiddle_R", "Middle2_R",
"MiddleFinger2_R", "RightHandMiddle2", "Middle Intermediate.R"
};
bone_mapper["RightMiddleDistal"] = {
"RightMiddleDistal", "DistalMiddle_Right", "DistalMiddle_R", "Middle3_R", "MiddleFinger3_R",
"RightHandMiddle3", "Middle Distal.R"
};
bone_mapper["RightRingProximal"] = {
"RightRingProximal", "ProximalRing_Right", "ProximalRing_R", "Ring1_R", "RingFinger1_R",
"RightHandRing1", "Ring Proximal.R"
};
bone_mapper["RightRingIntermediate"] = {
"RightRingIntermediate", "IntermediateRing_Right", "IntermediateRing_R", "Ring2_R", "RingFinger2_R",
"RightHandRing2", "Ring Intermediate.R"
};
bone_mapper["RightRingDistal"] = {
"RightRingDistal", "DistalRing_Right", "DistalRing_R", "Ring3_R", "RingFinger3_R", "RightHandRing3",
"Ring Distal.R"
};
bone_mapper["RightLittleProximal"] = {
"RightLittleProximal", "ProximalLittle_Right", "ProximalLittle_R", "Little1_R", "LittleFinger1_R",
"RightHandPinky1", "Little Proximal.R"
};
bone_mapper["RightLittleIntermediate"] = {
"RightLittleIntermediate", "IntermediateLittle_Right", "IntermediateLittle_R", "Little2_R",
"LittleFinger2_R", "RightHandPinky2", "Little Intermediate.R"
};
bone_mapper["RightLittleDistal"] = {
"RightLittleDistal", "DistalLittle_Right", "DistalLittle_R", "Little3_R", "LittleFinger3_R",
"RightHandPinky3", "Little Distal.R"
};
bone_mapper["UpperChest"] = {"UpperChest", "UChest"};
return bone_mapper;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment