-
Notifications
You must be signed in to change notification settings - Fork 5
/
__init__.py
74 lines (57 loc) · 2.55 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import bpy
from .BlenderIO.Import import ImportDSCS, ImportMegido
from .BlenderIO.Export import ExportDSCS, ExportMegido
from .BlenderIO.DSCSBlenderUtils import MessagePopup
bl_info = {
"name": "Media.Vision Import/Export (.name)",
"description": "Imports model and animation files from Media.Vision titles.",
"author": "Pherakki",
"version": (0, 2),
"blender": (2, 80, 0),
"location": "File > Import, File > Export",
"warning": "",
"wiki_url": "https://github.com/Pherakki/Blender-Tools-for-DSCS",
"tracker_url": "https://github.com/Pherakki/Blender-Tools-for-DSCS/issues",
"category": "Import-Export",
}
class MVImportSubmenu(bpy.types.Menu):
bl_idname = "OBJECT_MT_MediaVision_import_submenu"
bl_label = "Media.Vision"
def draw(self, context):
layout = self.layout
layout.operator(ImportDSCS.bl_idname, text="DSCS Model (.name)")
layout.operator(ImportMegido.bl_idname, text="Megido 72 Model (.name)")
class MVExportSubmenu(bpy.types.Menu):
bl_idname = "OBJECT_MT_MediaVision_export_submenu"
bl_label = "Media.Vision"
def draw(self, context):
layout = self.layout
layout.operator(ExportDSCS.bl_idname, text="DSCS Model (.name)")
# layout.operator(ExportMegido.bl_idname, text="Megido 72 Model (.name)")
def menu_func_import(self, context):
self.layout.menu(MVImportSubmenu.bl_idname)
def menu_func_export(self, context):
self.layout.menu(MVExportSubmenu.bl_idname)
def register():
blender_version = bpy.app.version_string # Can use this string to switch version-dependent Blender API codes
bpy.utils.register_class(ImportDSCS)
bpy.utils.register_class(ImportMegido)
bpy.utils.register_class(MVImportSubmenu)
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
bpy.utils.register_class(ExportDSCS)
# bpy.utils.register_class(ExportMegido)
bpy.utils.register_class(MVExportSubmenu)
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
bpy.utils.register_class(MessagePopup)
def unregister():
bpy.utils.unregister_class(ImportDSCS)
bpy.utils.unregister_class(ImportMegido)
bpy.utils.unregister_class(MVImportSubmenu)
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
bpy.utils.unregister_class(ExportDSCS)
# bpy.utils.unregister_class(ExportMegido)
bpy.utils.unregister_class(MVExportSubmenu)
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
bpy.utils.unregister_class(MessagePopup)
# if __name__ == "__main__":
# register()