-
Notifications
You must be signed in to change notification settings - Fork 2
/
__init__.py
172 lines (156 loc) · 5.78 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import bpy
from . ui.pie_menus import (
# get_prefs,
SM_MT_pie_add,
SM_MT_pie_add_call,
SM_MT_pie_add_node,
SM_MT_pie_add_node_call,
SM_MT_add_texture_node,
SM_MT_add_shader_node,
SM_MT_pie_q_menu,
SM_MT_pie_q_menu_call,
SM_MT_pie_a_om,
SM_MT_pie_a_om_call,
SM_MT_pie_q_node,
SM_MT_pie_q_node_call,
SM_MT_pie_a_node,
SM_MT_pie_a_node_call,
SM_MT_pie_tab_menu,
SM_MT_pie_tab_menu_call,
SM_MT_pie_m4_menu,
SM_MT_pie_m4_menu_call,
SM_MT_pie_w_menu,
SM_MT_pie_w_menu_call,
SM_MT_pie_w_sculpt_menu,
SM_MT_ot_w_sculpt_menu_call,
)
from . ui.mesh_history_panel import SM_PT_mesh_history_panel
from . operators.comp_adjust_view import SM_Modal_adjust_view
from . operators.mesh_history_operator import (
SM_mesh_history_Props,
SM_mesh_history_make_Instance,
SM_mesh_history_switch_to_edit_mode,
on_frame_change,
# SM_MH_Auto_Instance, later?
SM_mesh_history_delete_instances,
SM_mesh_history_delete_current_instance,
SM_MH_Instances,
)
from . prefs import SM_Prefs, add_hotkey, remove_hotkey
from . ui.get_icon import register_icons, unregister_icons
from . ui.add_pose_copy_buttons import add_pose_copy_buttons
from . operators.change_area_type import SM_change_area_type, SM_change_area_type_modal
from . ui.change_workspaces_pie import SM_MT_pie_workspaces_menu, SM_MT_pie_workspaces_menu_Call, SM_change_workspace
from . ui.main_popup_panel import SM_OT_Main_Popup, Main_Popup_Props, Render_Settings_Props, GOS_Props
bl_info = {
"name": "S.Menu",
"author": "Syler",
"version": (0, 0, 1, 6),
"description": "Adds Pie Menus",
"blender": (2, 90, 0),
"category": "3D view"
}
classes = [
# § Props
Main_Popup_Props,
GOS_Props,
Render_Settings_Props,
# ? PIE Menus and pie menu calls
SM_MT_pie_add,
SM_MT_pie_add_call,
SM_MT_pie_add_node,
SM_MT_pie_add_node_call,
SM_MT_add_texture_node,
SM_MT_add_shader_node,
SM_MT_pie_q_menu,
SM_MT_pie_q_menu_call,
SM_MT_pie_a_om,
SM_MT_pie_a_om_call,
SM_MT_pie_q_node,
SM_MT_pie_q_node_call,
SM_MT_pie_a_node,
SM_MT_pie_a_node_call,
SM_MT_pie_tab_menu,
SM_MT_pie_tab_menu_call,
SM_MT_pie_m4_menu,
SM_MT_pie_m4_menu_call,
SM_MT_pie_w_menu,
SM_MT_pie_w_menu_call,
SM_MT_pie_w_sculpt_menu,
SM_MT_ot_w_sculpt_menu_call,
# ------
SM_MT_pie_workspaces_menu,
SM_MT_pie_workspaces_menu_Call,
# ? Prefs
SM_Prefs,
# + Mesh History
SM_PT_mesh_history_panel,
SM_mesh_history_Props,
SM_mesh_history_make_Instance,
SM_mesh_history_switch_to_edit_mode,
SM_mesh_history_delete_instances,
SM_mesh_history_delete_current_instance,
SM_MH_Instances,
# ? Popup Panels
SM_OT_Main_Popup,
# § Operators
SM_change_area_type,
SM_change_workspace,
# § Modals
SM_Modal_adjust_view,
SM_change_area_type_modal,
]
def register():
for c in classes:
bpy.utils.register_class(c)
# + add hotkey
add_hotkey()
# ------------------------------------------------------------------------------------------------------------
# § Register prop group
# ------------------------------------------------------------------------------------------------------------
bpy.types.Object.SM_MH_Instances = bpy.props.CollectionProperty(
type=SM_MH_Instances)
bpy.types.Scene.SM_GOS_Props = bpy.props.PointerProperty(type=GOS_Props)
bpy.types.Scene.SM_Render_Settings_Props = bpy.props.PointerProperty(
type=Render_Settings_Props)
bpy.types.Scene.SM_Main_Popup_Props = bpy.props.PointerProperty(
type=Main_Popup_Props)
# ------------------------------------------------------------------------------------------------------------
# + Append Register stuff
# ------------------------------------------------------------------------------------------------------------
bpy.types.VIEW3D_MT_editor_menus.append(add_pose_copy_buttons)
# add on_frame_change handler to blender
# bpy.app.handlers.frame_change_pre.append(on_frame_change)
# bpy.app.timers.register(SM_MH_Auto_Instance) later?
# ------------------------------------------------------------------------------------------------------------
# Icons Register stuff
# ------------------------------------------------------------------------------------------------------------
register_icons(__file__)
def unregister():
for c in classes:
bpy.utils.unregister_class(c)
# + remove hotkey
remove_hotkey()
# remove on_frame_change handler from blender
try:
bpy.app.handlers.frame_change_pre.remove(on_frame_change)
# bpy.app.timers.unregister(SM_MH_Auto_Instance) later?
except:
pass
# ------------------------------------------------------------------------------------------------------------
# $ delete prop group
# ------------------------------------------------------------------------------------------------------------
del(bpy.types.Object.SM_MH_Instances)
del(bpy.types.Scene.SM_GOS_Props)
del(bpy.types.Scene.SM_Render_Settings_Props)
del(bpy.types.Scene.SM_Main_Popup_Props)
# ------------------------------------------------------------------------------------------------------------
# Append Unregister stuff
# ------------------------------------------------------------------------------------------------------------
bpy.types.VIEW3D_MT_editor_menus.remove(add_pose_copy_buttons)
# ------------------------------------------------------------------------------------------------------------
# Icons Unregister stuff
# ------------------------------------------------------------------------------------------------------------
unregister_icons()
if __name__ == "__main__":
register()