-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__init__.py
53 lines (41 loc) · 1.23 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
from bpy.types import TOPBAR_MT_file_export, TOPBAR_MT_file_import
from bpy.utils import register_class, unregister_class
from .modules.exporter import ExportIIIF3DManifest
from .modules.importer import ImportIIIF3DManifest
from .modules.ui import (
IIIFManifestPanel,
register_ui_properties,
unregister_ui_properties,
)
classes = (
ImportIIIF3DManifest,
ExportIIIF3DManifest,
IIIFManifestPanel,
)
def menu_func_import(self, context):
self.layout.operator(
ImportIIIF3DManifest.bl_idname, text="IIIF 3D Manifest (.json)"
)
def menu_func_export(self, context):
self.layout.operator(
ExportIIIF3DManifest.bl_idname, text="IIIF 3D Manifest (.json)"
)
def register():
for cls in classes:
register_class(cls)
register_ui_properties()
TOPBAR_MT_file_import.append(menu_func_import)
TOPBAR_MT_file_export.append(menu_func_export)
def unregister():
TOPBAR_MT_file_import.remove(menu_func_import)
TOPBAR_MT_file_export.remove(menu_func_export)
unregister_ui_properties()
for cls in classes:
unregister_class(cls)
if __name__ == "__main__":
try:
register()
except Exception as e:
print(e)
unregister()
raise e