UI Updates

- Added icons to ui.
- Re-organised the UI slightly.
- Added some more Titles such as Join Meshes and etc.
- Slight wording changing on descriptions.
This commit is contained in:
Yusarina
2024-07-25 21:48:40 +01:00
parent d4e8ffeebb
commit 83366072b8
9 changed files with 106 additions and 86 deletions
+16 -11
View File
@@ -2,7 +2,7 @@ from bpy.types import UIList, Panel, UILayout, Object, Context,Material, Operato
import bpy
from ..core.register import register_wrap
from .panel import AvatarToolkitPanel
from ..core.common import SceneMatClass, material_list_bool
from ..core.common import SceneMatClass, material_list_bool, get_selected_armature
from ..functions.atlas_materials import Atlas_Materials
from ..functions.translations import t
@@ -70,14 +70,19 @@ class TextureAtlasPanel(Panel):
def draw(self, context: Context):
layout = self.layout
row = layout.row()
boxoutter = row.box()
direction_icon = 'RIGHTARROW' if not context.scene.texture_atlas_Has_Mat_List_Shown else 'DOWNARROW_HLT'
row = boxoutter.row()
row.operator(ExpandSection_Materials.bl_idname, text=(t("TextureAtlas.reload_list") if not context.scene.texture_atlas_Has_Mat_List_Shown else t("TextureAtlas.loaded_list")), icon=direction_icon)
if context.scene.texture_atlas_Has_Mat_List_Shown:
row = boxoutter.row()
row.template_list(MaterialTextureAtlasProperties.bl_idname, 'material_list', context.scene, 'materials',
context.scene, 'texture_atlas_material_index', rows=12, type='DEFAULT')
armature = get_selected_armature(context)
if armature:
row = layout.row()
row.operator(Atlas_Materials.bl_idname, text=t("TextureAtlas.atlas_materials"))
boxoutter = row.box()
direction_icon = 'RIGHTARROW' if not context.scene.texture_atlas_Has_Mat_List_Shown else 'DOWNARROW_HLT'
row = boxoutter.row()
row.operator(ExpandSection_Materials.bl_idname, text=(t("TextureAtlas.reload_list") if not context.scene.texture_atlas_Has_Mat_List_Shown else t("TextureAtlas.loaded_list")), icon=direction_icon)
if context.scene.texture_atlas_Has_Mat_List_Shown:
row = boxoutter.row()
row.template_list(MaterialTextureAtlasProperties.bl_idname, 'material_list', context.scene, 'materials',
context.scene, 'texture_atlas_material_index', rows=12, type='DEFAULT')
row = layout.row()
row.operator(Atlas_Materials.bl_idname, text=t("TextureAtlas.atlas_materials"))
else:
layout.label(text=t("Tools.select_armature"), icon='ERROR')
+15 -10
View File
@@ -19,19 +19,24 @@ class AvatarToolkitOptimizationPanel(bpy.types.Panel):
armature = get_selected_armature(context)
if armature:
layout.label(text=t("Optimization.options.label"))
layout.label(text=t("Optimization.options.label"), icon='SETTINGS')
row = layout.row()
row.scale_y = 1.2
row.operator("avatar_toolkit.combine_materials", text=t("Optimization.combine_materials.label"))
layout.separator(factor=0.5)
row.operator("avatar_toolkit.combine_materials", text=t("Optimization.combine_materials.label"), icon='MATERIAL')
row = layout.row(align=True)
row.scale_y = 1.2
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=t("Optimization.remove_doubles_safely.label"))
else:
layout.label(text=t("Optimization.select_armature"))
row.operator("avatar_toolkit.remove_doubles_safely", text=t("Optimization.remove_doubles_safely.label"), icon='SNAP_VERTEX')
layout.separator(factor=0.5)
layout.label(text=t("Optimization.joinmeshes.label"), icon='SETTINGS')
row = layout.row(align=True)
row.scale_y = 1.2
row.operator("avatar_toolkit.join_all_meshes", text=t("Optimization.join_all_meshes.label"), icon='OUTLINER_OB_MESH')
row.operator("avatar_toolkit.join_selected_meshes", text=t("Optimization.join_selected_meshes.label"), icon='STICKY_UVS_LOC')
else:
layout.label(text=t("Optimization.select_armature"), icon='ERROR')
+1 -1
View File
@@ -15,5 +15,5 @@ class AvatarToolkitPanel(bpy.types.Panel):
layout.label(text=t("AvatarToolkit.welcome"))
layout.label(text=t("AvatarToolkit.description"))
layout.label(text=t("AvatarToolkit.alpha_warning"))
#print("Avatar Toolkit Panel is being drawn")
+10 -8
View File
@@ -9,6 +9,7 @@ from ..core.import_pmd import import_pmd
from ..functions.import_anything import ImportAnyModel
from ..core.common import get_selected_armature, set_selected_armature
@register_wrap
@register_wrap
class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
bl_label = t("Quick_Access.label")
@@ -21,9 +22,11 @@ class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
def draw(self, context: Context):
layout = self.layout
layout.label(text=t("Quick_Access.options"))
layout.label(text=t("Quick_Access.options"), icon='TOOL_SETTINGS')
layout.prop(context.scene, "selected_armature", text="Select Armature")
layout.label(text=t("Quick_Access.select_armature"), icon='ARMATURE_DATA')
layout.prop(context.scene, "selected_armature", text="")
row = layout.row()
row.label(text=t("Quick_Access.import_export.label"), icon='IMPORT')
@@ -32,8 +35,8 @@ class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
row = layout.row(align=True)
row.scale_y = 1.5
row.operator(ImportAnyModel.bl_idname, text=t("Quick_Access.import"))
row.operator("avatar_toolkit.export_menu", text=t("Quick_Access.export"))
row.operator(ImportAnyModel.bl_idname, text=t("Quick_Access.import"), icon='IMPORT')
row.operator("avatar_toolkit.export_menu", text=t("Quick_Access.export"), icon='EXPORT')
@register_wrap
class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
@@ -54,9 +57,9 @@ class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
def draw(self, context: Context):
layout = self.layout
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=t("Quick_Access.export_fbx.label"))
layout.label(text=t("Quick_Access.select_export.label"), icon='EXPORT')
layout.operator("avatar_toolkit.export_resonite", text=t("Quick_Access.select_export_resonite.label"), icon='SCENE_DATA')
layout.operator("avatar_toolkit.export_fbx", text=t("Quick_Access.export_fbx.label"), icon='OBJECT_DATA')
@register_wrap
class AVATAR_TOOLKIT_OT_export_fbx(bpy.types.Operator):
@@ -68,4 +71,3 @@ class AVATAR_TOOLKIT_OT_export_fbx(bpy.types.Operator):
def execute(self, context):
bpy.ops.export_scene.fbx('INVOKE_DEFAULT')
return {'FINISHED'}
+6 -4
View File
@@ -15,7 +15,9 @@ class AvatarToolkitSettingsPanel(bpy.types.Panel):
def draw(self, context):
layout = self.layout
layout.prop(context.scene, "avatar_toolkit_language", text=t("Settings.language.label"))
layout.label(text=t("Settings.language.label"))
layout.prop(context.scene, "avatar_toolkit_language", text="", icon='WORLD')
@register_wrap
class AVATAR_TOOLKIT_OT_translation_restart_popup(bpy.types.Operator):
@@ -26,7 +28,6 @@ class AVATAR_TOOLKIT_OT_translation_restart_popup(bpy.types.Operator):
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'}
@@ -36,5 +37,6 @@ class AVATAR_TOOLKIT_OT_translation_restart_popup(bpy.types.Operator):
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"))
layout.label(text=t("Settings.translation_restart_popup.message1"), icon='INFO')
layout.label(text=t("Settings.translation_restart_popup.message2"), icon='FILE_REFRESH')
+4 -4
View File
@@ -21,13 +21,13 @@ class AvatarToolkitToolsPanel(bpy.types.Panel):
armature = get_selected_armature(context)
if armature:
layout.label(text=t("Tools.tools_title.label"))
layout.label(text=t("Tools.tools_title.label"), icon='TOOL_SETTINGS')
layout.separator(factor=0.5)
row = layout.row(align=True)
row.scale_y = 1.5
row.operator("avatar_toolkit.convert_to_resonite", text=t("Tools.convert_to_resonite.label"))
row.operator("avatar_toolkit.convert_to_resonite", text=t("Tools.convert_to_resonite.label"), icon='SCENE_DATA')
row = layout.row(align=True)
row.operator(CreateDigitigradeLegs.bl_idname, text=t("Tools.create_digitigrade_legs.label"))
row.operator(CreateDigitigradeLegs.bl_idname, text=t("Tools.create_digitigrade_legs.label"), icon='BONE_DATA')
else:
layout.label(text=t("Tools.select_armature"))
layout.label(text=t("Tools.select_armature"), icon='ERROR')
+10 -7
View File
@@ -18,18 +18,21 @@ class AvatarToolkitVisemePanel(bpy.types.Panel):
armature = get_selected_armature(context)
if armature:
layout.prop(context.scene, "selected_mesh", text=t("VisemePanel.select_mesh"))
layout.prop(context.scene, "selected_mesh", text=t("VisemePanel.select_mesh"), icon='OUTLINER_OB_MESH')
row = layout.row()
mesh = bpy.data.objects.get(context.scene.selected_mesh)
if mesh and mesh.type == 'MESH':
if mesh.data.shape_keys:
layout.prop_search(context.scene, "mouth_a", mesh.data.shape_keys, "key_blocks", text=t('VisemePanel.mouth_a.label'))
layout.prop_search(context.scene, "mouth_o", mesh.data.shape_keys, "key_blocks", text=t('VisemePanel.mouth_o.label'))
layout.prop_search(context.scene, "mouth_ch", mesh.data.shape_keys, "key_blocks", text=t('VisemePanel.mouth_ch.label'))
layout.prop_search(context.scene, "mouth_a", mesh.data.shape_keys, "key_blocks", text=t('VisemePanel.mouth_a.label'), icon='SHAPEKEY_DATA')
layout.prop_search(context.scene, "mouth_o", mesh.data.shape_keys, "key_blocks", text=t('VisemePanel.mouth_o.label'), icon='SHAPEKEY_DATA')
layout.prop_search(context.scene, "mouth_ch", mesh.data.shape_keys, "key_blocks", text=t('VisemePanel.mouth_ch.label'), icon='SHAPEKEY_DATA')
layout.prop(context.scene, 'shape_intensity', text=t('VisemePanel.shape_intensity'))
layout.prop(context.scene, 'shape_intensity', text=t('VisemePanel.shape_intensity'), icon='FORCE_LENNARDJONES')
layout.operator("avatar_toolkit.create_visemes", text=t('VisemePanel.create_visemes'), icon='TRIA_RIGHT')
row = layout.row()
row.scale_y = 1.2
row.operator("avatar_toolkit.create_visemes", text=t('VisemePanel.create_visemes'), icon='TRIA_RIGHT')
else:
layout.label(text=t('VisemePanel.error.noShapekeys'), icon='ERROR')
else:
@@ -38,4 +41,4 @@ class AvatarToolkitVisemePanel(bpy.types.Panel):
layout.label(text=t('VisemePanel.error.noArmature'), icon='ERROR')
layout.separator()
layout.label(text=t('VisemePanel.info.selectMesh'))
layout.label(text=t('VisemePanel.info.selectMesh'), icon='HELP')