-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__init__.py
96 lines (72 loc) · 3.25 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
bl_info = {
"name" : "Neltulz - Edge Curve",
"author" : "Neil V. Moore",
"description" : "Allows you to quickly insert edge loops with flow (Requires edge flow addon)",
"blender" : (2, 80, 0),
"version" : (1, 0, 7),
"location" : "View3D",
"warning" : "",
"category" : "3D View",
"tracker_url": "https://www.logichaos.com/neltulz_blender_addons/neltulz_contact_page/neltulz_contact_page",
"wiki_url": "https://www.logichaos.com/neltulz_blender_addons/neltulz_edge_curve_plus/README_Neltulz_Edge_Curve_Plus"
}
# -----------------------------------------------------------------------------
# Import Classes and/or functions
# -----------------------------------------------------------------------------
import bpy
from . properties import NTZEDGCRV_ignitproperties
from . main_ot import NTZEDGCRV_OT_insertedges
from . misc_ot import NTZEDGCRV_OT_resetsettings
from . addon_preferences import NTZEDGCRV_OT_addonprefs
from . panels import NTZEDGCRV_PT_options
from . panels import NTZEDGCRV_PT_sidebarpanel
from . import keymaps
PendingDeprecationWarning
bDebugModeActive = False
if bDebugModeActive:
print("##################################################################################################################################################################")
print("REMINDER: DEBUG MODE ACTIVE")
print("##################################################################################################################################################################")
# -----------------------------------------------------------------------------
# Store classes in List so that they can be easily registered/unregistered
# -----------------------------------------------------------------------------
classes = (
NTZEDGCRV_ignitproperties,
NTZEDGCRV_OT_insertedges,
NTZEDGCRV_OT_resetsettings,
NTZEDGCRV_OT_addonprefs,
NTZEDGCRV_PT_options,
NTZEDGCRV_PT_sidebarpanel,
)
# -----------------------------------------------------------------------------
# Register classes from the classes list
# -----------------------------------------------------------------------------
addon_keymaps = []
#vscode pme workaround from iceythe (part 2 of 2)
def _reg():
pme = bpy.utils._preferences.addons['pie_menu_editor'].preferences
for pm in pme.pie_menus:
if pm.key != 'NONE':
pm.register_hotkey()
#END vscode pme workaround (part 2 of 2)
def register():
from bpy.utils import register_class
for cls in classes:
register_class(cls)
# update panel name
prefs = bpy.context.preferences.addons[__name__].preferences
addon_preferences.update_panel(prefs, bpy.context)
#add keymaps from keymaps.py
keymaps.neltulz_edge_curve_plus_register_keymaps(addon_keymaps)
#add property group to the scene
bpy.types.Scene.ntzedgcrv = bpy.props.PointerProperty(type=NTZEDGCRV_ignitproperties)
def unregister():
from bpy.utils import unregister_class
for cls in reversed(classes):
unregister_class(cls)
#remove keymaps
keymaps.neltulz_edge_curve_plus_unregister_keymaps(addon_keymaps)
if __name__ == "__main__":
register()
# test call
bpy.ops.ntzedgcrv.insertedges()