Merge branch 'main' into Texture-Atlasing

This commit is contained in:
Onan Chew
2024-07-22 17:12:37 -04:00
committed by GitHub
13 changed files with 201 additions and 563 deletions
-4
View File
@@ -13,7 +13,3 @@ else:
for module_name in [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]:
print("reloading " +module_name)
exec("importlib.reload("+module_name+")")
+35
View File
@@ -5,6 +5,7 @@ from bpy.types import Context
from ..core.import_pmx import import_pmx
from ..core.import_pmd import import_pmd
from ..core.importer import import_fbx
@register_wrap
class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
@@ -46,12 +47,17 @@ class AVATAR_TOOLKIT_OT_import_menu(bpy.types.Operator):
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_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"
@classmethod
def poll(cls, context):
return any(obj.type == 'MESH' for obj in context.scene.objects)
def execute(self, context: Context):
return {'FINISHED'}
@@ -63,6 +69,7 @@ class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
layout = self.layout
layout.label(text="Select Export Method")
layout.operator("avatar_toolkit.export_resonite", text="Export Resonite")
layout.operator("avatar_toolkit.export_fbx", text="Export FBX")
@register_wrap
class AVATAR_TOOLKIT_OT_import_pmx(bpy.types.Operator):
@@ -93,3 +100,31 @@ class AVATAR_TOOLKIT_OT_import_pmd(bpy.types.Operator):
def invoke(self, context: Context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
@register_wrap
class AVATAR_TOOLKIT_OT_import_fbx(bpy.types.Operator):
bl_idname = "avatar_toolkit.import_fbx"
bl_label = "Import FBX"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
import_fbx(self.filepath)
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
@register_wrap
class AVATAR_TOOLKIT_OT_export_fbx(bpy.types.Operator):
bl_idname = 'avatar_toolkit.export_fbx'
bl_label = "Export FBX"
bl_description = "Export the model as FBX"
bl_options = {'REGISTER', 'UNDO', 'INTERNAL'}
def execute(self, context):
bpy.ops.export_scene.fbx('INVOKE_DEFAULT')
return {'FINISHED'}
+19
View File
@@ -0,0 +1,19 @@
import bpy
from ..core.register import register_wrap
from .panel import AvatarToolkitPanel
from ..functions.translations import t
@register_wrap
class AvatarToolkitSettingsPanel(bpy.types.Panel):
bl_label = t("Settings.label")
bl_idname = "OBJECT_PT_avatar_toolkit_settings"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Avatar Toolkit"
bl_parent_id = "OBJECT_PT_avatar_toolkit"
def draw(self, context):
layout = self.layout
props = context.scene
layout.prop(props, "language")