Fix problems
- fix errors - add import to UI
This commit is contained in:
+2
-67
@@ -6,7 +6,7 @@ from ..functions.translations import t
|
||||
|
||||
from ..core.import_pmx import import_pmx
|
||||
from ..core.import_pmd import import_pmd
|
||||
from ..core.importer import import_fbx
|
||||
from ..functions.import_anything import ImportAnyModel
|
||||
|
||||
@register_wrap
|
||||
class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
|
||||
@@ -28,29 +28,9 @@ class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.scale_y = 1.5
|
||||
row.operator("avatar_toolkit.import_menu", text=t("Quick_Access.import"))
|
||||
row.operator(ImportAnyModel.bl_idname, 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 = t("Quick_Access.import_menu.label")
|
||||
bl_description = t("Quick_Access.import_menu.desc")
|
||||
|
||||
def execute(self, context: Context):
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context: Context, event):
|
||||
wm = context.window_manager
|
||||
return wm.invoke_popup(self, width=200)
|
||||
|
||||
def draw(self, context: Context):
|
||||
layout = self.layout
|
||||
layout.label(text="Select Import Method")
|
||||
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"
|
||||
@@ -74,51 +54,6 @@ class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
|
||||
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 = t("Quick_Access.import_pmx")
|
||||
|
||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||
|
||||
def execute(self, context: Context):
|
||||
import_pmx(self.filepath)
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context: Context, event):
|
||||
context.window_manager.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
@register_wrap
|
||||
class AVATAR_TOOLKIT_OT_import_pmd(bpy.types.Operator):
|
||||
bl_idname = "avatar_toolkit.import_pmd"
|
||||
bl_label = t("Quick_Access.import_pmd")
|
||||
|
||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||
|
||||
def execute(self, context: Context):
|
||||
import_pmd(self.filepath)
|
||||
return {'FINISHED'}
|
||||
|
||||
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'
|
||||
|
||||
Reference in New Issue
Block a user