Translations update

This commit is contained in:
Yusarina
2025-08-03 20:19:14 +01:00
parent d820edfc64
commit e19dd78557
6 changed files with 122 additions and 34 deletions
+24 -24
View File
@@ -9,7 +9,7 @@ from ..functions.tools.vrm_unity_conversion import AvatarToolkit_OT_ConvertVRMTo
class AvatarToolKit_PT_VRMUnityPanel(Panel):
"""Panel for VRM to Unity conversion tools"""
bl_label = "VRM to Unity"
bl_label = t("VRM.panel.label")
bl_idname = "OBJECT_PT_avatar_toolkit_vrm_unity"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
@@ -25,63 +25,63 @@ class AvatarToolKit_PT_VRMUnityPanel(Panel):
# VRM Conversion Tools
vrm_box: UILayout = layout.box()
col: UILayout = vrm_box.column(align=True)
col.label(text="VRM Converter", icon='ARMATURE_DATA')
col.label(text=t("VRM.converter.title"), icon='ARMATURE_DATA')
col.separator(factor=0.5)
# Check if we have an active armature
armature = get_active_armature(context)
if not armature:
col.label(text="No armature selected", icon='ERROR')
col.label(text="Select an armature to convert")
col.label(text=t("VRM.no_armature_selected"), icon='ERROR')
col.label(text=t("VRM.select_armature_to_convert"))
return
# Check if the armature appears to be VRM
is_vrm = detect_vrm_armature(armature)
if is_vrm:
col.label(text=f"Armature: {armature.name}", icon='CHECKMARK')
col.label(text="VRM armature detected", icon='INFO')
col.label(text=t("VRM.armature_name", name=armature.name), icon='CHECKMARK')
col.label(text=t("VRM.armature_detected"), icon='INFO')
col.separator(factor=0.3)
toolkit = context.scene.avatar_toolkit
col.prop(toolkit, 'vrm_remove_colliders', text="Remove Colliders")
col.prop(toolkit, 'vrm_remove_root', text="Remove Root Bone")
col.prop(toolkit, 'vrm_remove_colliders', text=t("VRM.remove_colliders"))
col.prop(toolkit, 'vrm_remove_root', text=t("VRM.remove_root_bone"))
col.separator(factor=0.2)
col.operator(
AvatarToolkit_OT_ConvertVRMToUnity.bl_idname,
text="Convert to Unity Format",
text=t("VRM.convert_to_unity_format"),
icon='EXPORT'
)
info_box = vrm_box.box()
info_col = info_box.column(align=True)
info_col.label(text="Conversion Info:", icon='INFO')
info_col.label(text="• Renames VRM bones to Unity format")
info_col.label(text="• Removes collider bones (optional)")
info_col.label(text="• Removes root bone, makes Hips root (optional)")
info_col.label(text="• Maintains bone hierarchy")
info_col.label(text="• Validates conversion results")
info_col.label(text="• Preserves all animations")
info_col.label(text=t("VRM.conversion_info.title"), icon='INFO')
info_col.label(text=t("VRM.conversion_info.renames_bones"))
info_col.label(text=t("VRM.conversion_info.removes_colliders"))
info_col.label(text=t("VRM.conversion_info.removes_root"))
info_col.label(text=t("VRM.conversion_info.maintains_hierarchy"))
info_col.label(text=t("VRM.conversion_info.validates_results"))
info_col.label(text=t("VRM.conversion_info.preserves_animations"))
else:
col.label(text=f"Armature: {armature.name}", icon='ERROR')
col.label(text="No VRM bones detected", icon='CANCEL')
col.label(text=t("VRM.armature_name", name=armature.name), icon='ERROR')
col.label(text=t("VRM.no_vrm_bones_detected"), icon='CANCEL')
col.separator(factor=0.3)
row = col.row()
row.enabled = False
row.operator(
AvatarToolkit_OT_ConvertVRMToUnity.bl_idname,
text="Convert to Unity Format",
text=t("VRM.convert_to_unity_format"),
icon='CANCEL'
)
help_box = vrm_box.box()
help_col = help_box.column(align=True)
help_col.label(text="VRM Detection Failed:", icon='QUESTION')
help_col.label(text="• Selected armature is not VRM format")
help_col.label(text="• VRM bones start with 'J_Bip_C_'")
help_col.label(text="• Need at least 5 VRM bones detected")
help_col.label(text="• Check armature bone names")
help_col.label(text=t("VRM.detection_failed.title"), icon='QUESTION')
help_col.label(text=t("VRM.detection_failed.not_vrm_format"))
help_col.label(text=t("VRM.detection_failed.bones_start_with"))
help_col.label(text=t("VRM.detection_failed.need_five_bones"))
help_col.label(text=t("VRM.detection_failed.check_bone_names"))