Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DenisMedeirosSDK/24685c25317c67f118ab5cb89e8f8fc2 to your computer and use it in GitHub Desktop.
Save DenisMedeirosSDK/24685c25317c67f118ab5cb89e8f8fc2 to your computer and use it in GitHub Desktop.
Auto Rename Shape Keys Fortnite (Characters) to ARKit in Blender
import bpy
# Mapeamento de nomes dos Shape Keys do padrão Default para o padrão ARKit
name_mapping = {
"Default": "base_pose.001",
"Hair_Hat": "Hair_Hat",
"C_glabella_down_pose": "browInnerDown",
"tongue_up_pose": "tongueOut",
"phoneme_mbp_pose": "mouthPressRight",
"L_upper_lip_lower_pose": "mouthFrownLeft.001",
"R_blink_pose": "eyeBlinkRight",
"R_wide_pose": "eyeWideRight",
"look_right_pose": "eyeLookOutRight",
"jaw_up_pose": "jawOpen.002",
"L_squeeze_pose": "cheekPuff",
"R_brow_up_pose": "browOuterUpRight",
"look_left_pose": "eyeLookInLeft",
"tongue_back_pose": "tongueOut.001",
"R_squint_inner_pose": "cheekSquintRight",
"look_up_pose": "eyeLookUpLeft",
"phoneme_fv_pose": "mouthRollLower",
"jaw_back_pose": "jawBack",
"R_smile_pose": "mouthSmileRight",
"R_lip_corner_narrow_pose": "mouthPucker.003",
"eye_convergence_pose": "eyeConvergence",
"R_brow_down_pose": "browDownRight",
"R_frown_pose": "mouthFrownRight",
"L_lower_lip_down_pose": "mouthLowerDownLeft",
"L_blink_pose": "eyeBlinkLeft",
"L_lip_corner_narrow_pose": "mouthPucker.001",
"look_down_pose": "eyeLookDownLeft",
"R_upper_lip_raiser_pose": "mouthUpperUpRight",
"phoneme_oo_pose": "mouthFunnel",
"R_brow_squeeze_in_pose": "browDownRight.001",
"jaw_left_pose": "jawLeft",
"L_lip_corner_wide_pose": "mouthDimpleLeft",
"C_nose_wrinkler_pose": "noseSneerRight",
"R_lower_lip_up_pose": "mouthUpperUpRight.001",
"jaw_open_pose": "jawOpen",
"L_brow_up_pose": "browOuterUpLeft",
"R_lip_corner_wide_pose": "mouthDimpleRight",
"L_lower_lip_up_pose": "mouthUpperUpLeft.001",
"R_lower_lip_down_pose": "mouthLowerDownRight",
"L_upper_lip_raiser_pose": "mouthUpperUpLeft",
"R_cheek_up_pose": "cheekSquintRight",
"L_brow_down_pose": "browDownLeft",
"jaw_forward_pose": "jawForward",
"L_squint_inner_pose": "eyeSquintLeft",
"tongue_down_pose": "tongueOut.002",
"R_upper_lip_lower_pose": "mouthLowerDownRight.001",
"L_brow_squeeze_in_pose": "browDownLeft.001",
"jaw_right_pose": "jawRight",
"mouth_down_pose": "mouthLowerDown.002",
"C_glabella_up_pose": "browInnerUp",
"phoneme_ch_pose": "mouthPucker",
"L_frown_pose": "mouthFrownLeft",
"R_squeeze_pose": "cheekPuff.001",
"tongue_forward_pose": "tongueOut.003",
"L_upperLidDown_pose": "eyeBlinkLeft.001",
"R_upperLidDown_pose": "eyeBlinkRight.001",
"L_wide_pose": "eyeWideLeft",
"L_smile_pose": "mouthSmileLeft",
"mouth_up_pose": "mouthUpperUp",
"L_cheek_up_pose": "cheekSquintLeft.001",
"base_pose": "base_pose"
}
# Verifica se algum objeto está selecionado
if bpy.context.object:
selected_object = bpy.context.object
# Verifica se o objeto tem Shape Keys
if selected_object.data.shape_keys:
shape_keys = selected_object.data.shape_keys.key_blocks
# Itera sobre os Shape Keys e renomeia conforme o mapeamento
for key in shape_keys:
if key.name in name_mapping:
key.name = name_mapping[key.name]
else:
print(f"Atenção: Shape Key '{key.name}' não mapeado.")
print("Os Shape Keys foram renomeados para o padrão ARKit.")
else:
print("O objeto selecionado não possui Shape Keys.")
else:
print("Nenhum objeto está selecionado.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment