1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
21 from bpy.types import Header, Menu, Panel
22 from .properties_paint_common import UnifiedPaintPanel
23 from .properties_grease_pencil_common import AnnotationDataPanel
24 from bpy.app.translations import contexts as i18n_contexts
27 class VIEW3D_HT_header(Header):
28 bl_space_type = 'VIEW_3D'
30 def draw(self, context):
33 view = context.space_data
34 shading = view.shading
35 # mode_string = context.mode
36 obj = context.active_object
37 overlay = view.overlay
38 tool_settings = context.tool_settings
40 row = layout.row(align=True)
43 object_mode = 'OBJECT' if obj is None else obj.mode
45 act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode]
51 sub.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
54 layout.template_header_3D_mode()
56 # Contains buttons like Mode, Pivot, Layer, Mesh Select Mode...
59 if object_mode == 'PARTICLE_EDIT':
61 row.prop(tool_settings.particle_edit, "select_mode", text="", expand=True)
64 if obj and obj.type == 'GPENCIL' and context.gpencil_data:
65 gpd = context.gpencil_data
67 if gpd.is_stroke_paint_mode:
69 sub = row.row(align=True)
70 sub.prop(tool_settings, "use_gpencil_draw_onback", text="", icon='MOD_OPACITY')
71 sub.separator(factor=0.4)
72 sub.prop(tool_settings, "use_gpencil_weight_data_add", text="", icon='WPAINT_HLT')
73 sub.separator(factor=0.4)
74 sub.prop(tool_settings, "use_gpencil_draw_additive", text="", icon='FREEZE')
76 if gpd.use_stroke_edit_mode:
77 row = layout.row(align=True)
78 row.prop(tool_settings, "gpencil_selectmode", text="", expand=True)
80 if gpd.use_stroke_edit_mode or gpd.is_stroke_sculpt_mode or gpd.is_stroke_weight_mode:
81 row = layout.row(align=True)
83 if gpd.is_stroke_sculpt_mode:
84 row.prop(tool_settings.gpencil_sculpt, "use_select_mask", text="")
87 row.prop(gpd, "use_multiedit", text="", icon='GP_MULTIFRAME_EDITING')
89 sub = row.row(align=True)
90 sub.active = gpd.use_multiedit
92 panel="VIEW3D_PT_gpencil_multi_frame",
96 if gpd.use_stroke_edit_mode:
97 row = layout.row(align=True)
98 row.prop(tool_settings.gpencil_sculpt, "use_select_mask", text="")
101 panel="VIEW3D_PT_tools_grease_pencil_interpolate",
105 VIEW3D_MT_editor_menus.draw_collapsible(context, layout)
107 layout.separator_spacer()
109 # Mode & Transform Settings
110 scene = context.scene
113 if object_mode in {'OBJECT', 'EDIT', 'POSE', 'GPENCIL_EDIT'}:
114 orientation = scene.transform_orientation
115 current_orientation = scene.current_orientation
117 if not current_orientation:
118 trans_orientation = bpy.types.Scene.bl_rna.properties["transform_orientation"].enum_items[orientation]
119 trans_icon = getattr(trans_orientation, "icon", "BLANK1")
120 trans_name = getattr(trans_orientation, "name", "Orientation")
122 trans_icon = 'OBJECT_ORIGIN'
123 trans_name = getattr(current_orientation, "name", "Orientation")
125 row = layout.row(align=True)
130 panel="VIEW3D_PT_transform_orientations",
140 if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT',
141 'GPENCIL_PAINT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}:
145 from .properties_paint_common import UnifiedPaintPanel
146 paint_settings = UnifiedPaintPanel.paint_settings(context)
149 brush = paint_settings.brush
150 if brush and brush.stroke_method == 'CURVE':
154 snap_items = bpy.types.ToolSettings.bl_rna.properties['snap_elements'].enum_items
155 snap_elements = tool_settings.snap_elements
156 if len(snap_elements) == 1:
158 for elem in snap_elements:
159 icon = snap_items[elem].icon
164 del snap_items, snap_elements
166 row = layout.row(align=True)
167 row.prop(tool_settings, "use_snap", text="")
169 sub = row.row(align=True)
171 panel="VIEW3D_PT_snapping",
176 # Proportional editing
178 gpd = context.gpencil_data
179 if gpd is not None and obj.type == 'GPENCIL':
180 if gpd.use_stroke_edit_mode or gpd.is_stroke_sculpt_mode:
181 row = layout.row(align=True)
182 row.prop(tool_settings, "proportional_edit", icon_only=True)
184 sub = row.row(align=True)
185 sub.active = tool_settings.proportional_edit != 'DISABLED'
186 sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
188 elif object_mode in {'EDIT', 'PARTICLE_EDIT'}:
189 row = layout.row(align=True)
190 row.prop(tool_settings, "proportional_edit", icon_only=True)
191 sub = row.row(align=True)
192 sub.active = tool_settings.proportional_edit != 'DISABLED'
193 sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
195 elif object_mode == 'OBJECT':
196 row = layout.row(align=True)
197 row.prop(tool_settings, "use_proportional_edit_objects", icon_only=True)
198 sub = row.row(align=True)
199 sub.active = tool_settings.use_proportional_edit_objects
200 sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
202 if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode:
203 row = layout.row(align=True)
204 row.prop(tool_settings, "proportional_edit", icon_only=True)
205 sub = row.row(align=True)
206 sub.active = tool_settings.proportional_edit != 'DISABLED'
207 sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
210 if object_mode in {'OBJECT', 'EDIT', 'POSE', 'GPENCIL_EDIT', 'GPENCIL_SCULPT'}:
211 pivot_point = tool_settings.transform_pivot_point
212 act_pivot_point = bpy.types.ToolSettings.bl_rna.properties["transform_pivot_point"].enum_items[pivot_point]
213 row = layout.row(align=True)
215 panel="VIEW3D_PT_pivot_point",
216 icon=act_pivot_point.icon,
220 if object_mode == 'GPENCIL_PAINT':
221 origin = tool_settings.gpencil_stroke_placement_view3d
222 gp_origin = tool_settings.bl_rna.properties['gpencil_stroke_placement_view3d'].enum_items[origin]
224 or_icon = getattr(gp_origin, "icon", "BLANK1")
225 or_name = getattr(gp_origin, "name", "Stroke Placement")
227 panel="VIEW3D_PT_gpencil_origin",
232 if object_mode in {'GPENCIL_PAINT', 'GPENCIL_SCULPT'}:
233 lock = tool_settings.gpencil_sculpt.lock_axis
234 gp_lock = tool_settings.gpencil_sculpt.bl_rna.properties["lock_axis"].enum_items[lock]
236 lk_icon = getattr(gp_lock, "icon", "BLANK1")
237 lk_name = getattr(gp_lock, "name", "None")
239 row.enabled = tool_settings.gpencil_stroke_placement_view3d in {'ORIGIN', 'CURSOR'}
241 panel="VIEW3D_PT_gpencil_lock",
246 layout.separator_spacer()
248 # Collection Visibility
250 panel="VIEW3D_PT_collections",
257 panel="VIEW3D_PT_object_type_visibility",
258 icon_value=view.icon_from_show_object_viewport,
262 row = layout.row(align=True)
263 row.prop(overlay, "show_overlays", icon='OVERLAY', text="")
264 sub = row.row(align=True)
265 sub.active = overlay.show_overlays
266 sub.popover(panel="VIEW3D_PT_overlay")
269 row.active = (shading.type in {'WIREFRAME', 'SOLID'}) or object_mode in {'EDIT'}
271 if shading.type == 'WIREFRAME':
272 row.prop(shading, "show_xray_wireframe", text="", icon='XRAY')
274 row.prop(shading, "show_xray", text="", icon='XRAY')
276 row = layout.row(align=True)
277 row.prop(shading, "type", text="", expand=True)
278 sub = row.row(align=True)
279 sub.enabled = shading.type != 'RENDERED'
280 sub.popover(panel="VIEW3D_PT_shading")
283 class VIEW3D_MT_editor_menus(Menu):
284 bl_space_type = 'VIEW3D_MT_editor_menus'
287 def draw(self, context):
288 self.draw_menus(self.layout, context)
291 def draw_menus(layout, context):
292 obj = context.active_object
293 mode_string = context.mode
294 edit_object = context.edit_object
295 gp_edit = obj and obj.mode in {'GPENCIL_EDIT', 'GPENCIL_PAINT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}
297 layout.menu("VIEW3D_MT_view")
301 if mode_string not in {'GPENCIL_PAINT', 'GPENCIL_WEIGHT'}:
302 layout.menu("VIEW3D_MT_select_gpencil")
303 elif mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
305 if mesh.use_paint_mask:
306 layout.menu("VIEW3D_MT_select_paint_mask")
307 elif mesh.use_paint_mask_vertex and mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX'}:
308 layout.menu("VIEW3D_MT_select_paint_mask_vertex")
309 elif mode_string != 'SCULPT':
310 layout.menu("VIEW3D_MT_select_%s" % mode_string.lower())
314 elif mode_string == 'OBJECT':
315 layout.menu("VIEW3D_MT_add", text="Add")
316 elif mode_string == 'EDIT_MESH':
317 layout.menu("VIEW3D_MT_mesh_add", text="Add")
318 elif mode_string == 'EDIT_CURVE':
319 layout.menu("VIEW3D_MT_curve_add", text="Add")
320 elif mode_string == 'EDIT_SURFACE':
321 layout.menu("VIEW3D_MT_surface_add", text="Add")
322 elif mode_string == 'EDIT_METABALL':
323 layout.menu("VIEW3D_MT_metaball_add", text="Add")
324 elif mode_string == 'EDIT_ARMATURE':
325 layout.menu("TOPBAR_MT_edit_armature_add", text="Add")
328 if obj and obj.mode == 'GPENCIL_PAINT':
329 layout.menu("VIEW3D_MT_paint_gpencil")
330 elif obj and obj.mode == 'GPENCIL_EDIT':
331 layout.menu("VIEW3D_MT_edit_gpencil")
332 elif obj and obj.mode == 'GPENCIL_WEIGHT':
333 layout.menu("VIEW3D_MT_weight_gpencil")
336 layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
338 if mode_string == 'EDIT_MESH':
339 layout.menu("VIEW3D_MT_edit_mesh_vertices")
340 layout.menu("VIEW3D_MT_edit_mesh_edges")
341 layout.menu("VIEW3D_MT_edit_mesh_faces")
342 layout.menu("VIEW3D_MT_uv_map", text="UV")
345 if mode_string != 'PAINT_TEXTURE':
346 layout.menu("VIEW3D_MT_%s" % mode_string.lower())
347 if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
348 layout.menu("VIEW3D_MT_brush")
349 if mode_string == 'SCULPT':
350 layout.menu("VIEW3D_MT_hide_mask")
352 layout.menu("VIEW3D_MT_object")
355 # ********** Menu **********
358 # ********** Utilities **********
362 bl_label = "Show/Hide"
365 def draw(self, context):
368 layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
369 layout.operator("%s.hide" % self._operator_name, text="Hide Selected").unselected = False
370 layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
373 # Standard transforms which apply to all cases
374 # NOTE: this doesn't seem to be able to be used directly
375 class VIEW3D_MT_transform_base(Menu):
376 bl_label = "Transform"
379 # TODO: get rid of the custom text strings?
380 def draw(self, context):
383 layout.operator("transform.tosphere", text="To Sphere")
384 layout.operator("transform.shear", text="Shear")
385 layout.operator("transform.bend", text="Bend")
386 layout.operator("transform.push_pull", text="Push/Pull")
388 if context.mode != 'OBJECT':
389 layout.operator("transform.vertex_warp", text="Warp")
390 layout.operator("transform.vertex_random", text="Randomize")
393 # Generic transform menu - geometry types
394 class VIEW3D_MT_transform(VIEW3D_MT_transform_base):
395 def draw(self, context):
397 VIEW3D_MT_transform_base.draw(self, context)
401 layout.operator("transform.shrink_fatten", text="Shrink Fatten")
405 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
406 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
409 # Object-specific extensions to Transform menu
410 class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
411 def draw(self, context):
415 VIEW3D_MT_transform_base.draw(self, context)
417 # object-specific option follow...
420 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
421 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
425 layout.operator_context = 'EXEC_REGION_WIN'
426 # XXX see alignmenu() in edit.c of b2.4x to get this working
427 layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN'
431 layout.operator("object.randomize_transform")
432 layout.operator("object.align")
434 # TODO: there is a strange context bug here.
436 layout.operator_context = 'INVOKE_REGION_WIN'
437 layout.operator("object.transform_axis_target")
441 class VIEW3D_MT_transform_origin(Menu):
444 def draw(self, context):
448 layout.operator_context = 'EXEC_AREA'
450 layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
451 layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
452 layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
453 layout.operator("object.origin_set", text="Origin to Center of Mass (Surface)").type = 'ORIGIN_CENTER_OF_MASS'
454 layout.operator("object.origin_set", text="Origin to Center of Mass (Volume)").type = 'ORIGIN_CENTER_OF_VOLUME'
457 # Armature EditMode extensions to Transform menu
458 class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
459 def draw(self, context):
463 VIEW3D_MT_transform_base.draw(self, context)
465 # armature specific extensions follow...
467 if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}:
468 if obj.data.display_type == 'BBONE':
471 layout.operator("transform.transform", text="Scale BBone").mode = 'BONE_SIZE'
472 elif obj.data.display_type == 'ENVELOPE':
475 layout.operator("transform.transform", text="Scale Envelope Distance").mode = 'BONE_SIZE'
476 layout.operator("transform.transform", text="Scale Radius").mode = 'BONE_ENVELOPE'
478 if context.edit_object and context.edit_object.type == 'ARMATURE':
481 layout.operator("armature.align")
484 class VIEW3D_MT_mirror(Menu):
487 def draw(self, context):
490 layout.operator("transform.mirror", text="Interactive Mirror")
494 layout.operator_context = 'INVOKE_REGION_WIN'
496 props = layout.operator("transform.mirror", text="X Global")
497 props.constraint_axis = (True, False, False)
498 props.constraint_orientation = 'GLOBAL'
499 props = layout.operator("transform.mirror", text="Y Global")
500 props.constraint_axis = (False, True, False)
501 props.constraint_orientation = 'GLOBAL'
502 props = layout.operator("transform.mirror", text="Z Global")
503 props.constraint_axis = (False, False, True)
504 props.constraint_orientation = 'GLOBAL'
506 if context.edit_object:
509 props = layout.operator("transform.mirror", text="X Local")
510 props.constraint_axis = (True, False, False)
511 props.constraint_orientation = 'LOCAL'
512 props = layout.operator("transform.mirror", text="Y Local")
513 props.constraint_axis = (False, True, False)
514 props.constraint_orientation = 'LOCAL'
515 props = layout.operator("transform.mirror", text="Z Local")
516 props.constraint_axis = (False, False, True)
517 props.constraint_orientation = 'LOCAL'
519 layout.operator("object.vertex_group_mirror")
522 class VIEW3D_MT_snap(Menu):
525 def draw(self, context):
528 layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
529 layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor").use_offset = False
530 layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor (Keep Offset)").use_offset = True
531 layout.operator("view3d.snap_selected_to_active", text="Selection to Active")
535 layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
536 layout.operator("view3d.snap_cursor_to_center", text="Cursor to World Origin")
537 layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
538 layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
541 class VIEW3D_MT_uv_map(Menu):
542 bl_label = "UV Mapping"
544 def draw(self, context):
547 layout.operator("uv.unwrap")
549 layout.operator_context = 'INVOKE_DEFAULT'
550 layout.operator("uv.smart_project")
551 layout.operator("uv.lightmap_pack")
552 layout.operator("uv.follow_active_quads")
556 layout.operator_context = 'EXEC_REGION_WIN'
557 layout.operator("uv.cube_project")
558 layout.operator("uv.cylinder_project")
559 layout.operator("uv.sphere_project")
563 layout.operator_context = 'INVOKE_REGION_WIN'
564 layout.operator("uv.project_from_view").scale_to_bounds = False
565 layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
569 layout.operator("mesh.mark_seam").clear = False
570 layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
574 layout.operator("uv.reset")
577 class VIEW3D_MT_edit_proportional(Menu):
578 bl_label = "Proportional Editing"
580 def draw(self, context):
583 layout.props_enum(tool_settings, "proportional_edit")
587 layout.label(text="Falloff:")
588 layout.props_enum(tool_settings, "proportional_edit_falloff")
591 # ********** View menus **********
594 class VIEW3D_MT_view(Menu):
597 def draw(self, context):
599 view = context.space_data
601 layout.operator("view3d.toolshelf", icon='MENU_PANEL')
602 layout.operator("view3d.properties", icon='MENU_PANEL')
606 layout.operator("view3d.view_selected", text="Frame Selected").use_all_regions = False
607 if view.region_quadviews:
608 layout.operator("view3d.view_selected", text="Frame Selected (Quad View)").use_all_regions = True
610 layout.operator("view3d.view_all", text="Frame All").center = False
611 layout.operator("view3d.view_persportho", text="Perspective/Orthographic")
615 layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
618 layout.menu("VIEW3D_MT_view_viewpoint")
619 layout.menu("VIEW3D_MT_view_navigation")
620 layout.menu("VIEW3D_MT_view_align")
624 layout.operator_context = 'INVOKE_REGION_WIN'
625 layout.menu("VIEW3D_MT_view_borders", text="View Borders")
629 layout.operator("screen.animation_play", text="Play Animation")
633 layout.operator("render.opengl", icon='RENDER_STILL')
634 layout.operator("render.opengl", text="Viewport Render Animation", icon='RENDER_ANIMATION').animation = True
638 layout.menu("INFO_MT_area")
641 class VIEW3D_MT_view_cameras(Menu):
644 def draw(self, context):
647 layout.operator("view3d.object_as_camera")
648 layout.operator("view3d.view_camera", text="Active Camera")
651 class VIEW3D_MT_view_viewpoint(Menu):
652 bl_label = "Viewpoint"
654 def draw(self, context):
657 layout.operator("view3d.view_camera", text="Camera")
661 layout.operator("view3d.view_axis", text="Top").type = 'TOP'
662 layout.operator("view3d.view_axis", text="Bottom").type = 'BOTTOM'
666 layout.operator("view3d.view_axis", text="Front").type = 'FRONT'
667 layout.operator("view3d.view_axis", text="Back").type = 'BACK'
671 layout.operator("view3d.view_axis", text="Right").type = 'RIGHT'
672 layout.operator("view3d.view_axis", text="Left").type = 'LEFT'
675 class VIEW3D_MT_view_navigation(Menu):
676 bl_label = "Navigation"
678 def draw(self, context):
682 layout.operator_enum("view3d.view_orbit", "type")
683 props = layout.operator("view3d.view_orbit", text="Orbit Opposite")
684 props.type = 'ORBITRIGHT'
689 layout.operator("view3d.view_roll", text="Roll Left").type = 'LEFT'
690 layout.operator("view3d.view_roll", text="Roll Right").type = 'RIGHT'
694 layout.operator_enum("view3d.view_pan", "type")
698 layout.operator("view3d.zoom", text="Zoom In").delta = 1
699 layout.operator("view3d.zoom", text="Zoom Out").delta = -1
700 layout.operator("view3d.zoom_border", text="Zoom Border...")
701 layout.operator("view3d.zoom_camera_1_to_1", text="Zoom Camera 1:1")
705 layout.operator("view3d.fly")
706 layout.operator("view3d.walk")
709 class VIEW3D_MT_view_align(Menu):
710 bl_label = "Align View"
712 def draw(self, context):
715 layout.menu("VIEW3D_MT_view_align_selected")
719 layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
720 layout.operator("view3d.camera_to_view_selected", text="Align Active Camera to Selected")
724 layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
725 layout.operator("view3d.view_center_cursor")
729 layout.operator("view3d.view_lock_to_active")
730 layout.operator("view3d.view_lock_clear")
733 class VIEW3D_MT_view_align_selected(Menu):
734 bl_label = "Align View to Active"
736 def draw(self, context):
739 props = layout.operator("view3d.view_axis", text="Top")
740 props.align_active = True
743 props = layout.operator("view3d.view_axis", text="Bottom")
744 props.align_active = True
745 props.type = 'BOTTOM'
749 props = layout.operator("view3d.view_axis", text="Front")
750 props.align_active = True
753 props = layout.operator("view3d.view_axis", text="Back")
754 props.align_active = True
759 props = layout.operator("view3d.view_axis", text="Right")
760 props.align_active = True
763 props = layout.operator("view3d.view_axis", text="Left")
764 props.align_active = True
768 class VIEW3D_MT_view_borders(Menu):
769 bl_label = "View Borders"
771 def draw(self, context):
773 # layout.operator("view3d.clip_border", text="Clipping Border...")
774 layout.operator("view3d.render_border", text="Render Border...")
778 layout.operator("view3d.clear_render_border")
781 # ********** Select menus, suffix from context.mode **********
783 class VIEW3D_MT_select_object_more_less(Menu):
784 bl_label = "Select More/Less"
786 def draw(self, context):
791 layout.operator("object.select_more", text="More")
792 layout.operator("object.select_less", text="Less")
796 props = layout.operator("object.select_hierarchy", text="Parent")
798 props.direction = 'PARENT'
800 props = layout.operator("object.select_hierarchy", text="Child")
802 props.direction = 'CHILD'
806 props = layout.operator("object.select_hierarchy", text="Extend Parent")
808 props.direction = 'PARENT'
810 props = layout.operator("object.select_hierarchy", text="Extend Child")
812 props.direction = 'CHILD'
815 class VIEW3D_MT_select_object(Menu):
818 def draw(self, context):
821 layout.operator("object.select_all", text="All").action = 'SELECT'
822 layout.operator("object.select_all", text="None").action = 'DESELECT'
823 layout.operator("object.select_all", text="Invert").action = 'INVERT'
827 layout.operator("view3d.select_box")
828 layout.operator("view3d.select_circle")
832 layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
833 layout.operator("object.select_camera", text="Select Active Camera")
834 layout.operator("object.select_mirror", text="Mirror Selection")
835 layout.operator("object.select_random", text="Select Random")
839 layout.menu("VIEW3D_MT_select_object_more_less")
843 layout.operator_menu_enum("object.select_grouped", "type", text="Select Grouped")
844 layout.operator_menu_enum("object.select_linked", "type", text="Select Linked")
845 layout.operator("object.select_pattern", text="Select Pattern...")
848 class VIEW3D_MT_select_pose_more_less(Menu):
849 bl_label = "Select More/Less"
851 def draw(self, context):
856 props = layout.operator("pose.select_hierarchy", text="Parent")
858 props.direction = 'PARENT'
860 props = layout.operator("pose.select_hierarchy", text="Child")
862 props.direction = 'CHILD'
866 props = layout.operator("pose.select_hierarchy", text="Extend Parent")
868 props.direction = 'PARENT'
870 props = layout.operator("pose.select_hierarchy", text="Extend Child")
872 props.direction = 'CHILD'
875 class VIEW3D_MT_select_pose(Menu):
878 def draw(self, context):
881 layout.operator("pose.select_all", text="All").action = 'SELECT'
882 layout.operator("pose.select_all", text="None").action = 'DESELECT'
883 layout.operator("pose.select_all", text="Invert").action = 'INVERT'
887 layout.operator("view3d.select_box")
888 layout.operator("view3d.select_circle")
892 layout.operator("pose.select_mirror", text="Flip Active")
896 layout.operator("pose.select_constraint_target", text="Constraint Target")
897 layout.operator("pose.select_linked", text="Linked")
901 layout.menu("VIEW3D_MT_select_pose_more_less")
905 layout.operator_menu_enum("pose.select_grouped", "type", text="Grouped")
906 layout.operator("object.select_pattern", text="Select Pattern...")
909 class VIEW3D_MT_select_particle(Menu):
912 def draw(self, context):
915 layout.operator("particle.select_all", text="All").action = 'SELECT'
916 layout.operator("particle.select_all", text="None").action = 'DESELECT'
917 layout.operator("particle.select_all", text="Invert").action = 'INVERT'
921 layout.operator("view3d.select_box")
922 layout.operator("view3d.select_circle")
926 layout.operator("particle.select_linked")
930 layout.operator("particle.select_more")
931 layout.operator("particle.select_less")
935 layout.operator("particle.select_random")
939 layout.operator("particle.select_roots", text="Roots")
940 layout.operator("particle.select_tips", text="Tips")
943 class VIEW3D_MT_edit_mesh_select_similar(Menu):
944 bl_label = "Select Similar"
946 def draw(self, context):
949 layout.operator_enum("mesh.select_similar", "type")
953 layout.operator("mesh.select_similar_region", text="Face Regions")
956 class VIEW3D_MT_edit_mesh_select_by_trait(Menu):
957 bl_label = "Select All by Trait"
959 def draw(self, context):
961 tool_settings = context.tool_settings
962 if tool_settings.mesh_select_mode[2] is False:
963 layout.operator("mesh.select_non_manifold", text="Non Manifold")
964 layout.operator("mesh.select_loose", text="Loose Geometry")
965 layout.operator("mesh.select_interior_faces", text="Interior Faces")
966 layout.operator("mesh.select_face_by_sides", text="Faces by Sides")
970 layout.operator("mesh.select_ungrouped", text="Ungrouped Verts")
973 class VIEW3D_MT_edit_mesh_select_more_less(Menu):
974 bl_label = "Select More/Less"
976 def draw(self, context):
979 layout.operator("mesh.select_more", text="More")
980 layout.operator("mesh.select_less", text="Less")
984 layout.operator("mesh.select_next_item", text="Next Active")
985 layout.operator("mesh.select_prev_item", text="Previous Active")
988 class VIEW3D_MT_edit_mesh_select_linked(Menu):
989 bl_label = "Select Linked"
991 def draw(self, context):
994 layout.operator("mesh.select_linked", text="Linked")
995 layout.operator("mesh.shortest_path_select", text="Shortest Path")
996 layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
999 class VIEW3D_MT_edit_mesh_select_loops(Menu):
1000 bl_label = "Select Loops"
1002 def draw(self, context):
1003 layout = self.layout
1005 layout.operator("mesh.loop_multi_select", text="Edge Loops").ring = False
1006 layout.operator("mesh.loop_multi_select", text="Edge Rings").ring = True
1010 layout.operator("mesh.loop_to_region")
1011 layout.operator("mesh.region_to_loop")
1014 class VIEW3D_MT_select_edit_mesh(Menu):
1017 def draw(self, context):
1018 layout = self.layout
1021 layout.operator("mesh.select_all", text="All").action = 'SELECT'
1022 layout.operator("mesh.select_all", text="None").action = 'DESELECT'
1023 layout.operator("mesh.select_all", text="Invert").action = 'INVERT'
1027 layout.operator("view3d.select_box")
1028 layout.operator("view3d.select_circle")
1033 layout.operator("mesh.select_random", text="Select Random")
1034 layout.operator("mesh.select_nth")
1039 layout.operator("mesh.edges_select_sharp", text="Select Sharp Edges")
1044 layout.menu("VIEW3D_MT_edit_mesh_select_similar")
1048 layout.menu("VIEW3D_MT_edit_mesh_select_by_trait")
1052 layout.menu("VIEW3D_MT_edit_mesh_select_more_less")
1056 layout.menu("VIEW3D_MT_edit_mesh_select_loops")
1060 layout.menu("VIEW3D_MT_edit_mesh_select_linked")
1064 layout.operator("mesh.select_axis", text="Side of Active")
1065 layout.operator("mesh.select_mirror", text="Mirror Selection")
1068 class VIEW3D_MT_select_edit_curve(Menu):
1071 def draw(self, context):
1072 layout = self.layout
1074 layout.operator("curve.select_all", text="All").action = 'SELECT'
1075 layout.operator("curve.select_all", text="None").action = 'DESELECT'
1076 layout.operator("curve.select_all", text="Invert").action = 'INVERT'
1080 layout.operator("view3d.select_box")
1081 layout.operator("view3d.select_circle")
1085 layout.operator("curve.select_random")
1086 layout.operator("curve.select_nth")
1087 layout.operator("curve.select_linked", text="Select Linked")
1088 layout.operator("curve.select_similar", text="Select Similar")
1092 layout.operator("curve.de_select_first")
1093 layout.operator("curve.de_select_last")
1094 layout.operator("curve.select_next")
1095 layout.operator("curve.select_previous")
1099 layout.operator("curve.select_more")
1100 layout.operator("curve.select_less")
1103 class VIEW3D_MT_select_edit_surface(Menu):
1106 def draw(self, context):
1107 layout = self.layout
1109 layout.operator("curve.select_all", text="All").action = 'SELECT'
1110 layout.operator("curve.select_all", text="None").action = 'DESELECT'
1111 layout.operator("curve.select_all", text="Invert").action = 'INVERT'
1115 layout.operator("view3d.select_box")
1116 layout.operator("view3d.select_circle")
1120 layout.operator("curve.select_random")
1121 layout.operator("curve.select_nth")
1122 layout.operator("curve.select_linked", text="Select Linked")
1123 layout.operator("curve.select_similar", text="Select Similar")
1127 layout.operator("curve.select_row")
1131 layout.operator("curve.select_more")
1132 layout.operator("curve.select_less")
1135 class VIEW3D_MT_select_edit_text(Menu):
1136 # intentional name mismatch
1137 # select menu for 3d-text doesn't make sense
1140 def draw(self, context):
1141 layout = self.layout
1143 layout.operator("font.text_cut", text="Cut")
1144 layout.operator("font.text_copy", text="Copy", icon="COPYDOWN")
1145 layout.operator("font.text_paste", text="Paste", icon="PASTEDOWN")
1149 layout.operator("font.text_paste_from_file")
1153 layout.operator("font.select_all")
1156 class VIEW3D_MT_select_edit_metaball(Menu):
1159 def draw(self, context):
1160 layout = self.layout
1162 layout.operator("mball.select_all", text="All").action = 'SELECT'
1163 layout.operator("mball.select_all", text="None").action = 'DESELECT'
1164 layout.operator("mball.select_all", text="Invert").action = 'INVERT'
1168 layout.operator("view3d.select_box")
1169 layout.operator("view3d.select_circle")
1173 layout.operator("mball.select_random_metaelems")
1177 layout.operator_menu_enum("mball.select_similar", "type", text="Similar")
1180 class VIEW3D_MT_select_edit_lattice(Menu):
1183 def draw(self, context):
1184 layout = self.layout
1186 layout.operator("lattice.select_all", text="All").action = 'SELECT'
1187 layout.operator("lattice.select_all", text="None").action = 'DESELECT'
1188 layout.operator("lattice.select_all", text="Invert").action = 'INVERT'
1192 layout.operator("view3d.select_box")
1193 layout.operator("view3d.select_circle")
1197 layout.operator("lattice.select_mirror")
1198 layout.operator("lattice.select_random")
1202 layout.operator("lattice.select_more")
1203 layout.operator("lattice.select_less")
1207 layout.operator("lattice.select_ungrouped", text="Ungrouped Verts")
1210 class VIEW3D_MT_select_edit_armature(Menu):
1213 def draw(self, context):
1214 layout = self.layout
1216 layout.operator("armature.select_all", text="All").action = 'SELECT'
1217 layout.operator("armature.select_all", text="None").action = 'DESELECT'
1218 layout.operator("armature.select_all", text="Invert").action = 'INVERT'
1222 layout.operator("view3d.select_box")
1223 layout.operator("view3d.select_circle")
1227 layout.operator("armature.select_mirror", text="Mirror").extend = False
1231 layout.operator("armature.select_more", text="More")
1232 layout.operator("armature.select_less", text="Less")
1236 props = layout.operator("armature.select_hierarchy", text="Parent")
1237 props.extend = False
1238 props.direction = 'PARENT'
1240 props = layout.operator("armature.select_hierarchy", text="Child")
1241 props.extend = False
1242 props.direction = 'CHILD'
1246 props = layout.operator("armature.select_hierarchy", text="Extend Parent")
1248 props.direction = 'PARENT'
1250 props = layout.operator("armature.select_hierarchy", text="Extend Child")
1252 props.direction = 'CHILD'
1254 layout.operator_menu_enum("armature.select_similar", "type", text="Similar")
1255 layout.operator("object.select_pattern", text="Select Pattern...")
1258 class VIEW3D_MT_select_gpencil(Menu):
1261 def draw(self, context):
1262 layout = self.layout
1264 layout.operator("gpencil.select_all", text="All").action = 'SELECT'
1265 layout.operator("gpencil.select_all", text="None").action = 'DESELECT'
1266 layout.operator("gpencil.select_all", text="Invert").action = 'INVERT'
1270 layout.operator("gpencil.select_box")
1271 layout.operator("gpencil.select_circle")
1275 layout.operator("gpencil.select_linked", text="Linked")
1276 layout.operator("gpencil.select_alternate")
1277 layout.operator_menu_enum("gpencil.select_grouped", "type", text="Grouped")
1281 layout.operator("gpencil.select_first")
1282 layout.operator("gpencil.select_last")
1286 layout.operator("gpencil.select_more")
1287 layout.operator("gpencil.select_less")
1290 class VIEW3D_MT_select_paint_mask(Menu):
1293 def draw(self, context):
1294 layout = self.layout
1296 layout.operator("paint.face_select_all", text="All").action = 'SELECT'
1297 layout.operator("paint.face_select_all", text="None").action = 'DESELECT'
1298 layout.operator("paint.face_select_all", text="Invert").action = 'INVERT'
1302 layout.operator("view3d.select_box")
1303 layout.operator("view3d.select_circle")
1307 layout.operator("paint.face_select_linked", text="Linked")
1310 class VIEW3D_MT_select_paint_mask_vertex(Menu):
1313 def draw(self, context):
1314 layout = self.layout
1316 layout.operator("paint.vert_select_all", text="All").action = 'SELECT'
1317 layout.operator("paint.vert_select_all", text="None").action = 'DESELECT'
1318 layout.operator("paint.vert_select_all", text="Invert").action = 'INVERT'
1322 layout.operator("view3d.select_box")
1323 layout.operator("view3d.select_circle")
1327 layout.operator("paint.vert_select_ungrouped", text="Ungrouped Verts")
1330 class VIEW3D_MT_angle_control(Menu):
1331 bl_label = "Angle Control"
1334 def poll(cls, context):
1335 settings = UnifiedPaintPanel.paint_settings(context)
1339 brush = settings.brush
1340 tex_slot = brush.texture_slot
1342 return tex_slot.has_texture_angle and tex_slot.has_texture_angle_source
1344 def draw(self, context):
1345 layout = self.layout
1347 settings = UnifiedPaintPanel.paint_settings(context)
1348 brush = settings.brush
1350 sculpt = (context.sculpt_object is not None)
1352 tex_slot = brush.texture_slot
1354 layout.prop(tex_slot, "use_rake", text="Rake")
1356 if brush.brush_capabilities.has_random_texture_angle and tex_slot.has_random_texture_angle:
1358 if brush.sculpt_capabilities.has_random_texture_angle:
1359 layout.prop(tex_slot, "use_random", text="Random")
1361 layout.prop(tex_slot, "use_random", text="Random")
1364 class VIEW3D_MT_mesh_add(Menu):
1365 bl_idname = "VIEW3D_MT_mesh_add"
1368 def draw(self, context):
1369 layout = self.layout
1371 layout.operator_context = 'INVOKE_REGION_WIN'
1373 layout.operator("mesh.primitive_plane_add", text="Plane", icon='MESH_PLANE')
1374 layout.operator("mesh.primitive_cube_add", text="Cube", icon='MESH_CUBE')
1375 layout.operator("mesh.primitive_circle_add", text="Circle", icon='MESH_CIRCLE')
1376 layout.operator("mesh.primitive_uv_sphere_add", text="UV Sphere", icon='MESH_UVSPHERE')
1377 layout.operator("mesh.primitive_ico_sphere_add", text="Ico Sphere", icon='MESH_ICOSPHERE')
1378 layout.operator("mesh.primitive_cylinder_add", text="Cylinder", icon='MESH_CYLINDER')
1379 layout.operator("mesh.primitive_cone_add", text="Cone", icon='MESH_CONE')
1380 layout.operator("mesh.primitive_torus_add", text="Torus", icon='MESH_TORUS')
1384 layout.operator("mesh.primitive_grid_add", text="Grid", icon='MESH_GRID')
1385 layout.operator("mesh.primitive_monkey_add", text="Monkey", icon='MESH_MONKEY')
1388 class VIEW3D_MT_curve_add(Menu):
1389 bl_idname = "VIEW3D_MT_curve_add"
1392 def draw(self, context):
1393 layout = self.layout
1395 layout.operator_context = 'INVOKE_REGION_WIN'
1397 layout.operator("curve.primitive_bezier_curve_add", text="Bezier", icon='CURVE_BEZCURVE')
1398 layout.operator("curve.primitive_bezier_circle_add", text="Circle", icon='CURVE_BEZCIRCLE')
1402 layout.operator("curve.primitive_nurbs_curve_add", text="Nurbs Curve", icon='CURVE_NCURVE')
1403 layout.operator("curve.primitive_nurbs_circle_add", text="Nurbs Circle", icon='CURVE_NCIRCLE')
1404 layout.operator("curve.primitive_nurbs_path_add", text="Path", icon='CURVE_PATH')
1408 layout.operator("curve.draw", icon='LINE_DATA')
1411 class VIEW3D_MT_surface_add(Menu):
1412 bl_idname = "VIEW3D_MT_surface_add"
1413 bl_label = "Surface"
1415 def draw(self, context):
1416 layout = self.layout
1418 layout.operator_context = 'INVOKE_REGION_WIN'
1420 layout.operator("surface.primitive_nurbs_surface_curve_add", text="Nurbs Curve", icon='SURFACE_NCURVE')
1421 layout.operator("surface.primitive_nurbs_surface_circle_add", text="Nurbs Circle", icon='SURFACE_NCIRCLE')
1422 layout.operator("surface.primitive_nurbs_surface_surface_add", text="Nurbs Surface", icon='SURFACE_NSURFACE')
1423 layout.operator("surface.primitive_nurbs_surface_cylinder_add",
1424 text="Nurbs Cylinder", icon='SURFACE_NCYLINDER')
1425 layout.operator("surface.primitive_nurbs_surface_sphere_add", text="Nurbs Sphere", icon='SURFACE_NSPHERE')
1426 layout.operator("surface.primitive_nurbs_surface_torus_add", text="Nurbs Torus", icon='SURFACE_NTORUS')
1429 class VIEW3D_MT_metaball_add(Menu):
1430 bl_idname = "VIEW3D_MT_metaball_add"
1431 bl_label = "Metaball"
1433 def draw(self, context):
1434 layout = self.layout
1436 layout.operator_context = 'INVOKE_REGION_WIN'
1437 layout.operator_enum("object.metaball_add", "type")
1440 class TOPBAR_MT_edit_curve_add(Menu):
1441 bl_idname = "TOPBAR_MT_edit_curve_add"
1444 def draw(self, context):
1445 is_surf = context.active_object.type == 'SURFACE'
1447 layout = self.layout
1448 layout.operator_context = 'EXEC_REGION_WIN'
1451 VIEW3D_MT_surface_add.draw(self, context)
1453 VIEW3D_MT_curve_add.draw(self, context)
1456 class TOPBAR_MT_edit_armature_add(Menu):
1457 bl_idname = "TOPBAR_MT_edit_armature_add"
1458 bl_label = "Armature"
1460 def draw(self, context):
1461 layout = self.layout
1463 layout.operator_context = 'EXEC_REGION_WIN'
1464 layout.operator("armature.bone_primitive_add", text="Single Bone", icon='BONE_DATA')
1467 class VIEW3D_MT_armature_add(Menu):
1468 bl_idname = "VIEW3D_MT_armature_add"
1469 bl_label = "Armature"
1471 def draw(self, context):
1472 layout = self.layout
1474 layout.operator_context = 'EXEC_REGION_WIN'
1475 layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
1478 class VIEW3D_MT_light_add(Menu):
1479 bl_idname = "VIEW3D_MT_light_add"
1482 def draw(self, context):
1483 layout = self.layout
1485 layout.operator_context = 'INVOKE_REGION_WIN'
1486 layout.operator_enum("object.light_add", "type")
1489 class VIEW3D_MT_lightprobe_add(Menu):
1490 bl_idname = "VIEW3D_MT_lightprobe_add"
1491 bl_label = "Light Probe"
1493 def draw(self, context):
1494 layout = self.layout
1496 layout.operator_context = 'INVOKE_REGION_WIN'
1497 layout.operator_enum("object.lightprobe_add", "type")
1500 class VIEW3D_MT_camera_add(Menu):
1501 bl_idname = "VIEW3D_MT_camera_add"
1504 def draw(self, context):
1505 layout = self.layout
1506 layout.operator_context = 'EXEC_REGION_WIN'
1507 layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
1510 class VIEW3D_MT_add(Menu):
1513 def draw(self, context):
1514 layout = self.layout
1516 # note, don't use 'EXEC_SCREEN' or operators won't get the 'v3d' context.
1518 # Note: was EXEC_AREA, but this context does not have the 'rv3d', which prevents
1519 # "align_view" to work on first call (see [#32719]).
1520 layout.operator_context = 'EXEC_REGION_WIN'
1522 # layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
1523 layout.menu("VIEW3D_MT_mesh_add", icon='OUTLINER_OB_MESH')
1525 # layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
1526 layout.menu("VIEW3D_MT_curve_add", icon='OUTLINER_OB_CURVE')
1527 # layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
1528 layout.menu("VIEW3D_MT_surface_add", icon='OUTLINER_OB_SURFACE')
1529 layout.menu("VIEW3D_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
1530 layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
1531 layout.operator_menu_enum("object.gpencil_add", "type", text="Grease Pencil", icon='OUTLINER_OB_GREASEPENCIL')
1534 layout.menu("VIEW3D_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
1535 layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
1536 layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY')
1537 layout.menu("VIEW3D_MT_image_add", text="Image", icon='OUTLINER_OB_IMAGE')
1541 layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
1544 if VIEW3D_MT_camera_add.is_extended():
1545 layout.menu("VIEW3D_MT_camera_add", icon='OUTLINER_OB_CAMERA')
1547 VIEW3D_MT_camera_add.draw(self, context)
1549 layout.menu("VIEW3D_MT_light_add", icon='OUTLINER_OB_LIGHT')
1551 layout.menu("VIEW3D_MT_lightprobe_add", icon='OUTLINER_OB_LIGHTPROBE')
1554 layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_FORCE_FIELD')
1557 has_collections = bool(bpy.data.collections)
1558 col = layout.column()
1559 col.enabled = has_collections
1561 if not has_collections or len(bpy.data.collections) > 10:
1562 col.operator_context = 'INVOKE_REGION_WIN'
1564 "object.collection_instance_add",
1565 text="Collection Instance..." if has_collections else "No Collections to Instance",
1566 icon='OUTLINER_OB_GROUP_INSTANCE',
1569 col.operator_menu_enum(
1570 "object.collection_instance_add",
1572 text="Collection Instance",
1573 icon='OUTLINER_OB_GROUP_INSTANCE',
1577 class VIEW3D_MT_image_add(Menu):
1578 bl_label = "Add Image"
1580 def draw(self, context):
1581 layout = self.layout
1582 layout.operator("object.load_reference_image", text="Reference", icon='IMAGE_REFERENCE')
1583 layout.operator("object.load_background_image", text="Background", icon='IMAGE_BACKGROUND')
1586 class VIEW3D_MT_object_relations(Menu):
1587 bl_label = "Relations"
1589 def draw(self, context):
1590 layout = self.layout
1592 layout.operator("object.proxy_make", text="Make Proxy...")
1594 layout.operator("object.make_dupli_face")
1598 layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
1599 layout.menu("VIEW3D_MT_make_single_user")
1603 layout.operator("object.data_transfer")
1604 layout.operator("object.datalayout_transfer")
1607 class VIEW3D_MT_object(Menu):
1608 bl_context = "objectmode"
1611 def draw(self, context):
1612 layout = self.layout
1614 layout.menu("VIEW3D_MT_transform_object")
1615 layout.menu("VIEW3D_MT_transform_origin")
1616 layout.menu("VIEW3D_MT_mirror")
1617 layout.menu("VIEW3D_MT_object_clear")
1618 layout.menu("VIEW3D_MT_object_apply")
1619 layout.menu("VIEW3D_MT_snap")
1623 layout.operator("object.duplicate_move")
1624 layout.operator("object.duplicate_move_linked")
1625 layout.operator("object.join")
1629 layout.operator("view3d.copybuffer", text="Copy Objects", icon="COPYDOWN")
1630 layout.operator("view3d.pastebuffer", text="Paste Objects", icon="PASTEDOWN")
1634 layout.menu("VIEW3D_MT_object_parent")
1635 layout.menu("VIEW3D_MT_object_collection")
1636 layout.menu("VIEW3D_MT_object_relations")
1637 layout.menu("VIEW3D_MT_object_constraints")
1638 layout.menu("VIEW3D_MT_object_track")
1639 layout.menu("VIEW3D_MT_make_links", text="Make Links...")
1643 layout.operator("object.shade_smooth")
1644 layout.operator("object.shade_flat")
1648 layout.menu("VIEW3D_MT_object_animation")
1649 layout.menu("VIEW3D_MT_object_rigid_body")
1653 layout.menu("VIEW3D_MT_object_quick_effects")
1657 layout.operator_menu_enum("object.convert", "target")
1661 layout.menu("VIEW3D_MT_object_showhide")
1665 layout.operator_context = 'EXEC_DEFAULT'
1666 layout.operator("object.delete", text="Delete").use_global = False
1667 layout.operator("object.delete", text="Delete Global").use_global = True
1670 class VIEW3D_MT_object_animation(Menu):
1671 bl_label = "Animation"
1673 def draw(self, context):
1674 layout = self.layout
1676 layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
1677 layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframes...")
1678 layout.operator("anim.keyframe_clear_v3d", text="Clear Keyframes...")
1679 layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
1683 layout.operator("nla.bake", text="Bake Action...")
1686 class VIEW3D_MT_object_rigid_body(Menu):
1687 bl_label = "Rigid Body"
1689 def draw(self, context):
1690 layout = self.layout
1692 layout.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE'
1693 layout.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE'
1697 layout.operator("rigidbody.objects_remove", text="Remove")
1701 layout.operator("rigidbody.shape_change", text="Change Shape")
1702 layout.operator("rigidbody.mass_calculate", text="Calculate Mass")
1703 layout.operator("rigidbody.object_settings_copy", text="Copy from Active")
1704 layout.operator("object.visual_transform_apply", text="Apply Transformation")
1705 layout.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes")
1709 layout.operator("rigidbody.connect", text="Connect")
1712 class VIEW3D_MT_object_clear(Menu):
1715 def draw(self, context):
1716 layout = self.layout
1718 layout.operator("object.location_clear", text="Location").clear_delta = False
1719 layout.operator("object.rotation_clear", text="Rotation").clear_delta = False
1720 layout.operator("object.scale_clear", text="Scale").clear_delta = False
1724 layout.operator("object.origin_clear", text="Origin")
1727 class VIEW3D_MT_object_specials(Menu):
1728 bl_label = "Object Context Menu"
1731 def poll(cls, context):
1732 # add more special types
1733 return context.object
1735 def draw(self, context):
1737 layout = self.layout
1739 obj = context.object
1740 is_eevee = context.scene.render.engine == 'BLENDER_EEVEE'
1742 if obj.type == 'MESH':
1744 layout.operator("object.shade_smooth", text="Smooth Shading")
1745 layout.operator("object.shade_flat", text="Flat Shading")
1749 layout.operator("object.origin_set")
1750 layout.operator("object.join")
1751 layout.operator_menu_enum("object.convert", "target")
1753 if obj.type == 'CAMERA':
1754 layout.operator_context = 'INVOKE_REGION_WIN'
1756 if obj.data.type == 'PERSP':
1757 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
1758 props.data_path_iter = "selected_editable_objects"
1759 props.data_path_item = "data.lens"
1760 props.input_scale = 0.1
1761 if obj.data.lens_unit == 'MILLIMETERS':
1762 props.header_text = "Camera Lens Angle: %.1fmm"
1764 props.header_text = "Camera Lens Angle: %.1f\u00B0"
1767 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
1768 props.data_path_iter = "selected_editable_objects"
1769 props.data_path_item = "data.ortho_scale"
1770 props.input_scale = 0.01
1771 props.header_text = "Camera Lens Scale: %.3f"
1773 if not obj.data.dof_object:
1774 view = context.space_data
1775 if view and view.camera == obj and view.region_3d.view_perspective == 'CAMERA':
1776 props = layout.operator("ui.eyedropper_depth", text="DOF Distance (Pick)")
1778 props = layout.operator("wm.context_modal_mouse", text="DOF Distance")
1779 props.data_path_iter = "selected_editable_objects"
1780 props.data_path_item = "data.dof_distance"
1781 props.input_scale = 0.02
1782 props.header_text = "DOF Distance: %.3f"
1785 if obj.type in {'CURVE', 'FONT'}:
1786 layout.operator_context = 'INVOKE_REGION_WIN'
1788 props = layout.operator("wm.context_modal_mouse", text="Extrude Size")
1789 props.data_path_iter = "selected_editable_objects"
1790 props.data_path_item = "data.extrude"
1791 props.input_scale = 0.01
1792 props.header_text = "Extrude Size: %.3f"
1794 props = layout.operator("wm.context_modal_mouse", text="Width Size")
1795 props.data_path_iter = "selected_editable_objects"
1796 props.data_path_item = "data.offset"
1797 props.input_scale = 0.01
1798 props.header_text = "Width Size: %.3f"
1800 if obj.type == 'EMPTY':
1801 layout.operator_context = 'INVOKE_REGION_WIN'
1803 props = layout.operator("wm.context_modal_mouse", text="Empty Draw Size")
1804 props.data_path_iter = "selected_editable_objects"
1805 props.data_path_item = "empty_display_size"
1806 props.input_scale = 0.01
1807 props.header_text = "Empty Draw Size: %.3f"
1809 if obj.type == 'LIGHT':
1812 layout.operator_context = 'INVOKE_REGION_WIN'
1814 emission_node = None
1816 for node in light.node_tree.nodes:
1817 if getattr(node, "type", None) == 'EMISSION':
1818 emission_node = node
1821 if is_eevee and not emission_node:
1822 props = layout.operator("wm.context_modal_mouse", text="Energy")
1823 props.data_path_iter = "selected_editable_objects"
1824 props.data_path_item = "data.energy"
1825 props.header_text = "Light Energy: %.3f"
1827 if emission_node is not None:
1828 props = layout.operator("wm.context_modal_mouse", text="Energy")
1829 props.data_path_iter = "selected_editable_objects"
1830 props.data_path_item = (
1832 ".nodes[\"" + emission_node.name + "\"]"
1833 ".inputs[\"Strength\"].default_value"
1835 props.header_text = "Light Energy: %.3f"
1836 props.input_scale = 0.1
1838 if light.type == 'AREA':
1839 props = layout.operator("wm.context_modal_mouse", text="Size X")
1840 props.data_path_iter = "selected_editable_objects"
1841 props.data_path_item = "data.size"
1842 props.header_text = "Light Size X: %.3f"
1844 if light.shape in {'RECTANGLE', 'ELLIPSE'}:
1845 props = layout.operator("wm.context_modal_mouse", text="Size Y")
1846 props.data_path_iter = "selected_editable_objects"
1847 props.data_path_item = "data.size_y"
1848 props.header_text = "Light Size Y: %.3f"
1850 elif light.type in {'SPOT', 'POINT', 'SUN'}:
1851 props = layout.operator("wm.context_modal_mouse", text="Radius")
1852 props.data_path_iter = "selected_editable_objects"
1853 props.data_path_item = "data.shadow_soft_size"
1854 props.header_text = "Light Radius: %.3f"
1856 if light.type == 'SPOT':
1859 props = layout.operator("wm.context_modal_mouse", text="Spot Size")
1860 props.data_path_iter = "selected_editable_objects"
1861 props.data_path_item = "data.spot_size"
1862 props.input_scale = 0.01
1863 props.header_text = "Spot Size: %.2f"
1865 props = layout.operator("wm.context_modal_mouse", text="Spot Blend")
1866 props.data_path_iter = "selected_editable_objects"
1867 props.data_path_item = "data.spot_blend"
1868 props.input_scale = -0.01
1869 props.header_text = "Spot Blend: %.2f"
1873 layout.operator("view3d.copybuffer", text="Copy Objects", icon='COPYDOWN')
1874 layout.operator("view3d.pastebuffer", text="Paste Objects", icon='PASTEDOWN')
1878 layout.operator("object.duplicate_move", icon="DUPLICATE")
1879 layout.operator("object.duplicate_move_linked")
1883 layout.menu("VIEW3D_MT_snap")
1884 layout.menu("VIEW3D_MT_object_parent")
1885 layout.operator_context = 'INVOKE_REGION_WIN'
1886 layout.operator("object.move_to_collection")
1890 layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
1894 layout.operator_context = 'EXEC_DEFAULT'
1895 layout.operator("object.delete", text="Delete").use_global = False
1898 class VIEW3D_MT_object_shading(Menu):
1899 # XXX, this menu is a place to store shading operator in object mode
1900 bl_label = "Shading"
1902 def draw(self, context):
1903 layout = self.layout
1904 layout.operator("object.shade_smooth", text="Smooth")
1905 layout.operator("object.shade_flat", text="Flat")
1908 class VIEW3D_MT_object_apply(Menu):
1911 def draw(self, context):
1912 layout = self.layout
1914 props = layout.operator("object.transform_apply", text="Location", text_ctxt=i18n_contexts.default)
1915 props.location, props.rotation, props.scale = True, False, False
1917 props = layout.operator("object.transform_apply", text="Rotation", text_ctxt=i18n_contexts.default)
1918 props.location, props.rotation, props.scale = False, True, False
1920 props = layout.operator("object.transform_apply", text="Scale", text_ctxt=i18n_contexts.default)
1921 props.location, props.rotation, props.scale = False, False, True
1922 props = layout.operator("object.transform_apply", text="Rotation & Scale", text_ctxt=i18n_contexts.default)
1923 props.location, props.rotation, props.scale = False, True, True
1928 "object.transforms_to_deltas",
1929 text="Location to Deltas",
1930 text_ctxt=i18n_contexts.default,
1933 "object.transforms_to_deltas",
1934 text="Rotation to Deltas",
1935 text_ctxt=i18n_contexts.default,
1938 "object.transforms_to_deltas",
1939 text="Scale to Deltas",
1940 text_ctxt=i18n_contexts.default,
1944 "object.transforms_to_deltas",
1945 text="All Transforms to Deltas",
1946 text_ctxt=i18n_contexts.default,
1948 layout.operator("object.anim_transforms_to_deltas")
1953 "object.visual_transform_apply",
1954 text="Visual Transform",
1955 text_ctxt=i18n_contexts.default,
1959 text="Visual Geometry to Mesh",
1960 text_ctxt=i18n_contexts.default,
1962 layout.operator("object.duplicates_make_real")
1965 class VIEW3D_MT_object_parent(Menu):
1968 def draw(self, context):
1969 layout = self.layout
1971 layout.operator_enum("object.parent_set", "type")
1975 layout.operator_enum("object.parent_clear", "type")
1978 class VIEW3D_MT_object_track(Menu):
1981 def draw(self, context):
1982 layout = self.layout
1984 layout.operator_enum("object.track_set", "type")
1988 layout.operator_enum("object.track_clear", "type")
1991 class VIEW3D_MT_object_collection(Menu):
1992 bl_label = "Collection"
1994 def draw(self, context):
1995 layout = self.layout
1997 layout.operator("collection.create")
1998 # layout.operator_menu_enum("collection.objects_remove", "collection") # BUGGY
1999 layout.operator("collection.objects_remove")
2000 layout.operator("collection.objects_remove_all")
2004 layout.operator("collection.objects_add_active")
2005 layout.operator("collection.objects_remove_active")
2008 class VIEW3D_MT_object_constraints(Menu):
2009 bl_label = "Constraints"
2011 def draw(self, context):
2012 layout = self.layout
2014 layout.operator("object.constraint_add_with_targets")
2015 layout.operator("object.constraints_copy")
2019 layout.operator("object.constraints_clear")
2022 class VIEW3D_MT_object_quick_effects(Menu):
2023 bl_label = "Quick Effects"
2025 def draw(self, context):
2026 layout = self.layout
2028 layout.operator("object.quick_fur")
2029 layout.operator("object.quick_explode")
2030 layout.operator("object.quick_smoke")
2031 layout.operator("object.quick_fluid")
2034 class VIEW3D_MT_object_showhide(Menu):
2035 bl_label = "Show/Hide"
2037 def draw(self, context):
2038 layout = self.layout
2040 layout.operator("object.hide_view_clear", text="Show Hidden")
2044 layout.operator("object.hide_view_set", text="Hide Selected").unselected = False
2045 layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
2048 class VIEW3D_MT_make_single_user(Menu):
2049 bl_label = "Make Single User"
2051 def draw(self, context):
2052 layout = self.layout
2054 props = layout.operator("object.make_single_user", text="Object")
2056 props.obdata = props.material = props.animation = False
2058 props = layout.operator("object.make_single_user", text="Object & Data")
2059 props.object = props.obdata = True
2060 props.material = props.animation = False
2062 props = layout.operator("object.make_single_user", text="Object & Data & Materials")
2063 props.object = props.obdata = props.material = True
2064 props.animation = False
2066 props = layout.operator("object.make_single_user", text="Materials")
2067 props.material = True
2068 props.object = props.obdata = props.animation = False
2070 props = layout.operator("object.make_single_user", text="Object Animation")
2071 props.animation = True
2072 props.object = props.obdata = props.material = False
2075 class VIEW3D_MT_make_links(Menu):
2076 bl_label = "Make Links"
2078 def draw(self, context):
2079 layout = self.layout
2080 operator_context_default = layout.operator_context
2082 if len(bpy.data.scenes) > 10:
2083 layout.operator_context = 'INVOKE_REGION_WIN'
2084 layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
2086 layout.operator_context = 'EXEC_REGION_WIN'
2087 layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene")
2091 layout.operator_context = operator_context_default
2093 layout.operator_enum("object.make_links_data", "type") # inline
2095 layout.operator("object.join_uvs") # stupid place to add this!
2098 class VIEW3D_MT_brush(Menu):
2101 def draw(self, context):
2102 layout = self.layout
2104 tool_settings = context.tool_settings
2105 settings = UnifiedPaintPanel.paint_settings(context)
2106 brush = getattr(settings, "brush", None)
2108 ups = tool_settings.unified_paint_settings
2109 layout.prop(ups, "use_unified_size", text="Unified Size")
2110 layout.prop(ups, "use_unified_strength", text="Unified Strength")
2111 if context.image_paint_object or context.vertex_paint_object:
2112 layout.prop(ups, "use_unified_color", text="Unified Color")
2115 # skip if no active brush
2117 layout.label(text="No Brushes currently available", icon='INFO')
2121 layout.menu("VIEW3D_MT_brush_paint_modes")
2124 if context.sculpt_object:
2125 layout.operator("brush.reset")
2126 layout.prop_menu_enum(brush, "sculpt_tool")
2127 elif context.image_paint_object:
2128 layout.prop_menu_enum(brush, "image_tool")
2129 elif context.vertex_paint_object:
2130 layout.prop_menu_enum(brush, "vertex_tool")
2131 elif context.weight_paint_object:
2132 layout.prop_menu_enum(brush, "weight_tool")
2134 # TODO: still missing a lot of brush options here
2137 if context.sculpt_object:
2139 sculpt_tool = brush.sculpt_tool
2142 layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
2145 if sculpt_tool != 'GRAB':
2146 layout.prop_menu_enum(brush, "stroke_method")
2148 if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
2149 layout.prop_menu_enum(brush, "direction")
2151 if sculpt_tool == 'LAYER':
2152 layout.prop(brush, "use_persistent")
2153 layout.operator("sculpt.set_persistent_base")
2156 class VIEW3D_MT_brush_paint_modes(Menu):
2157 bl_label = "Enabled Modes"
2159 def draw(self, context):
2160 layout = self.layout
2162 settings = UnifiedPaintPanel.paint_settings(context)
2163 brush = settings.brush
2165 layout.prop(brush, "use_paint_sculpt", text="Sculpt")
2166 layout.prop(brush, "use_paint_vertex", text="Vertex Paint")
2167 layout.prop(brush, "use_paint_weight", text="Weight Paint")
2168 layout.prop(brush, "use_paint_image", text="Texture Paint")
2171 class VIEW3D_MT_paint_vertex(Menu):
2174 def draw(self, context):
2175 layout = self.layout
2177 layout.operator("paint.vertex_color_set")
2178 layout.operator("paint.vertex_color_smooth")
2179 layout.operator("paint.vertex_color_dirt")
2180 layout.operator("paint.vertex_color_from_weight")
2184 layout.operator("paint.vertex_color_invert", text="Invert")
2185 layout.operator("paint.vertex_color_levels", text="Levels")
2186 layout.operator("paint.vertex_color_hsv", text="Hue Saturation Value")
2187 layout.operator("paint.vertex_color_brightness_contrast", text="Bright/Contrast")
2190 class VIEW3D_MT_hook(Menu):
2193 def draw(self, context):
2194 layout = self.layout
2195 layout.operator_context = 'EXEC_AREA'
2196 layout.operator("object.hook_add_newob")
2197 layout.operator("object.hook_add_selob").use_bone = False
2198 layout.operator("object.hook_add_selob", text="Hook to Selected Object Bone").use_bone = True
2200 if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
2203 layout.operator_menu_enum("object.hook_assign", "modifier")
2204 layout.operator_menu_enum("object.hook_remove", "modifier")
2208 layout.operator_menu_enum("object.hook_select", "modifier")
2209 layout.operator_menu_enum("object.hook_reset", "modifier")
2210 layout.operator_menu_enum("object.hook_recenter", "modifier")
2213 class VIEW3D_MT_vertex_group(Menu):
2214 bl_label = "Vertex Groups"
2216 def draw(self, context):
2217 layout = self.layout
2219 layout.operator_context = 'EXEC_AREA'
2220 layout.operator("object.vertex_group_assign_new")
2222 ob = context.active_object
2223 if ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex):
2224 if ob.vertex_groups.active:
2227 layout.operator("object.vertex_group_assign", text="Assign to Active Group")
2229 "object.vertex_group_remove_from",
2230 text="Remove from Active Group",
2231 ).use_all_groups = False
2232 layout.operator("object.vertex_group_remove_from", text="Remove from All").use_all_groups = True
2234 if ob.vertex_groups.active:
2237 layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
2238 layout.operator("object.vertex_group_remove", text="Remove Active Group").all = False
2239 layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
2242 class VIEW3D_MT_paint_weight(Menu):
2243 bl_label = "Weights"
2246 def draw_generic(layout, is_editmode=False):
2250 layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
2251 layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
2255 layout.operator("object.vertex_group_normalize_all", text="Normalize All")
2256 layout.operator("object.vertex_group_normalize", text="Normalize")
2260 layout.operator("object.vertex_group_mirror", text="Mirror")
2261 layout.operator("object.vertex_group_invert", text="Invert")
2262 layout.operator("object.vertex_group_clean", text="Clean")
2266 layout.operator("object.vertex_group_quantize", text="Quantize")
2267 layout.operator("object.vertex_group_levels", text="Levels")
2268 layout.operator("object.vertex_group_smooth", text="Smooth")
2271 props = layout.operator("object.data_transfer", text="Transfer Weights")
2272 props.use_reverse_transfer = True
2273 props.data_type = 'VGROUP_WEIGHTS'
2275 layout.operator("object.vertex_group_limit_total", text="Limit Total")
2276 layout.operator("object.vertex_group_fix", text="Fix Deforms")
2281 layout.operator("paint.weight_set")
2283 def draw(self, context):
2284 self.draw_generic(self.layout, is_editmode=False)
2287 class VIEW3D_MT_sculpt(Menu):
2290 def draw(self, context):
2291 layout = self.layout
2293 tool_settings = context.tool_settings
2294 sculpt = tool_settings.sculpt
2296 layout.prop(sculpt, "use_symmetry_x")
2297 layout.prop(sculpt, "use_symmetry_y")
2298 layout.prop(sculpt, "use_symmetry_z")
2302 layout.prop(sculpt, "lock_x")
2303 layout.prop(sculpt, "lock_y")
2304 layout.prop(sculpt, "lock_z")
2308 layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
2309 layout.prop(sculpt, "show_low_resolution")
2310 layout.prop(sculpt, "show_brush")
2311 layout.prop(sculpt, "use_deform_only")
2312 layout.prop(sculpt, "show_diffuse_color")
2313 layout.prop(sculpt, "show_mask")
2316 class VIEW3D_MT_hide_mask(Menu):
2317 bl_label = "Hide/Mask"
2319 def draw(self, context):
2320 layout = self.layout
2322 props = layout.operator("paint.hide_show", text="Show All")
2323 props.action = 'SHOW'
2326 props = layout.operator("paint.hide_show", text="Hide Bounding Box")
2327 props.action = 'HIDE'
2328 props.area = 'INSIDE'
2330 props = layout.operator("paint.hide_show", text="Show Bounding Box")
2331 props.action = 'SHOW'
2332 props.area = 'INSIDE'
2334 props = layout.operator("paint.hide_show", text="Hide Masked")
2335 props.area = 'MASKED'
2336 props.action = 'HIDE'
2340 props = layout.operator("paint.mask_flood_fill", text="Invert Mask")
2341 props.mode = 'INVERT'
2343 props = layout.operator("paint.mask_flood_fill", text="Fill Mask")
2344 props.mode = 'VALUE'
2347 props = layout.operator("paint.mask_flood_fill", text="Clear Mask")
2348 props.mode = 'VALUE'
2351 props = layout.operator("view3d.select_box", text="Box Mask")
2352 props = layout.operator("paint.mask_lasso_gesture", text="Lasso Mask")
2355 class VIEW3D_MT_particle(Menu):
2356 bl_label = "Particle"
2358 def draw(self, context):
2359 layout = self.layout
2360 tool_settings = context.tool_settings
2362 particle_edit = tool_settings.particle_edit
2364 layout.operator("particle.mirror")
2366 layout.operator("particle.remove_doubles")
2370 if particle_edit.select_mode == 'POINT':
2371 layout.operator("particle.subdivide")
2373 layout.operator("particle.unify_length")
2374 layout.operator("particle.rekey")
2375 layout.operator("particle.weight_set")
2379 layout.menu("VIEW3D_MT_particle_showhide")
2383 layout.operator("particle.delete")
2386 class VIEW3D_MT_particle_specials(Menu):
2387 bl_label = "Particle Context Menu"
2389 def draw(self, context):
2390 layout = self.layout
2391 tool_settings = context.tool_settings
2393 particle_edit = tool_settings.particle_edit
2395 layout.operator("particle.rekey")
2399 layout.operator("particle.delete")
2403 layout.operator("particle.remove_doubles")
2404 layout.operator("particle.unify_length")
2406 if particle_edit.select_mode == 'POINT':
2407 layout.operator("particle.subdivide")
2409 layout.operator("particle.weight_set")
2413 layout.operator("particle.mirror")
2415 if particle_edit.select_mode == 'POINT':
2418 layout.operator("particle.select_all", text="All").action = 'SELECT'
2419 layout.operator("particle.select_all", text="None").action = 'DESELECT'
2420 layout.operator("particle.select_all", text="Invert").action = 'INVERT'
2424 layout.operator("particle.select_roots")
2425 layout.operator("particle.select_tips")
2429 layout.operator("particle.select_random")
2433 layout.operator("particle.select_more")
2434 layout.operator("particle.select_less")
2438 layout.operator("particle.select_linked")
2441 class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu):
2442 _operator_name = "particle"
2445 class VIEW3D_MT_pose(Menu):
2448 def draw(self, context):
2449 layout = self.layout
2451 layout.menu("VIEW3D_MT_transform_armature")
2453 layout.menu("VIEW3D_MT_pose_transform")
2454 layout.menu("VIEW3D_MT_pose_apply")
2456 layout.menu("VIEW3D_MT_snap")
2460 layout.menu("VIEW3D_MT_object_animation")
2464 layout.menu("VIEW3D_MT_pose_slide")
2465 layout.menu("VIEW3D_MT_pose_propagate")
2469 layout.operator("pose.copy", icon="COPYDOWN")
2470 layout.operator("pose.paste", icon="PASTEDOWN").flipped = False
2471 layout.operator("pose.paste", text="Paste Pose Flipped").flipped = True
2475 layout.menu("VIEW3D_MT_pose_library")
2476 layout.menu("VIEW3D_MT_pose_motion")
2477 layout.menu("VIEW3D_MT_pose_group")
2481 layout.menu("VIEW3D_MT_object_parent")
2482 layout.menu("VIEW3D_MT_pose_ik")
2483 layout.menu("VIEW3D_MT_pose_constraints")
2487 layout.operator_context = 'EXEC_AREA'
2488 layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
2489 layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
2490 layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
2492 layout.operator("pose.flip_names")
2494 layout.operator("pose.quaternions_flip")
2498 layout.operator_context = 'INVOKE_AREA'
2499 layout.operator("armature.armature_layers", text="Change Armature Layers...")
2500 layout.operator("pose.bone_layers", text="Change Bone Layers...")
2504 layout.menu("VIEW3D_MT_pose_showhide")
2505 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
2508 class VIEW3D_MT_pose_transform(Menu):
2509 bl_label = "Clear Transform"
2511 def draw(self, context):
2512 layout = self.layout
2514 layout.operator("pose.transforms_clear", text="All")
2518 layout.operator("pose.loc_clear", text="Location")
2519 layout.operator("pose.rot_clear", text="Rotation")
2520 layout.operator("pose.scale_clear", text="Scale")
2524 layout.operator("pose.user_transforms_clear", text="Reset Unkeyed")
2527 class VIEW3D_MT_pose_slide(Menu):
2528 bl_label = "In-Betweens"
2530 def draw(self, context):
2531 layout = self.layout
2533 layout.operator("pose.push")
2534 layout.operator("pose.relax")
2535 layout.operator("pose.breakdown")
2538 class VIEW3D_MT_pose_propagate(Menu):
2539 bl_label = "Propagate"
2541 def draw(self, context):
2542 layout = self.layout
2544 layout.operator("pose.propagate").mode = 'WHILE_HELD'
2548 layout.operator("pose.propagate", text="To Next Keyframe").mode = 'NEXT_KEY'
2549 layout.operator("pose.propagate", text="To Last Keyframe (Make Cyclic)").mode = 'LAST_KEY'
2553 layout.operator("pose.propagate", text="On Selected Keyframes").mode = 'SELECTED_KEYS'
2557 layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
2560 class VIEW3D_MT_pose_library(Menu):
2561 bl_label = "Pose Library"
2563 def draw(self, context):
2564 layout = self.layout
2566 layout.operator("poselib.browse_interactive", text="Browse Poses...")
2570 layout.operator("poselib.pose_add", text="Add Pose...")
2571 layout.operator("poselib.pose_rename", text="Rename Pose...")
2572 layout.operator("poselib.pose_remove", text="Remove Pose...")
2575 class VIEW3D_MT_pose_motion(Menu):
2576 bl_label = "Motion Paths"
2578 def draw(self, context):
2579 layout = self.layout
2581 layout.operator("pose.paths_calculate", text="Calculate")
2582 layout.operator("pose.paths_clear", text="Clear")
2585 class VIEW3D_MT_pose_group(Menu):
2586 bl_label = "Bone Groups"
2588 def draw(self, context):
2589 layout = self.layout
2591 pose = context.active_object.pose
2593 layout.operator_context = 'EXEC_AREA'
2594 layout.operator("pose.group_assign", text="Assign to New Group").type = 0
2596 if pose.bone_groups:
2597 active_group = pose.bone_groups.active_index + 1
2598 layout.operator("pose.group_assign", text="Assign to Group").type = active_group
2602 # layout.operator_context = 'INVOKE_AREA'
2603 layout.operator("pose.group_unassign")
2604 layout.operator("pose.group_remove")
2607 class VIEW3D_MT_pose_ik(Menu):
2608 bl_label = "Inverse Kinematics"
2610 def draw(self, context):
2611 layout = self.layout
2613 layout.operator("pose.ik_add")
2614 layout.operator("pose.ik_clear")
2617 class VIEW3D_MT_pose_constraints(Menu):
2618 bl_label = "Constraints"
2620 def draw(self, context):
2621 layout = self.layout
2623 layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
2624 layout.operator("pose.constraints_copy")
2625 layout.operator("pose.constraints_clear")
2628 class VIEW3D_MT_pose_showhide(ShowHideMenu, Menu):
2629 _operator_name = "pose"
2632 class VIEW3D_MT_pose_apply(Menu):
2635 def draw(self, context):
2636 layout = self.layout
2638 layout.operator("pose.armature_apply")
2639 layout.operator("pose.visual_transform_apply")
2642 class VIEW3D_MT_pose_specials(Menu):
2643 bl_label = "Pose Context Menu"
2645 def draw(self, context):
2646 layout = self.layout
2648 layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
2652 layout.operator("pose.copy", icon="COPYDOWN")
2653 layout.operator("pose.paste", icon="PASTEDOWN").flipped = False
2654 layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True
2658 layout.operator("pose.select_constraint_target")
2662 layout.operator("pose.paths_calculate", text="Calculate")
2663 layout.operator("pose.paths_clear", text="Clear")
2667 layout.operator("pose.paths_calculate")
2668 layout.operator("pose.paths_clear")
2672 layout.operator("pose.hide").unselected = False
2673 layout.operator("pose.reveal")
2677 layout.operator("pose.user_transforms_clear")
2681 def draw(self, context):
2682 layout = self.layout
2687 "use_envelope_multiply",
2688 "use_inherit_rotation",
2689 "use_inherit_scale",
2692 if context.mode == 'EDIT_ARMATURE':
2693 bone_props = bpy.types.EditBone.bl_rna.properties
2694 data_path_iter = "selected_bones"
2696 options.append("lock")
2698 bone_props = bpy.types.Bone.bl_rna.properties
2699 data_path_iter = "selected_pose_bones"
2700 opt_suffix = "bone."
2703 props = layout.operator("wm.context_collection_boolean_set", text=bone_props[opt].name,
2704 text_ctxt=i18n_contexts.default)
2705 props.data_path_iter = data_path_iter
2706 props.data_path_item = opt_suffix + opt
2707 props.type = self.type
2710 class VIEW3D_MT_bone_options_toggle(Menu, BoneOptions):
2711 bl_label = "Toggle Bone Options"
2715 class VIEW3D_MT_bone_options_enable(Menu, BoneOptions):
2716 bl_label = "Enable Bone Options"
2720 class VIEW3D_MT_bone_options_disable(Menu, BoneOptions):
2721 bl_label = "Disable Bone Options"
2725 # ********** Edit Menus, suffix from ob.type **********
2728 class VIEW3D_MT_edit_mesh(Menu):
2731 def draw(self, context):
2732 layout = self.layout
2734 with_bullet = bpy.app.build_options.bullet
2736 layout.menu("VIEW3D_MT_transform")
2737 layout.menu("VIEW3D_MT_mirror")
2738 layout.menu("VIEW3D_MT_snap")
2742 layout.operator("mesh.duplicate_move", text="Duplicate")
2743 layout.menu("VIEW3D_MT_edit_mesh_extrude")
2744 layout.operator("mesh.split")
2745 layout.operator("mesh.bisect")
2748 layout.operator("mesh.convex_hull")
2752 layout.operator("mesh.symmetrize")
2753 layout.operator("mesh.symmetry_snap")
2757 layout.menu("VIEW3D_MT_edit_mesh_normals")
2758 layout.menu("VIEW3D_MT_edit_mesh_shading")
2759 layout.menu("VIEW3D_MT_edit_mesh_weights")
2760 layout.operator_menu_enum("mesh.sort_elements", "type", text="Sort Elements...")
2764 layout.menu("VIEW3D_MT_edit_mesh_showhide")
2765 layout.operator_menu_enum("mesh.separate", "type")
2766 layout.menu("VIEW3D_MT_edit_mesh_clean")
2770 layout.menu("VIEW3D_MT_edit_mesh_delete")
2773 class VIEW3D_MT_edit_mesh_specials(Menu):
2774 bl_label = "Mesh Context Menu"
2776 def draw(self, context):
2777 layout = self.layout
2779 select_mode = context.tool_settings.mesh_select_mode
2781 layout.operator_context = 'INVOKE_REGION_WIN'
2783 layout.operator("mesh.subdivide", text="Subdivide")
2787 layout.operator("mesh.duplicate_move", text="Duplicate")
2789 # Vertex Select Commands
2793 layout.operator("mesh.edge_face_add", text="New Edge/Face from Vertices")
2794 layout.operator("mesh.vert_connect_path", text="Connect Vertex Path")
2795 layout.operator("mesh.vert_connect", text="Connect Vertex Pairs")
2799 layout.operator("mesh.vertices_smooth", text="Smooth")
2800 layout.operator("mesh.vertices_smooth_laplacian", text="Smooth Laplacian")
2803 layout.operator("mesh.merge", text="Merge Vertices...")
2804 layout.operator("mesh.remove_doubles", text="Remove Double Vertices")
2805 layout.operator("mesh.dissolve_verts")
2806 layout.operator("mesh.delete", text="Delete Vertices").type = 'VERT'
2808 # Edge Select Commands
2812 layout.operator("mesh.bridge_edge_loops", text="Bridge Edge Loops")
2816 layout.operator("mesh.dissolve_edges")
2817 layout.operator("mesh.delete", text="Delete Edges").type = 'EDGE'
2819 # Face Select Commands
2823 layout.operator("mesh.faces_shade_smooth")
2824 layout.operator("mesh.faces_shade_flat")
2828 layout.operator("mesh.bridge_edge_loops", text="Bridge Faces")
2832 layout.operator("mesh.poke")
2836 props = layout.operator("mesh.quads_convert_to_tris")
2837 props.quad_method = props.ngon_method = 'BEAUTY'
2838 layout.operator("mesh.tris_convert_to_quads")
2842 layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap Faces...")
2846 layout.operator("mesh.dissolve_faces")
2847 layout.operator("mesh.delete", text="Delete Faces").type = 'FACE'
2849 # General Mesh Commands
2853 layout.menu("VIEW3D_MT_snap", text="Snap...")
2854 layout.operator("transform.mirror", text="Mirror")
2855 layout.operator("mesh.symmetrize")
2856 layout.operator("mesh.symmetry_snap")
2860 layout.operator("mesh.hide", text="Hide").unselected = False
2861 layout.operator("mesh.reveal", text="Reveal")
2864 class VIEW3D_MT_edit_mesh_select_mode(Menu):
2865 bl_label = "Mesh Select Mode"
2867 def draw(self, context):
2868 layout = self.layout
2870 layout.operator_context = 'INVOKE_REGION_WIN'
2871 layout.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL').type = 'VERT'
2872 layout.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type = 'EDGE'
2873 layout.operator("mesh.select_mode", text="Face", icon='FACESEL').type = 'FACE'
2876 class VIEW3D_MT_edit_mesh_extrude(Menu):
2877 bl_label = "Extrude"
2880 'VERT': lambda layout:
2881 layout.operator("mesh.extrude_vertices_move", text="Extrude Vertices"),
2882 'EDGE': lambda layout:
2883 layout.operator("mesh.extrude_edges_move", text="Extrude Edges"),
2884 'REGION': lambda layout:
2885 layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Faces"),
2886 'REGION_VERT_NORMAL': lambda layout:
2887 layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten", text="Extrude Faces Along Normals"),
2888 'FACE': lambda layout:
2889 layout.operator("mesh.extrude_faces_move", text="Extrude Individual Faces"),
2893 def extrude_options(context):
2894 tool_settings = context.tool_settings
2895 select_mode = tool_settings.mesh_select_mode
2896 mesh = context.object.data
2899 if mesh.total_face_sel:
2900 menu += ['REGION', 'REGION_VERT_NORMAL', 'FACE']
2901 if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
2903 if mesh.total_vert_sel and select_mode[0]:
2906 # should never get here
2909 def draw(self, context):
2910 layout = self.layout
2911 layout.operator_context = 'INVOKE_REGION_WIN'
2913 for menu_id in self.extrude_options(context):
2914 self._extrude_funcs[menu_id](layout)
2917 class VIEW3D_MT_edit_mesh_vertices(Menu):
2920 def draw(self, context):
2921 layout = self.layout
2922 layout.operator_context = 'INVOKE_REGION_WIN'
2924 layout.operator("mesh.extrude_vertices_move", text="Extrude Vertices"),
2925 layout.operator("mesh.bevel", text="Bevel Vertices").vertex_only = True
2929 layout.operator("mesh.edge_face_add", text="New Edge/Face from Vertices")
2930 layout.operator("mesh.vert_connect_path", text="Connect Vertex Path")
2931 layout.operator("mesh.vert_connect", text="Connect Vertex Pairs")
2935 props = layout.operator("mesh.rip_move", text="Rip Vertices")
2936 props.MESH_OT_rip.use_fill = False
2937 props = layout.operator("mesh.rip_move", text="Rip Vertices and Fill")
2938 props.MESH_OT_rip.use_fill = True
2939 layout.operator("mesh.rip_edge_move", text="Rip Vertices and Extend")
2943 layout.operator("transform.vert_slide", text="Slide Vertices")
2944 layout.operator("mesh.vertices_smooth", text="Smooth Vertices")
2948 layout.operator("mesh.blend_from_shape")
2949 layout.operator("mesh.shape_propagate_to_all", text="Propagate to Shapes")
2953 layout.operator("mesh.merge", text="Merge Vertices")
2954 layout.operator("mesh.remove_doubles", text="Remove Double Vertices")
2958 layout.menu("VIEW3D_MT_vertex_group")
2959 layout.menu("VIEW3D_MT_hook")
2963 layout.operator("object.vertex_parent_set")
2966 class VIEW3D_MT_edit_mesh_edges_data(Menu):
2967 bl_label = "Edge Data"
2969 def draw(self, context):
2970 layout = self.layout
2972 with_freestyle = bpy.app.build_options.freestyle
2974 layout.operator_context = 'INVOKE_REGION_WIN'
2976 layout.operator("transform.edge_crease")
2977 layout.operator("transform.edge_bevelweight")
2981 layout.operator("mesh.mark_seam").clear = False
2982 layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
2986 layout.operator("mesh.mark_sharp")
2987 layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
2989 layout.operator("mesh.mark_sharp", text="Mark Sharp from Vertices").use_verts = True
2990 props = layout.operator("mesh.mark_sharp", text="Clear Sharp from Vertices")
2991 props.use_verts = True
2997 layout.operator("mesh.mark_freestyle_edge").clear = False
2998 layout.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True
3001 class VIEW3D_MT_edit_mesh_edges(Menu):
3004 def draw(self, context):
3005 layout = self.layout
3007 with_freestyle = bpy.app.build_options.freestyle
3009 layout.operator_context = 'INVOKE_REGION_WIN'
3011 layout.operator("mesh.extrude_edges_move", text="Extrude Edges"),
3012 layout.operator("mesh.bevel", text="Bevel Edges").vertex_only = False
3013 layout.operator("mesh.bridge_edge_loops")
3017 layout.operator("mesh.subdivide")
3018 layout.operator("mesh.subdivide_edgering")
3019 layout.operator("mesh.unsubdivide")
3023 layout.operator("mesh.edge_rotate", text="Rotate Edge CW").use_ccw = False
3024 layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").use_ccw = True
3028 layout.operator("transform.edge_slide")
3029 layout.operator("mesh.edge_split")
3033 layout.operator("transform.edge_crease")
3034 layout.operator("transform.edge_bevelweight")
3038 layout.operator("mesh.mark_seam").clear = False
3039 layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
3043 layout.operator("mesh.mark_sharp")
3044 layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
3046 layout.operator("mesh.mark_sharp", text="Mark Sharp from Vertices").use_verts = True
3047 props = layout.operator("mesh.mark_sharp", text="Clear Sharp from Vertices")
3048 props.use_verts = True
3054 layout.operator("mesh.mark_freestyle_edge").clear = False
3055 layout.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True
3058 class VIEW3D_MT_edit_mesh_faces_data(Menu):
3059 bl_label = "Face Data"
3061 def draw(self, context):
3062 layout = self.layout
3064 with_freestyle = bpy.app.build_options.freestyle
3066 layout.operator_context = 'INVOKE_REGION_WIN'
3068 layout.operator("mesh.colors_rotate")
3069 layout.operator("mesh.colors_reverse")
3073 layout.operator("mesh.uvs_rotate")
3074 layout.operator("mesh.uvs_reverse")
3079 layout.operator("mesh.mark_freestyle_face").clear = False
3080 layout.operator("mesh.mark_freestyle_face", text="Clear Freestyle Face").clear = True
3083 class VIEW3D_MT_edit_mesh_faces(Menu):
3085 bl_idname = "VIEW3D_MT_edit_mesh_faces"
3087 def draw(self, context):
3088 layout = self.layout
3090 layout.operator_context = 'INVOKE_REGION_WIN'
3092 layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Faces"),
3093 layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten", text="Extrude Faces Along Normals"),
3094 layout.operator("mesh.extrude_faces_move", text="Extrude Individual Faces"),
3098 layout.operator("mesh.inset")
3099 layout.operator("mesh.poke")
3100 props = layout.operator("mesh.quads_convert_to_tris")
3101 props.quad_method = props.ngon_method = 'BEAUTY'
3102 layout.operator("mesh.tris_convert_to_quads")
3103 layout.operator("mesh.solidify", text="Solidify Faces")
3104 layout.operator("mesh.wireframe")
3108 layout.operator("mesh.fill")
3109 layout.operator("mesh.fill_grid")
3110 layout.operator("mesh.beautify_fill")
3114 layout.operator("mesh.intersect")
3115 layout.operator("mesh.intersect_boolean")
3119 layout.operator("mesh.face_split_by_edges")
3123 layout.operator("mesh.faces_shade_smooth")
3124 layout.operator("mesh.faces_shade_flat")
3128 layout.menu("VIEW3D_MT_edit_mesh_faces_data")
3131 class VIEW3D_MT_edit_mesh_normals(Menu):
3132 bl_label = "Normals"
3134 def draw(self, context):
3135 layout = self.layout
3137 layout.operator("mesh.normals_make_consistent", text="Recalculate Outside").inside = False
3138 layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True
3142 layout.operator("mesh.flip_normals")
3143 layout.operator("mesh.set_normals_from_faces", text="Set From Faces")
3145 layout.operator("transform.rotate_normal", text="Rotate Normal")
3146 layout.operator("mesh.point_normals", text="Point normals to target")
3148 layout.operator("mesh.merge_normals", text="Merge")
3149 layout.operator("mesh.split_normals", text="Split")
3151 layout.operator("mesh.average_normals", text="Average Normals")
3153 layout.label(text="Normal Vector")
3155 layout.operator("mesh.normals_tools", text="Copy").mode = 'COPY'
3156 layout.operator("mesh.normals_tools", text="Paste").mode = 'PASTE'
3158 layout.operator("mesh.normals_tools", text="Multiply").mode = 'MULTIPLY'
3159 layout.operator("mesh.normals_tools", text="Add").mode = 'ADD'
3161 layout.operator("mesh.normals_tools", text="Reset").mode = 'RESET'
3163 layout.operator("mesh.smoothen_normals", text="Smoothen")
3165 layout.label(text="Face Strength")
3166 layout.operator("mesh.mod_weighted_strength", text="Face Select", icon='FACESEL').set = False
3167 layout.operator("mesh.mod_weighted_strength", text="Set Strength", icon='ADD').set = True
3170 class VIEW3D_MT_edit_mesh_shading(Menu):
3171 bl_label = "Shading"
3173 def draw(self, context):
3174 layout = self.layout
3176 layout.operator("mesh.faces_shade_smooth", text="Smooth Faces")
3177 layout.operator("mesh.faces_shade_flat", text="Flat Faces")
3181 layout.operator("mesh.mark_sharp", text="Smooth Edges").clear = True
3182 layout.operator("mesh.mark_sharp", text="Sharp Edges")
3186 props = layout.operator("mesh.mark_sharp", text="Smooth Vertices")
3187 props.use_verts = True
3190 layout.operator("mesh.mark_sharp", text="Sharp Vertices").use_verts = True
3193 class VIEW3D_MT_edit_mesh_weights(Menu):
3194 bl_label = "Weights"
3196 def draw(self, context):
3197 VIEW3D_MT_paint_weight.draw_generic(self.layout, is_editmode=True)
3200 class VIEW3D_MT_edit_mesh_clean(Menu):
3201 bl_label = "Clean Up"
3203 def draw(self, context):
3204 layout = self.layout
3206 layout.operator("mesh.delete_loose")
3210 layout.operator("mesh.decimate")
3211 layout.operator("mesh.dissolve_degenerate")
3212 layout.operator("mesh.dissolve_limited")
3213 layout.operator("mesh.face_make_planar")
3217 layout.operator("mesh.vert_connect_nonplanar")
3218 layout.operator("mesh.vert_connect_concave")
3219 layout.operator("mesh.remove_doubles")
3220 layout.operator("mesh.fill_holes")
3223 class VIEW3D_MT_edit_mesh_delete(Menu):
3226 def draw(self, context):
3227 layout = self.layout
3229 layout.operator_enum("mesh.delete", "type")
3233 layout.operator("mesh.dissolve_verts")
3234 layout.operator("mesh.dissolve_edges")
3235 layout.operator("mesh.dissolve_faces")
3239 layout.operator("mesh.dissolve_limited")
3243 layout.operator("mesh.edge_collapse")
3244 layout.operator("mesh.delete_edgeloop", text="Edge Loops")
3247 class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu):
3248 _operator_name = "mesh"
3251 class VIEW3D_MT_edit_gpencil_delete(Menu):
3254 def draw(self, context):
3255 layout = self.layout
3257 layout.operator_enum("gpencil.delete", "type")
3261 layout.operator_enum("gpencil.dissolve", "type")
3265 layout.operator("gpencil.active_frames_delete_all")
3267 # draw_curve is used by VIEW3D_MT_edit_curve and VIEW3D_MT_edit_surface
3270 def draw_curve(self, context):
3271 layout = self.layout
3273 layout.menu("VIEW3D_MT_transform")
3274 layout.menu("VIEW3D_MT_mirror")
3275 layout.menu("VIEW3D_MT_snap")
3279 layout.operator("curve.extrude_move")
3280 layout.operator("curve.spin")
3281 layout.operator("curve.duplicate_move")
3285 layout.operator("curve.split")
3286 layout.operator("curve.separate")
3287 layout.operator("curve.make_segment")
3288 layout.operator("curve.cyclic_toggle")
3292 layout.menu("VIEW3D_MT_edit_curve_ctrlpoints")
3293 layout.menu("VIEW3D_MT_edit_curve_segments")
3297 layout.menu("VIEW3D_MT_edit_curve_showhide")
3298 layout.menu("VIEW3D_MT_edit_curve_clean")
3299 layout.menu("VIEW3D_MT_edit_curve_delete")
3302 class VIEW3D_MT_edit_curve(Menu):
3308 class VIEW3D_MT_edit_curve_ctrlpoints(Menu):
3309 bl_label = "Control Points"
3311 def draw(self, context):
3312 layout = self.layout
3314 edit_object = context.edit_object
3316 if edit_object.type == 'CURVE':
3317 layout.operator("transform.tilt")
3318 layout.operator("curve.tilt_clear")
3322 layout.operator_menu_enum("curve.handle_type_set", "type")
3323 layout.operator("curve.normals_make_consistent")
3327 layout.menu("VIEW3D_MT_hook")
3331 layout.operator("object.vertex_parent_set")
3334 class VIEW3D_MT_edit_curve_segments(Menu):
3335 bl_label = "Segments"
3337 def draw(self, context):
3338 layout = self.layout
3340 layout.operator("curve.subdivide")
3341 layout.operator("curve.switch_direction")
3344 class VIEW3D_MT_edit_curve_clean(Menu):
3345 bl_label = "Clean Up"
3347 def draw(self, context):
3348 layout = self.layout
3350 layout.operator("curve.decimate")
3353 class VIEW3D_MT_edit_curve_specials(Menu):
3354 bl_label = "Curve Context Menu"
3356 def draw(self, context):
3357 layout = self.layout
3359 layout.operator("curve.subdivide")
3360 layout.operator("curve.switch_direction")
3361 layout.operator("curve.spline_weight_set")
3362 layout.operator("curve.radius_set")
3366 layout.operator("curve.smooth")
3367 layout.operator("curve.smooth_weight")
3368 layout.operator("curve.smooth_radius")
3369 layout.operator("curve.smooth_tilt")
3372 class VIEW3D_MT_edit_curve_delete(Menu):
3375 def draw(self, context):
3376 layout = self.layout
3378 layout.operator_enum("curve.delete", "type")
3382 layout.operator("curve.dissolve_verts")
3385 class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, Menu):
3386 _operator_name = "curve"
3389 class VIEW3D_MT_edit_surface(Menu):
3390 bl_label = "Surface"
3395 class VIEW3D_MT_edit_font(Menu):
3398 def draw(self, context):
3399 layout = self.layout
3401 layout.menu("VIEW3D_MT_edit_text_chars")
3405 layout.operator("font.style_toggle", text="Toggle Bold").style = 'BOLD'
3406 layout.operator("font.style_toggle", text="Toggle Italic").style = 'ITALIC'
3410 layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE'
3411 layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS'
3414 class VIEW3D_MT_edit_text_chars(Menu):
3415 bl_label = "Special Characters"
3417 def draw(self, context):
3418 layout = self.layout
3420 layout.operator("font.text_insert", text="Copyright").text = "\u00A9"
3421 layout.operator("font.text_insert", text="Registered Trademark").text = "\u00AE"
3425 layout.operator("font.text_insert", text="Degree Sign").text = "\u00B0"
3426 layout.operator("font.text_insert", text="Multiplication Sign").text = "\u00D7"
3427 layout.operator("font.text_insert", text="Circle").text = "\u008A"
3431 layout.operator("font.text_insert", text="Superscript 1").text = "\u00B9"
3432 layout.operator("font.text_insert", text="Superscript 2").text = "\u00B2"
3433 layout.operator("font.text_insert", text="Superscript 3").text = "\u00B3"
3437 layout.operator("font.text_insert", text="Double >>").text = "\u00BB"
3438 layout.operator("font.text_insert", text="Double <<").text = "\u00AB"
3439 layout.operator("font.text_insert", text="Promillage").text = "\u2030"
3443 layout.operator("font.text_insert", text="Dutch Florin").text = "\u00A4"
3444 layout.operator("font.text_insert", text="British Pound").text = "\u00A3"
3445 layout.operator("font.text_insert", text="Japanese Yen").text = "\u00A5"
3449 layout.operator("font.text_insert", text="German S").text = "\u00DF"
3450 layout.operator("font.text_insert", text="Spanish Question Mark").text = "\u00BF"
3451 layout.operator("font.text_insert", text="Spanish Exclamation Mark").text = "\u00A1"
3454 class VIEW3D_MT_edit_meta(Menu):
3455 bl_label = "Metaball"
3457 def draw(self, context):
3458 layout = self.layout
3460 layout.menu("VIEW3D_MT_transform")
3461 layout.menu("VIEW3D_MT_mirror")
3462 layout.menu("VIEW3D_MT_snap")
3466 layout.operator("mball.duplicate_metaelems")
3470 layout.menu("VIEW3D_MT_edit_meta_showhide")
3472 layout.operator_context = 'EXEC_DEFAULT'
3473 layout.operator("mball.delete_metaelems", text="Delete")
3476 class VIEW3D_MT_edit_meta_showhide(Menu):
3477 bl_label = "Show/Hide"
3479 def draw(self, context):
3480 layout = self.layout
3482 layout.operator("mball.reveal_metaelems", text="Show Hidden")
3483 layout.operator("mball.hide_metaelems", text="Hide Selected").unselected = False
3484 layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
3487 class VIEW3D_MT_edit_lattice(Menu):
3488 bl_label = "Lattice"
3490 def draw(self, context):
3491 layout = self.layout
3495 layout.menu("VIEW3D_MT_transform")
3496 layout.menu("VIEW3D_MT_mirror")
3497 layout.menu("VIEW3D_MT_snap")
3498 layout.operator_menu_enum("lattice.flip", "axis")
3502 layout.operator("lattice.make_regular")
3506 layout.operator("object.vertex_parent_set")
3509 class VIEW3D_MT_edit_armature(Menu):
3510 bl_label = "Armature"
3512 def draw(self, context):
3513 layout = self.layout
3515 edit_object = context.edit_object
3516 arm = edit_object.data
3518 layout.menu("VIEW3D_MT_transform_armature")
3519 layout.menu("VIEW3D_MT_mirror")
3520 layout.menu("VIEW3D_MT_snap")
3521 layout.menu("VIEW3D_MT_edit_armature_roll")
3525 layout.operator("armature.extrude_move")
3527 if arm.use_mirror_x:
3528 layout.operator("armature.extrude_forked")
3530 layout.operator("armature.duplicate_move")
3531 layout.operator("armature.merge")
3532 layout.operator("armature.fill")
3533 layout.operator("armature.split")
3534 layout.operator("armature.separate")
3538 layout.operator("armature.subdivide", text="Subdivide")
3539 layout.operator("armature.switch_direction", text="Switch Direction")
3543 layout.operator_context = 'EXEC_AREA'
3544 layout.operator("armature.symmetrize")
3545 layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
3546 layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
3547 layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
3548 layout.operator("armature.flip_names")
3552 layout.operator_context = 'INVOKE_DEFAULT'
3553 layout.operator("armature.armature_layers")
3554 layout.operator("armature.bone_layers")
3558 layout.menu("VIEW3D_MT_edit_armature_parent")
3562 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
3566 layout.menu("VIEW3D_MT_edit_armature_delete")
3569 class VIEW3D_MT_armature_specials(Menu):
3570 bl_label = "Armature Context Menu"
3572 def draw(self, context):
3573 layout = self.layout
3575 layout.operator_context = 'INVOKE_REGION_WIN'
3577 layout.operator("armature.subdivide", text="Subdivide")
3578 layout.operator("armature.switch_direction", text="Switch Direction")