MMD Importing Start

- This is a basic start to try and import both pmx and pmd files, not working 100% at the minute but I working on getting it working.
This commit is contained in:
Yusarina
2024-06-13 22:46:40 +01:00
parent 0f7c46b720
commit db455e6b61
4 changed files with 569 additions and 1 deletions
+37 -1
View File
@@ -1,5 +1,7 @@
import bpy
from ..core.register import register_wrap
from ..core.pmx.import_pmx import import_pmx
from ..core.pmd.import_pmd import import_pmd
@register_wrap
class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
@@ -13,4 +15,38 @@ class AvatarToolkitQuickAccessPanel(bpy.types.Panel):
def draw(self, context):
layout = self.layout
layout.label(text="Quick Access Options")
# Add quick access options here
# Add import buttons
row = layout.row()
row.operator("avatar_toolkit.import_pmx", text="Import PMX")
row.operator("avatar_toolkit.import_pmd", text="Import PMD")
@register_wrap
class AVATAR_TOOLKIT_OT_import_pmx(bpy.types.Operator):
bl_idname = "avatar_toolkit.import_pmx"
bl_label = "Import PMX"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
import_pmx(self.filepath)
return {'FINISHED'}
def invoke(self, 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 = "Import PMD"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
import_pmd(self.filepath)
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}