VRM Convert Breast bones

This commit is contained in:
Yusarina
2025-08-02 15:11:34 +01:00
parent 1ddda1336a
commit c50f275b1b
2 changed files with 47 additions and 2 deletions
+35 -1
View File
@@ -255,6 +255,24 @@ bone_names = {
"right_eye": [ "right_eye": [
"eyeright", "righteye", "eyer", "reye", "右目", "ik_右目" "eyeright", "righteye", "eyer", "reye", "右目", "ik_右目"
], ],
"breast_1_l": [
"j_sec_l_bust1", "breast1_l", "leftbreast1", "lbreast1", "bust1_l"
],
"breast_2_l": [
"j_sec_l_bust2", "breast2_l", "leftbreast2", "lbreast2", "bust2_l"
],
"breast_3_l": [
"j_sec_l_bust3", "breast3_l", "leftbreast3", "lbreast3", "bust3_l"
],
"breast_1_r": [
"j_sec_r_bust1", "breast1_r", "rightbreast1", "rbreast1", "bust1_r"
],
"breast_2_r": [
"j_sec_r_bust2", "breast2_r", "rightbreast2", "rbreast2", "bust2_r"
],
"breast_3_r": [
"j_sec_r_bust3", "breast3_r", "rightbreast3", "rbreast3", "bust3_r"
]
} }
# Add VRM bone name variations # Add VRM bone name variations
@@ -295,6 +313,14 @@ bone_names.update({
# VRM jaw # VRM jaw
'jaw': ['jaw', 'mandible', 'lowerjaw', 'chin', 'あご', 'ik_あご'], 'jaw': ['jaw', 'mandible', 'lowerjaw', 'chin', 'あご', 'ik_あご'],
# Breast bones
'breast_1_l': bone_names['breast_1_l'] + ['jbipcbreast1l', 'jlbreast1'],
'breast_2_l': bone_names['breast_2_l'] + ['jbipcbreast2l', 'jlbreast2'],
'breast_3_l': bone_names['breast_3_l'] + ['jbipcbreast3l', 'jlbreast3'],
'breast_1_r': bone_names['breast_1_r'] + ['jbipcbreast1r', 'jrbreast1'],
'breast_2_r': bone_names['breast_2_r'] + ['jbipcbreast2r', 'jrbreast2'],
'breast_3_r': bone_names['breast_3_r'] + ['jbipcbreast3r', 'jrbreast3'],
# VRM fingers - Left (including Little finger variations) # VRM fingers - Left (including Little finger variations)
'thumb_0_l': bone_names['thumb_0_l'] + ['jbipllthumb0', 'jlthumb0', 'jbipllthumbmetacarpal', 'jlthumbmetacarpal', 'leftthumbmetacarpal'], 'thumb_0_l': bone_names['thumb_0_l'] + ['jbipllthumb0', 'jlthumb0', 'jbipllthumbmetacarpal', 'jlthumbmetacarpal', 'leftthumbmetacarpal'],
'thumb_1_l': bone_names['thumb_1_l'] + ['jbipllthumb1', 'jlthumb1', 'jbiplthumb1', 'leftthumbproximal'], 'thumb_1_l': bone_names['thumb_1_l'] + ['jbipllthumb1', 'jlthumb1', 'jbiplthumb1', 'leftthumbproximal'],
@@ -486,7 +512,15 @@ standard_bones = {
# Eyes # Eyes
'left_eye': 'Eye.L', 'left_eye': 'Eye.L',
'right_eye': 'Eye.R' 'right_eye': 'Eye.R',
# Breast bones
'breast_1_l': 'Breast1_L',
'breast_2_l': 'Breast2_L',
'breast_3_l': 'Breast3_L',
'breast_1_r': 'Breast1_R',
'breast_2_r': 'Breast2_R',
'breast_3_r': 'Breast3_R'
} }
bone_hierarchy = [ bone_hierarchy = [
+12 -1
View File
@@ -33,6 +33,9 @@ def detect_vrm_armature(armature: Object) -> bool:
'jbiplring1', 'jbiplring2', 'jbiplring3', 'jbiplring1', 'jbiplring2', 'jbiplring3',
# Face eye patterns # Face eye patterns
'jadjlfaceeye', 'jadjrfaceeye', 'jadjlfaceeye', 'jadjrfaceeye',
# Breast patterns
'jseclbust1', 'jseclbust2', 'jseclbust3',
'jsecrbust1', 'jsecrbust2', 'jsecrbust3',
'jbipc', 'jbipr', 'jbipl' 'jbipc', 'jbipr', 'jbipl'
] ]
@@ -158,7 +161,15 @@ def guess_unity_name_from_vrm(vrm_simplified: str) -> Optional[str]:
'jbipllittle3': 'LeftPinky3', 'jbipllittle3': 'LeftPinky3',
'jbiprlittle1': 'RightPinky1', 'jbiprlittle1': 'RightPinky1',
'jbiprlittle2': 'RightPinky2', 'jbiprlittle2': 'RightPinky2',
'jbiprlittle3': 'RightPinky3' 'jbiprlittle3': 'RightPinky3',
# Breast bones
'jseclbust1': 'Breast1_L',
'jseclbust2': 'Breast2_L',
'jseclbust3': 'Breast3_L',
'jsecrbust1': 'Breast1_R',
'jsecrbust2': 'Breast2_R',
'jsecrbust3': 'Breast3_R'
} }
return pattern_mappings.get(vrm_simplified) return pattern_mappings.get(vrm_simplified)