-
Notifications
You must be signed in to change notification settings - Fork 3
/
__init__.py
75 lines (46 loc) · 1.7 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
75
# SPDX-FileCopyrightText: 2020-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
if "bpy" in locals():
from . import var
essentials.reload_recursive(var.ADDON_DIR, locals())
else:
import bpy
from bpy.props import PointerProperty
from . import essentials, localization, onscreen, operators, preferences, ui
classes = essentials.get_classes((preferences, operators, ui))
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.WindowManager.sidekick = PointerProperty(type=preferences.WmProperties)
bpy.types.Scene.sidekick = PointerProperty(type=preferences.SceneProperties)
# Menu
# ---------------------------
bpy.types.VIEW3D_MT_object_context_menu.append(ui.draw_object_context_menu)
# Overlays option
# ---------------------------
bpy.types.VIEW3D_HT_header.append(ui.draw_3dview_header)
# Handlers
# ---------------------------
onscreen.handler_add()
# Translations
# ---------------------------
bpy.app.translations.register(__name__, localization.DICTIONARY)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
del bpy.types.WindowManager.sidekick
del bpy.types.Scene.sidekick
# Menu
# ---------------------------
bpy.types.VIEW3D_MT_object_context_menu.remove(ui.draw_object_context_menu)
# Overlays option
# ---------------------------
bpy.types.VIEW3D_HT_header.remove(ui.draw_3dview_header)
# Handlers
# ---------------------------
onscreen.handler_del()
# Translations
# ---------------------------
bpy.app.translations.unregister(__name__)
if __name__ == "__main__":
register()