Added FBX Export

This commit is contained in:
Yusarina
2024-07-22 02:24:33 +01:00
parent 6918b22657
commit 041ce3e5d1
+18 -1
View File
@@ -49,12 +49,15 @@ class AVATAR_TOOLKIT_OT_import_menu(bpy.types.Operator):
layout.operator("avatar_toolkit.import_pmd", text="Import PMD") layout.operator("avatar_toolkit.import_pmd", text="Import PMD")
layout.operator("avatar_toolkit.import_fbx", text="Import FBX") layout.operator("avatar_toolkit.import_fbx", text="Import FBX")
@register_wrap @register_wrap
class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator): class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
bl_idname = "avatar_toolkit.export_menu" bl_idname = "avatar_toolkit.export_menu"
bl_label = "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): def execute(self, context: Context):
return {'FINISHED'} return {'FINISHED'}
@@ -66,6 +69,7 @@ class AVATAR_TOOLKIT_OT_export_menu(bpy.types.Operator):
layout = self.layout layout = self.layout
layout.label(text="Select Export Method") layout.label(text="Select Export Method")
layout.operator("avatar_toolkit.export_resonite", text="Export Resonite") layout.operator("avatar_toolkit.export_resonite", text="Export Resonite")
layout.operator("avatar_toolkit.export_fbx", text="Export FBX")
@register_wrap @register_wrap
class AVATAR_TOOLKIT_OT_import_pmx(bpy.types.Operator): class AVATAR_TOOLKIT_OT_import_pmx(bpy.types.Operator):
@@ -111,3 +115,16 @@ class AVATAR_TOOLKIT_OT_import_fbx(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
context.window_manager.fileselect_add(self) context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'} 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'}