1 # SPDX-FileCopyrightText: 2019-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 "name": "Dynamic Context Menu",
7 "author": "meta-androcto",
10 "location": "View3D > Spacebar",
11 "description": "Object Mode Context Sensitive Spacebar Menu",
13 "doc_url": "{BLENDER_MANUAL_URL}/addons/interface/context_menu.html",
14 "category": "Interface",
19 importlib
.reload(object_menus
)
20 importlib
.reload(edit_mesh
)
21 importlib
.reload(transform_menus
)
22 importlib
.reload(view_menus
)
23 importlib
.reload(armature_menus
)
24 importlib
.reload(curve_menus
)
25 importlib
.reload(snap_origin_cursor
)
26 importlib
.reload(animation_menus
)
29 from . import object_menus
30 from . import edit_mesh
31 from . import transform_menus
32 from . import view_menus
33 from . import armature_menus
34 from . import curve_menus
35 from . import snap_origin_cursor
36 from . import animation_menus
40 from bpy
.types
import (
45 from bpy
.props
import (
51 # Dynamic Context Sensitive Menu #
52 # Main Menu based on Object Type & 3d View Editor Mode #
54 class VIEW3D_MT_Space_Dynamic_Menu(Menu
):
55 bl_label
= "Dynamic Context Menu"
57 def draw(self
, context
):
59 settings
= context
.tool_settings
60 layout
.operator_context
= 'INVOKE_REGION_WIN'
61 obj
= context
.active_object
62 view
= context
.space_data
64 # No Object Selected #
65 ob
= bpy
.context
.object
66 if not ob
or not ob
.select_get():
68 layout
.operator_context
= 'INVOKE_REGION_WIN'
69 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
70 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
71 layout
.menu("VIEW3D_MT_Animation_Player",
72 text
="Animation", icon
='PLAY')
73 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
74 UseSeparator(self
, context
)
75 layout
.menu("INFO_MT_area", icon
='WORKSPACE')
76 layout
.menu("VIEW3D_MT_view_viewpoint", icon
='ZOOM_ALL')
77 layout
.menu("VIEW3D_MT_view_navigation", icon
='PIVOT_BOUNDBOX')
78 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
79 UseSeparator(self
, context
)
80 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
81 UseSeparator(self
, context
)
82 layout
.operator("view3d.snap_cursor_to_center",
83 text
="Cursor to World Origin")
84 layout
.operator("view3d.snap_cursor_to_grid",
85 text
="Cursor to Grid")
86 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
87 UseSeparator(self
, context
)
88 layout
.prop(view
, "show_region_toolbar", icon
='MENU_PANEL')
89 layout
.prop(view
, "show_region_ui", icon
='MENU_PANEL')
94 if obj
and obj
.type == 'MESH' and obj
.mode
in {'OBJECT'}:
96 layout
.operator_context
= 'INVOKE_REGION_WIN'
97 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
98 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
99 layout
.menu("VIEW3D_MT_Animation_Player",
100 text
="Animation", icon
='PLAY')
101 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
102 layout
.menu("VIEW3D_MT_InteractiveMode", icon
='VIEW3D')
103 UseSeparator(self
, context
)
104 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
105 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
106 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
107 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
108 UseSeparator(self
, context
)
109 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
110 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
111 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
112 UseSeparator(self
, context
)
113 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
114 UseSeparator(self
, context
)
115 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
116 UseSeparator(self
, context
)
117 layout
.operator("object.delete", text
="Delete Object", icon
='X')
118 UseSeparator(self
, context
)
119 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
122 if obj
and obj
.type == 'MESH' and obj
.mode
in {'EDIT'}:
124 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
125 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
126 layout
.menu("VIEW3D_MT_Animation_Player",
127 text
="Animation", icon
='PLAY')
128 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
129 layout
.menu("VIEW3D_MT_InteractiveMode", icon
='EDITMODE_HLT')
130 layout
.menu("VIEW3D_MT_Edit_Multi", icon
='VERTEXSEL')
131 UseSeparator(self
, context
)
132 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
133 layout
.menu("VIEW3D_MT_select_edit_mesh", icon
='RESTRICT_SELECT_OFF')
134 layout
.menu("VIEW3D_MT_mesh_add", text
="Add Mesh", icon
='MESH_CUBE')
135 layout
.menu("VIEW3D_MT_edit_mesh", text
="Mesh", icon
='MESH_DATA')
136 UseSeparator(self
, context
)
137 layout
.menu("VIEW3D_MT_edit_mesh_vertices", icon
='VERTEXSEL')
138 layout
.menu("VIEW3D_MT_edit_mesh_edges", icon
='EDGESEL')
139 layout
.menu("VIEW3D_MT_edit_mesh_faces", icon
='FACESEL')
140 UseSeparator(self
, context
)
141 layout
.menu("VIEW3D_MT_uv_map", icon
='MOD_UVPROJECT')
142 UseSeparator(self
, context
)
143 layout
.menu("VIEW3D_MT_EditCursorMenu", icon
='PIVOT_CURSOR')
144 UseSeparator(self
, context
)
145 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
146 UseSeparator(self
, context
)
147 layout
.menu("VIEW3D_MT_edit_mesh_delete", icon
='X')
148 UseSeparator(self
, context
)
149 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
152 if obj
and obj
.type == 'MESH' and obj
.mode
in {'SCULPT'}:
154 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
155 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
156 layout
.menu("VIEW3D_MT_Animation_Player",
157 text
="Animation", icon
='PLAY')
158 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
159 layout
.menu("VIEW3D_MT_InteractiveMode", icon
='EDITMODE_HLT')
160 UseSeparator(self
, context
)
161 layout
.menu("VIEW3D_MT_view", icon
='ZOOM_ALL')
162 layout
.menu("VIEW3D_MT_sculpt", icon
='SCULPTMODE_HLT')
163 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
166 if obj
and obj
.type == 'MESH' and obj
.mode
in {'VERTEX_PAINT'}:
168 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
169 layout
.menu("VIEW3D_MT_Animation_Player",
170 text
="Animation", icon
='PLAY')
171 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
172 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
173 layout
.menu("VIEW3D_MT_InteractiveMode", icon
='EDITMODE_HLT')
174 UseSeparator(self
, context
)
175 layout
.menu("VIEW3D_MT_view", icon
='ZOOM_ALL')
176 layout
.menu("VIEW3D_MT_paint_vertex", icon
='VPAINT_HLT')
177 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
179 # Weight Paint Menu #
180 if obj
and obj
.type == 'MESH' and obj
.mode
in {'WEIGHT_PAINT'}:
182 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
183 layout
.menu("VIEW3D_MT_Animation_Player",
184 text
="Animation", icon
='PLAY')
185 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
186 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
187 layout
.menu("VIEW3D_MT_InteractiveMode", icon
='EDITMODE_HLT')
188 UseSeparator(self
, context
)
189 layout
.menu("VIEW3D_MT_view", icon
='ZOOM_ALL')
190 layout
.menu("VIEW3D_MT_paint_weight", icon
='WPAINT_HLT')
191 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
194 if obj
and obj
.type == 'MESH' and obj
.mode
in {'TEXTURE_PAINT'}:
196 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
197 layout
.menu("VIEW3D_MT_Animation_Player",
198 text
="Animation", icon
='PLAY')
199 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
200 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
201 layout
.menu("VIEW3D_MT_InteractiveMode", icon
='EDITMODE_HLT')
202 UseSeparator(self
, context
)
203 layout
.menu("VIEW3D_MT_view", icon
='ZOOM_ALL')
204 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
206 # Curve Object Mode #
207 if obj
and obj
.type == 'CURVE' and obj
.mode
in {'OBJECT'}:
209 layout
.operator_context
= 'INVOKE_REGION_WIN'
210 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
211 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
212 layout
.menu("VIEW3D_MT_Animation_Player",
213 text
="Animation", icon
='PLAY')
214 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
215 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
216 UseSeparator(self
, context
)
217 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
218 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
219 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
220 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
221 UseSeparator(self
, context
)
222 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
223 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
224 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
225 UseSeparator(self
, context
)
226 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
227 UseSeparator(self
, context
)
228 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
229 UseSeparator(self
, context
)
230 layout
.operator("object.delete", text
="Delete Object", icon
='X')
231 UseSeparator(self
, context
)
232 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
235 if obj
and obj
.type == 'CURVE' and obj
.mode
in {'EDIT'}:
237 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
238 layout
.menu("VIEW3D_MT_Animation_Player",
239 text
="Animation", icon
='PLAY')
240 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
241 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
242 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
243 UseSeparator(self
, context
)
244 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
245 layout
.menu("VIEW3D_MT_select_edit_curve",
246 icon
='RESTRICT_SELECT_OFF')
247 layout
.menu("VIEW3D_MT_curve_add", text
="Add Curve",
248 icon
='OUTLINER_OB_CURVE')
249 UseSeparator(self
, context
)
250 layout
.menu("VIEW3D_MT_Edit_Curve", icon
='CURVE_DATA')
251 layout
.menu("VIEW3D_MT_transform", icon
='EMPTY_ARROWS')
252 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
253 layout
.menu("VIEW3D_MT_edit_curve_ctrlpoints",
254 icon
='CURVE_BEZCURVE')
255 UseSeparator(self
, context
)
256 layout
.menu("VIEW3D_MT_edit_curve_delete", text
="Delete",
258 UseSeparator(self
, context
)
259 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
261 # Surface Object Mode #
262 if obj
and obj
.type == 'SURFACE' and obj
.mode
in {'OBJECT'}:
264 layout
.operator_context
= 'INVOKE_REGION_WIN'
265 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
266 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
267 layout
.menu("VIEW3D_MT_Animation_Player",
268 text
="Animation", icon
='PLAY')
269 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
270 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
271 UseSeparator(self
, context
)
272 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
273 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
274 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
275 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
276 UseSeparator(self
, context
)
277 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
278 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
279 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
280 UseSeparator(self
, context
)
281 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
282 UseSeparator(self
, context
)
283 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
284 UseSeparator(self
, context
)
285 layout
.operator("object.delete", text
="Delete Object", icon
='X')
286 UseSeparator(self
, context
)
287 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
290 if obj
and obj
.type == 'SURFACE' and obj
.mode
in {'EDIT'}:
292 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
293 layout
.menu("VIEW3D_MT_Animation_Player",
294 text
="Animation", icon
='PLAY')
295 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
296 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
297 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
298 UseSeparator(self
, context
)
299 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
300 layout
.menu("VIEW3D_MT_select_edit_surface", icon
='RESTRICT_SELECT_OFF')
301 layout
.menu("VIEW3D_MT_surface_add", text
="Add Surface",
302 icon
='OUTLINER_OB_SURFACE')
303 UseSeparator(self
, context
)
304 layout
.menu("VIEW3D_MT_Edit_Curve", icon
='CURVE_DATA')
305 layout
.menu("VIEW3D_MT_transform", icon
='EMPTY_ARROWS')
306 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
307 layout
.menu("VIEW3D_MT_edit_curve_ctrlpoints",
308 icon
='CURVE_BEZCURVE')
309 UseSeparator(self
, context
)
310 layout
.menu("VIEW3D_MT_edit_curve_delete", text
="Delete",
312 UseSeparator(self
, context
)
313 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
316 # Metaball Object Mode #
317 if obj
and obj
.type == 'META' and obj
.mode
in {'OBJECT'}:
319 layout
.operator_context
= 'INVOKE_REGION_WIN'
320 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
321 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
322 layout
.menu("VIEW3D_MT_Animation_Player",
323 text
="Animation", icon
='PLAY')
324 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
325 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
326 UseSeparator(self
, context
)
327 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
328 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
329 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
330 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
331 UseSeparator(self
, context
)
332 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
333 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
334 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
335 UseSeparator(self
, context
)
336 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
337 UseSeparator(self
, context
)
338 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
339 UseSeparator(self
, context
)
340 layout
.operator("object.delete", text
="Delete Object", icon
='X')
341 UseSeparator(self
, context
)
342 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
345 if obj
and obj
.type == 'META' and obj
.mode
in {'EDIT'}:
347 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
348 layout
.menu("VIEW3D_MT_Animation_Player",
349 text
="Animation", icon
='PLAY')
350 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
351 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
352 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
353 UseSeparator(self
, context
)
354 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
355 layout
.menu("VIEW3D_MT_select_edit_metaball", icon
='RESTRICT_SELECT_OFF')
356 layout
.operator_menu_enum("object.metaball_add", "type",
358 icon
='OUTLINER_OB_META')
359 UseSeparator(self
, context
)
360 layout
.menu("VIEW3D_MT_transform", icon
='EMPTY_ARROWS')
361 layout
.menu("VIEW3D_MT_mirror", icon
='MOD_MIRROR')
362 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
363 layout
.operator("mball.duplicate_metaelems", icon
='OUTLINER_DATA_META')
364 layout
.menu("VIEW3D_MT_edit_meta_showhide", icon
='HIDE_OFF')
365 UseSeparator(self
, context
)
366 layout
.operator("mball.delete_metaelems", text
="Delete", icon
='X')
367 UseSeparator(self
, context
)
368 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
370 # Camera Object Mode #
371 if obj
and obj
.type == 'CAMERA' and obj
.mode
in {'OBJECT'}:
373 layout
.operator_context
= 'INVOKE_REGION_WIN'
374 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
375 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
376 layout
.menu("VIEW3D_MT_Animation_Player",
377 text
="Animation", icon
='PLAY')
378 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
379 UseSeparator(self
, context
)
380 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
381 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
382 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
383 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
384 UseSeparator(self
, context
)
385 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
386 layout
.menu("VIEW3D_MT_TransformMenuCamera", icon
='EMPTY_ARROWS')
387 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
388 UseSeparator(self
, context
)
389 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
390 UseSeparator(self
, context
)
391 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
392 UseSeparator(self
, context
)
393 layout
.operator("object.delete", text
="Delete Object", icon
='X')
394 UseSeparator(self
, context
)
395 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
398 if obj
and obj
.type == 'LIGHT' and obj
.mode
in {'OBJECT'}:
400 layout
.operator_context
= 'INVOKE_REGION_WIN'
401 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
402 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
403 layout
.menu("VIEW3D_MT_Animation_Player",
404 text
="Animation", icon
='PLAY')
405 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
406 UseSeparator(self
, context
)
407 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
408 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
409 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
410 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
411 UseSeparator(self
, context
)
412 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
413 layout
.menu("VIEW3D_MT_TransformMenuLite", icon
='EMPTY_ARROWS')
414 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
415 UseSeparator(self
, context
)
416 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
417 UseSeparator(self
, context
)
418 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
419 UseSeparator(self
, context
)
420 layout
.operator("object.delete", text
="Delete Object", icon
='X')
421 UseSeparator(self
, context
)
422 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
424 # Armature Object Mode #
425 if obj
and obj
.type == 'ARMATURE' and obj
.mode
in {'OBJECT'}:
427 layout
.operator_context
= 'INVOKE_REGION_WIN'
428 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
429 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
430 layout
.menu("VIEW3D_MT_Animation_Player",
431 text
="Animation", icon
='PLAY')
432 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
433 layout
.menu("VIEW3D_MT_Object_Interactive_Armature", icon
='VIEW3D')
434 UseSeparator(self
, context
)
435 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
436 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
437 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
438 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
439 UseSeparator(self
, context
)
440 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
441 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
442 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
443 UseSeparator(self
, context
)
444 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
445 UseSeparator(self
, context
)
446 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
447 UseSeparator(self
, context
)
448 layout
.operator("object.delete", text
="Delete Object", icon
='X')
449 UseSeparator(self
, context
)
450 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
453 if obj
and obj
.type == 'ARMATURE' and obj
.mode
in {'EDIT'}:
455 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
456 layout
.menu("VIEW3D_MT_Animation_Player",
457 text
="Animation", icon
='PLAY')
458 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
459 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
460 layout
.menu("VIEW3D_MT_Object_Interactive_Armature", icon
='VIEW3D')
461 UseSeparator(self
, context
)
462 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
463 layout
.menu("VIEW3D_MT_select_edit_armature",
464 icon
='RESTRICT_SELECT_OFF')
465 UseSeparator(self
, context
)
466 layout
.menu("VIEW3D_MT_armature_add", text
="Add Armature",
467 icon
='ARMATURE_DATA')
468 layout
.menu("VIEW3D_MT_Edit_Armature", text
="Armature",
469 icon
='OUTLINER_DATA_ARMATURE')
470 layout
.menu("VIEW3D_MT_EditArmatureTK",
471 icon
='ARMATURE_DATA')
472 UseSeparator(self
, context
)
473 layout
.menu("VIEW3D_MT_transform_armature", icon
='EMPTY_ARROWS')
474 layout
.menu("VIEW3D_MT_mirror", icon
='MOD_MIRROR')
475 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
476 layout
.menu("VIEW3D_MT_object_parent")
477 layout
.menu("VIEW3D_MT_edit_armature_roll",
479 UseSeparator(self
, context
)
480 layout
.operator("armature.delete", text
="Delete Object",
482 UseSeparator(self
, context
)
483 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
486 if obj
and obj
.type == 'ARMATURE' and obj
.mode
in {'POSE'}:
488 arm
= context
.active_object
.data
490 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
491 layout
.menu("VIEW3D_MT_Animation_Player",
492 text
="Animation", icon
='PLAY')
493 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
494 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
495 layout
.menu("VIEW3D_MT_Object_Interactive_Armature", icon
='VIEW3D')
496 UseSeparator(self
, context
)
497 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
498 layout
.menu("VIEW3D_MT_select_pose", icon
='RESTRICT_SELECT_OFF')
499 UseSeparator(self
, context
)
500 layout
.menu("VIEW3D_MT_Pose", icon
='ARMATURE_DATA')
501 layout
.menu("VIEW3D_MT_transform_armature", icon
='EMPTY_ARROWS')
502 layout
.menu("VIEW3D_MT_pose_transform", icon
='EMPTY_DATA')
503 UseSeparator(self
, context
)
504 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
505 layout
.menu("VIEW3D_MT_PoseCopy", icon
='FILE')
507 if arm
.display_type
in {'BBONE', 'ENVELOPE'}:
508 layout
.operator("transform.transform",
509 text
="Scale Envelope Distance").mode
= 'BONE_SIZE'
511 layout
.menu("VIEW3D_MT_pose_apply", icon
='AUTO')
512 layout
.operator("pose.relax", icon
='ARMATURE_DATA')
513 layout
.menu("VIEW3D_MT_pose_group", icon
='GROUP_BONE')
514 UseSeparator(self
, context
)
515 layout
.operator_menu_enum("pose.constraint_add",
516 "type", text
="Add Constraint", icon
='CONSTRAINT_BONE')
517 UseSeparator(self
, context
)
518 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
520 # Lattice Object Mode #
521 if obj
and obj
.type == 'LATTICE' and obj
.mode
in {'OBJECT'}:
523 layout
.operator_context
= 'INVOKE_REGION_WIN'
524 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
525 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
526 layout
.menu("VIEW3D_MT_Animation_Player",
527 text
="Animation", icon
='PLAY')
528 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
529 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
530 UseSeparator(self
, context
)
531 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
532 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
533 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
534 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
535 UseSeparator(self
, context
)
536 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
537 layout
.menu("VIEW3D_MT_TransformMenuLite", icon
='EMPTY_ARROWS')
538 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
539 UseSeparator(self
, context
)
540 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
541 UseSeparator(self
, context
)
542 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
543 UseSeparator(self
, context
)
544 layout
.operator("object.delete", text
="Delete Object", icon
='X')
545 UseSeparator(self
, context
)
546 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
549 if obj
and obj
.type == 'LATTICE' and obj
.mode
in {'EDIT'}:
551 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
552 layout
.menu("VIEW3D_MT_Animation_Player",
553 text
="Animation", icon
='PLAY')
554 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
555 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
556 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
557 UseSeparator(self
, context
)
558 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
559 layout
.menu("VIEW3D_MT_select_edit_lattice",
560 icon
='RESTRICT_SELECT_OFF')
561 UseSeparator(self
, context
)
562 layout
.menu("VIEW3D_MT_TransformMenuLite", icon
='EMPTY_ARROWS')
563 layout
.menu("VIEW3D_MT_mirror", icon
='MOD_MIRROR')
564 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
565 UseSeparator(self
, context
)
566 layout
.operator("lattice.make_regular")
567 UseSeparator(self
, context
)
568 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
570 # Empty Object Mode #
571 if obj
and obj
.type == 'EMPTY' and obj
.mode
in {'OBJECT'}:
573 layout
.operator_context
= 'INVOKE_REGION_WIN'
574 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
575 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
576 layout
.menu("VIEW3D_MT_Animation_Player",
577 text
="Animation", icon
='PLAY')
578 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
579 UseSeparator(self
, context
)
580 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
581 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
582 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
583 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
584 UseSeparator(self
, context
)
585 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
586 layout
.menu("VIEW3D_MT_TransformMenuLite", icon
='EMPTY_ARROWS')
587 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
588 UseSeparator(self
, context
)
589 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
590 UseSeparator(self
, context
)
591 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
592 UseSeparator(self
, context
)
593 layout
.operator("object.delete", text
="Delete Object", icon
='X')
594 UseSeparator(self
, context
)
595 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
597 # Speaker Object Mode #
598 if obj
and obj
.type == 'SPEAKER' and obj
.mode
in {'OBJECT'}:
600 layout
.operator_context
= 'INVOKE_REGION_WIN'
601 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
602 layout
.menu("VIEW3D_MT_Animation_Player",
603 text
="Animation", icon
='PLAY')
604 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
605 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
606 UseSeparator(self
, context
)
607 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
608 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
609 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
610 UseSeparator(self
, context
)
611 layout
.menu("VIEW3D_MT_Object", icon
='VIEW3D')
612 layout
.menu("VIEW3D_MT_TransformMenuLite", icon
='EMPTY_ARROWS')
613 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
614 UseSeparator(self
, context
)
615 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
616 UseSeparator(self
, context
)
617 layout
.operator("object.delete", text
="Delete Object", icon
='X')
618 UseSeparator(self
, context
)
619 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
622 if obj
and context
.mode
== 'PARTICLE':
624 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
625 layout
.menu("VIEW3D_MT_Animation_Player",
626 text
="Animation", icon
='PLAY')
627 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
628 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
629 layout
.menu("VIEW3D_MT_InteractiveMode", icon
='VIEW3D')
630 UseSeparator(self
, context
)
631 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
632 layout
.menu("VIEW3D_MT_select_particle",
633 text
="Select", icon
='PARTICLE_PATH')
634 UseSeparator(self
, context
)
635 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
636 layout
.menu("VIEW3D_MT_mirror", icon
='MOD_MIRROR')
637 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
638 UseSeparator(self
, context
)
639 # layout.prop_menu_enum(settings, "proportional_edit",
641 layout
.prop_menu_enum(settings
, "proportional_edit_falloff",
643 UseSeparator(self
, context
)
644 layout
.menu("VIEW3D_MT_particle", icon
='PARTICLEMODE')
645 layout
.menu("VIEW3D_MT_particle_context_menu", text
="Hair Specials", icon
='HAIR')
646 UseSeparator(self
, context
)
647 layout
.operator("object.delete", text
="Delete Object", icon
='X')
648 UseSeparator(self
, context
)
649 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
651 # Grease Pencil Object Mode #
652 if obj
and obj
.type == 'GPENCIL' and obj
.mode
in {'OBJECT'}:
654 layout
.operator_context
= 'INVOKE_REGION_WIN'
655 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
656 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
657 layout
.menu("VIEW3D_MT_Animation_Player",
658 text
="Animation", icon
='PLAY')
659 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
660 layout
.menu("VIEW3D_MT_interactive_mode_gpencil", icon
='EDITMODE_HLT')
661 UseSeparator(self
, context
)
662 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
663 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
664 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
665 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
666 UseSeparator(self
, context
)
667 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
668 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
669 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
670 UseSeparator(self
, context
)
671 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
672 UseSeparator(self
, context
)
673 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
674 UseSeparator(self
, context
)
675 layout
.operator("object.delete", text
="Delete Object", icon
='X')
676 UseSeparator(self
, context
)
677 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
679 # Grease Pencil Edit Mode #
680 if obj
and obj
.type == 'GPENCIL' and obj
.mode
in {'EDIT_GPENCIL'}:
681 layout
.operator_context
= 'INVOKE_REGION_WIN'
683 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
684 layout
.menu("VIEW3D_MT_Animation_Player",
685 text
="Animation", icon
='PLAY')
686 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
687 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
688 UseSeparator(self
, context
)
689 layout
.menu("VIEW3D_MT_interactive_mode_gpencil", icon
='EDITMODE_HLT')
690 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
691 layout
.menu("VIEW3D_MT_select_gpencil", icon
='RESTRICT_SELECT_OFF')
692 layout
.menu("VIEW3D_MT_edit_gpencil", icon
='GREASEPENCIL')
693 UseSeparator(self
, context
)
694 layout
.operator("view3d.snap_cursor_to_center",
695 text
="Cursor to World Origin", icon
='CURSOR')
696 layout
.operator("view3d.snap_cursor_to_grid",
697 text
="Cursor to Grid", icon
='SNAP_GRID')
698 UseSeparator(self
, context
)
699 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
701 # Grease Pencil Sculpt Mode #
702 if obj
and obj
.type == 'GPENCIL' and obj
.mode
in {'SCULPT_GPENCIL'}:
703 layout
.operator_context
= 'INVOKE_REGION_WIN'
705 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
706 layout
.menu("VIEW3D_MT_Animation_Player",
707 text
="Animation", icon
='PLAY')
708 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
709 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
710 UseSeparator(self
, context
)
711 layout
.menu("VIEW3D_MT_interactive_mode_gpencil", icon
='EDITMODE_HLT')
712 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
713 UseSeparator(self
, context
)
714 layout
.operator("view3d.snap_cursor_to_center",
715 text
="Cursor to World Origin", icon
='CURSOR')
716 layout
.operator("view3d.snap_cursor_to_grid",
717 text
="Cursor to Grid", icon
='SNAP_GRID')
718 UseSeparator(self
, context
)
719 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
721 # Grease Pencil Paint Mode #
722 if obj
and obj
.type == 'GPENCIL' and obj
.mode
in {'PAINT_GPENCIL'}:
723 layout
.operator_context
= 'INVOKE_REGION_WIN'
725 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
726 layout
.menu("VIEW3D_MT_Animation_Player",
727 text
="Animation", icon
='PLAY')
728 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
729 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
730 UseSeparator(self
, context
)
731 layout
.menu("VIEW3D_MT_interactive_mode_gpencil", icon
='EDITMODE_HLT')
732 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
733 layout
.menu("VIEW3D_MT_paint_gpencil", icon
='RESTRICT_SELECT_OFF')
734 UseSeparator(self
, context
)
735 layout
.operator("view3d.snap_cursor_to_center",
736 text
="Cursor to World Origin", icon
='CURSOR')
737 layout
.operator("view3d.snap_cursor_to_grid",
738 text
="Cursor to Grid", icon
='SNAP_GRID')
739 UseSeparator(self
, context
)
740 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
742 # Grease Pencil Weight Mode #
743 if obj
and obj
.type == 'GPENCIL' and obj
.mode
in {'WEIGHT_GPENCIL'}:
744 layout
.operator_context
= 'INVOKE_REGION_WIN'
746 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
747 layout
.menu("VIEW3D_MT_Animation_Player",
748 text
="Animation", icon
='PLAY')
749 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
750 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
751 UseSeparator(self
, context
)
752 layout
.menu("VIEW3D_MT_interactive_mode_gpencil", icon
='EDITMODE_HLT')
753 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
754 layout
.menu("VIEW3D_MT_weight_gpencil", icon
="GPBRUSH_WEIGHT")
755 UseSeparator(self
, context
)
756 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
759 if obj
and obj
.type == 'LIGHT_PROBE':
760 layout
.operator_context
= 'INVOKE_REGION_WIN'
762 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
763 layout
.menu("VIEW3D_MT_Animation_Player",
764 text
="Animation", icon
='PLAY')
765 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
766 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
767 UseSeparator(self
, context
)
768 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
769 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
770 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
771 UseSeparator(self
, context
)
772 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
773 layout
.menu("VIEW3D_MT_TransformMenuLite", icon
='EMPTY_ARROWS')
774 layout
.menu("VIEW3D_MT_CursorMenuLite", icon
='PIVOT_CURSOR')
775 UseSeparator(self
, context
)
776 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
777 UseSeparator(self
, context
)
778 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
779 UseSeparator(self
, context
)
780 layout
.prop(view
, "show_region_toolbar", icon
='MENU_PANEL')
781 layout
.prop(view
, "show_region_ui", icon
='MENU_PANEL')
784 if obj
and obj
.type == 'FONT' and obj
.mode
in {'OBJECT'}:
786 layout
.operator_context
= 'INVOKE_REGION_WIN'
787 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
788 layout
.operator("wm.toolbar", text
="Tools", icon
='TOOL_SETTINGS')
789 layout
.menu("VIEW3D_MT_Animation_Player",
790 text
="Animation", icon
='PLAY')
791 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
792 layout
.menu("VIEW3D_MT_Object_Interactive_Other", icon
='OBJECT_DATA')
793 UseSeparator(self
, context
)
794 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
795 layout
.menu("VIEW3D_MT_select_object", icon
='RESTRICT_SELECT_OFF')
796 layout
.menu("VIEW3D_MT_add", icon
='MESH_CUBE')
797 layout
.menu("VIEW3D_MT_Camera_Options", icon
='CAMERA_DATA')
798 UseSeparator(self
, context
)
799 layout
.menu("VIEW3D_MT_Object", icon
='OBJECT_DATAMODE')
800 layout
.menu("VIEW3D_MT_TransformMenu", icon
='EMPTY_ARROWS')
801 layout
.menu("VIEW3D_MT_CursorMenu", icon
='PIVOT_CURSOR')
802 UseSeparator(self
, context
)
803 layout
.menu("VIEW3D_MT_object_collection", text
= "Collections", icon
='GROUP')
804 UseSeparator(self
, context
)
805 layout
.operator_menu_enum("object.modifier_add", "type", icon
='MODIFIER')
806 UseSeparator(self
, context
)
807 layout
.operator("object.delete", text
="Delete Object", icon
='X')
808 UseSeparator(self
, context
)
809 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
813 def menu_func(self
, context
):
816 layout
.menu("VIEW3D_MT_View_Menu", icon
='ZOOM_ALL')
817 layout
.menu("VIEW3D_MT_select_edit_text", icon
='VIEW3D')
819 layout
.operator_context
= 'INVOKE_REGION_WIN'
820 layout
.operator("wm.search_menu", text
="Search", icon
='VIEWZOOM')
821 layout
.menu("VIEW3D_MT_Animation_Player",
822 text
="Animation", icon
='PLAY')
823 layout
.menu("SCREEN_MT_user_menu", text
="Quick Favorites", icon
='HEART')
824 layout
.operator("object.editmode_toggle", text
="Enter Object Mode",
827 layout
.menu("VIEW3D_MT_UndoS", icon
='ARROW_LEFTRIGHT')
830 # Preferences utility functions
833 def UseSeparator(operator
, context
):
834 useSep
= bpy
.context
.preferences
.addons
[__name__
].preferences
.use_separators
836 operator
.layout
.separator()
839 # Use compact brushes menus #
840 def UseBrushesLists():
841 # separate function just for more convenience
842 useLists
= bpy
.context
.preferences
.addons
[__name__
].preferences
.use_brushes_lists
844 return bool(useLists
)
847 # Addon Preferences #
848 class VIEW3D_MT_Space_Dynamic_Menu_Pref(AddonPreferences
):
851 use_separators
: BoolProperty(
852 name
="Use Separators in the menus",
854 description
=("Use separators in the menus, a trade-off between \n"
855 "readability vs. using more space for displaying items")
857 use_brushes_lists
: BoolProperty(
858 name
="Use compact menus for brushes",
860 description
=("Use more compact menus instead \n"
861 "of thumbnails for displaying brushes")
864 def draw(self
, context
):
866 row
= layout
.row(align
=True)
867 row
.prop(self
, "use_separators", toggle
=True)
868 row
.prop(self
, "use_brushes_lists", toggle
=True)
874 VIEW3D_MT_Space_Dynamic_Menu
,
875 VIEW3D_MT_Space_Dynamic_Menu_Pref
879 # Register Classes & Hotkeys #
881 from bpy
.utils
import register_class
883 bpy
.utils
.register_class(cls
)
885 bpy
.types
.VIEW3D_MT_edit_font_context_menu
.append(menu_func
)
887 object_menus
.register()
889 transform_menus
.register()
890 view_menus
.register()
891 armature_menus
.register()
892 curve_menus
.register()
893 snap_origin_cursor
.register()
894 animation_menus
.register()
897 wm
= bpy
.context
.window_manager
898 kc
= wm
.keyconfigs
.addon
900 km
= kc
.keymaps
.new(name
='3D View', space_type
='VIEW_3D')
901 kmi
= km
.keymap_items
.new('wm.call_menu', 'SPACE', 'PRESS')
902 kmi
.properties
.name
= "VIEW3D_MT_Space_Dynamic_Menu"
905 # Unregister Classes & Hotkeys #
907 wm
= bpy
.context
.window_manager
908 kc
= wm
.keyconfigs
.addon
910 km
= kc
.keymaps
['3D View']
911 for kmi
in km
.keymap_items
:
912 if kmi
.idname
== 'wm.call_menu':
913 if kmi
.properties
.name
== "VIEW3D_MT_Space_Dynamic_Menu":
914 km
.keymap_items
.remove(kmi
)
917 object_menus
.unregister()
918 edit_mesh
.unregister()
919 transform_menus
.unregister()
920 view_menus
.unregister()
921 armature_menus
.unregister()
922 curve_menus
.unregister()
923 snap_origin_cursor
.unregister()
924 animation_menus
.unregister()
927 for cls
in reversed(classes
):
928 bpy
.utils
.unregister_class(cls
)
930 bpy
.types
.VIEW3D_MT_edit_font_context_menu
.remove(menu_func
)
932 if __name__
== "__main__":