Merge branch 'main' into Digitigrade-legs-tool
This commit is contained in:
+8
-5
@@ -1,10 +1,11 @@
|
||||
import bpy
|
||||
from ..core.register import register_wrap
|
||||
from .panel import AvatarToolkitPanel
|
||||
from ..functions.translations import t
|
||||
|
||||
@register_wrap
|
||||
class AvatarToolkitOptimizationPanel(bpy.types.Panel):
|
||||
bl_label = "Optimization"
|
||||
bl_label = t("Optimization.label")
|
||||
bl_idname = "OBJECT_PT_avatar_toolkit_optimization"
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
@@ -13,18 +14,20 @@ class AvatarToolkitOptimizationPanel(bpy.types.Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.label(text="Optimization Options")
|
||||
layout.label(text=t("Optimization.options.label"))
|
||||
|
||||
row = layout.row()
|
||||
row.scale_y = 1.2
|
||||
row.operator("avatar_toolkit.combine_materials", text="Combine Materials")
|
||||
row.operator("avatar_toolkit.combine_materials", text=t("Optimization.combine_materials.label"))
|
||||
|
||||
|
||||
layout.separator(factor=0.5)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.scale_y = 1.2
|
||||
row.operator("avatar_toolkit.join_all_meshes", text="Join All Meshes")
|
||||
row.operator("avatar_toolkit.join_selected_meshes", text="Join Selected Meshes")
|
||||
row.operator("avatar_toolkit.join_all_meshes", text=t("Optimization.join_all_meshes.label"))
|
||||
row.operator("avatar_toolkit.join_selected_meshes", text=t("Optimization.join_selected_meshes.label"))
|
||||
row.operator("avatar_toolkit.remove_doubles_safely", text="Remove Doubles Safely")
|
||||
|
||||
# Add optimization options here
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import bpy
|
||||
from ..core.register import register_wrap
|
||||
from ..functions.translations import t
|
||||
|
||||
@register_wrap
|
||||
class AvatarToolkitPanel(bpy.types.Panel):
|
||||
|
||||
+17
-14
@@ -2,6 +2,7 @@ import bpy
|
||||
from ..core.register import register_wrap
|
||||
from .panel import AvatarToolkitPanel
|
||||
from bpy.types import Context
|
||||
from ..functions.translations import t
|
||||
|
||||
from ..core.import_pmx import import_pmx
|
||||
from ..core.import_pmd import import_pmd
|
||||
@@ -9,7 +10,7 @@ from ..core.importer import import_fbx
|
||||
|
||||
@register_wrap
|
||||
class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
|
||||
bl_label = "Quick Access"
|
||||
bl_label = t("Quick_Access.label")
|
||||
bl_idname = "OBJECT_PT_avatar_toolkit_quick_access"
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'UI'
|
||||
@@ -18,22 +19,23 @@ class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
|
||||
|
||||
def draw(self, context: Context):
|
||||
layout = self.layout
|
||||
layout.label(text="Quick Access Options")
|
||||
|
||||
layout.label(text=t("Quick_Access.options"))
|
||||
|
||||
row = layout.row()
|
||||
row.label(text="Import/Export", icon='IMPORT')
|
||||
row.label(text=t("Quick_Access.import_export.label"), icon='IMPORT')
|
||||
|
||||
layout.separator(factor=0.5)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.scale_y = 1.5
|
||||
row.operator("avatar_toolkit.import_menu", text="Import")
|
||||
row.operator("avatar_toolkit.export_menu", text="Export")
|
||||
row.operator("avatar_toolkit.import_menu", text=t("Quick_Access.import"))
|
||||
row.operator("avatar_toolkit.export_menu", text=t("Quick_Access.export"))
|
||||
|
||||
@register_wrap
|
||||
class AVATAR_TOOLKIT_OT_import_menu(bpy.types.Operator):
|
||||
bl_idname = "avatar_toolkit.import_menu"
|
||||
bl_label = "Import Menu"
|
||||
bl_label = t("Quick_Access.import_menu.label")
|
||||
bl_description = t("Quick_Access.import_menu.desc")
|
||||
|
||||
def execute(self, context: Context):
|
||||
return {'FINISHED'}
|
||||
@@ -45,14 +47,15 @@ class AVATAR_TOOLKIT_OT_import_menu(bpy.types.Operator):
|
||||
def draw(self, context: Context):
|
||||
layout = self.layout
|
||||
layout.label(text="Select Import Method")
|
||||
layout.operator("avatar_toolkit.import_pmx", text="Import PMX")
|
||||
layout.operator("avatar_toolkit.import_pmd", text="Import PMD")
|
||||
layout.operator("avatar_toolkit.import_pmx", text=t("Quick_Access.import_pmx"))
|
||||
layout.operator("avatar_toolkit.import_pmd", text=t("Quick_Access.import_pmd"))
|
||||
layout.operator("avatar_toolkit.import_fbx", text="Import FBX")
|
||||
|
||||
@register_wrap
|
||||
class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
|
||||
bl_idname = "avatar_toolkit.export_menu"
|
||||
bl_label = "Export Menu"
|
||||
bl_label = t("Quick_Access.export_menu.label")
|
||||
bl_description = t("Quick_Access.import_pmx.desc")
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -67,14 +70,14 @@ class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
|
||||
|
||||
def draw(self, context: Context):
|
||||
layout = self.layout
|
||||
layout.label(text="Select Export Method")
|
||||
layout.operator("avatar_toolkit.export_resonite", text="Export Resonite")
|
||||
layout.label(text=t("Quick_Access.select_export.label"))
|
||||
layout.operator("avatar_toolkit.export_resonite", text=t("Quick_Access.select_export_resonite.label"))
|
||||
layout.operator("avatar_toolkit.export_fbx", text="Export FBX")
|
||||
|
||||
@register_wrap
|
||||
class AVATAR_TOOLKIT_OT_import_pmx(bpy.types.Operator):
|
||||
bl_idname = "avatar_toolkit.import_pmx"
|
||||
bl_label = "Import PMX"
|
||||
bl_label = t("Quick_Access.import_pmx")
|
||||
|
||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||
|
||||
@@ -89,7 +92,7 @@ class AVATAR_TOOLKIT_OT_import_pmx(bpy.types.Operator):
|
||||
@register_wrap
|
||||
class AVATAR_TOOLKIT_OT_import_pmd(bpy.types.Operator):
|
||||
bl_idname = "avatar_toolkit.import_pmd"
|
||||
bl_label = "Import PMD"
|
||||
bl_label = t("Quick_Access.import_pmd")
|
||||
|
||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||
|
||||
|
||||
+22
-2
@@ -14,6 +14,26 @@ class AvatarToolkitSettingsPanel(bpy.types.Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
props = context.scene
|
||||
layout.prop(context.scene, "avatar_toolkit_language", text=t("Settings.language.label"))
|
||||
|
||||
layout.prop(props, "language")
|
||||
@register_wrap
|
||||
class AVATAR_TOOLKIT_OT_translation_restart_popup(bpy.types.Operator):
|
||||
bl_idname = "avatar_toolkit.translation_restart_popup"
|
||||
bl_label = t("Settings.translation_restart_popup.label")
|
||||
bl_description = t("Settings.translation_restart_popup.description")
|
||||
bl_options = {'INTERNAL'}
|
||||
|
||||
def execute(self, context):
|
||||
if context.scene.avatar_toolkit_language_changed:
|
||||
# Reload the addon after the popup is closed
|
||||
bpy.ops.script.reload()
|
||||
context.scene.avatar_toolkit_language_changed = False
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
return context.window_manager.invoke_props_dialog(self, width=300)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.label(text=t("Settings.translation_restart_popup.message1"))
|
||||
layout.label(text=t("Settings.translation_restart_popup.message2"))
|
||||
|
||||
+7
-3
@@ -3,6 +3,7 @@ from ..core.register import register_wrap
|
||||
from .panel import AvatarToolkitPanel
|
||||
from bpy.types import Context
|
||||
from ..functions.digitigrade_legs import CreateDigitigradeLegs
|
||||
from ..functions.translations import t
|
||||
|
||||
@register_wrap
|
||||
class AvatarToolkitToolsPanel(bpy.types.Panel):
|
||||
@@ -15,10 +16,13 @@ class AvatarToolkitToolsPanel(bpy.types.Panel):
|
||||
|
||||
def draw(self, context: Context):
|
||||
layout = self.layout
|
||||
layout.label(text="Tools")
|
||||
layout.label(text=t("Tools.tools_title.label"))
|
||||
layout.separator(factor=0.5)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.scale_y = 1.5
|
||||
row.operator("avatar_toolkit.convert_to_resonite", text="Translate to Resonite")
|
||||
row.operator(CreateDigitigradeLegs.bl_idname, text="Create Digitigrade Legs")
|
||||
row.operator("avatar_toolkit.convert_to_resonite", text=t("Tools.convert_to_resonite.label"))
|
||||
row = layout.row(align=True)
|
||||
row.operator("avatar_toolkit.remove_doubles_safely", text="Remove Doubles Safely")
|
||||
row = layout.row(align=True)
|
||||
row.operator(CreateDigitigradeLegs.bl_idname, text="Create Digitigrade Legs")
|
||||
|
||||
Reference in New Issue
Block a user