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 bl_ui.properties_paint_common import UnifiedPaintPanel
23 from bpy.app.translations import contexts as i18n_contexts
26 class VIEW3D_HT_header(Header):
27 bl_space_type = 'VIEW_3D'
29 def draw(self, context):
32 view = context.space_data
33 # mode_string = context.mode
34 obj = context.active_object
35 toolsettings = context.tool_settings
37 row = layout.row(align=True)
39 sub = row.row(align=True)
41 VIEW3D_MT_editor_menus.draw_collapsible(context, layout)
43 # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
45 layout.template_header_3D()
50 if mode == 'PARTICLE_EDIT':
51 row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
54 if ((view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or
55 (mode == 'WEIGHT_PAINT')):
56 row.prop(view, "use_occlude_geometry", text="")
58 # Proportional editing
59 if mode in {'EDIT', 'PARTICLE_EDIT'}:
60 row = layout.row(align=True)
61 row.prop(toolsettings, "proportional_edit", icon_only=True)
62 if toolsettings.proportional_edit != 'DISABLED':
63 row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
64 elif mode == 'OBJECT':
65 row = layout.row(align=True)
66 row.prop(toolsettings, "use_proportional_edit_objects", icon_only=True)
67 if toolsettings.use_proportional_edit_objects:
68 row.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
71 if not obj or mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
72 snap_element = toolsettings.snap_element
73 row = layout.row(align=True)
74 row.prop(toolsettings, "use_snap", text="")
75 row.prop(toolsettings, "snap_element", icon_only=True)
76 if snap_element != 'INCREMENT':
77 row.prop(toolsettings, "snap_target", text="")
79 if mode in {'OBJECT', 'POSE'} and snap_element != 'VOLUME':
80 row.prop(toolsettings, "use_snap_align_rotation", text="")
82 row.prop(toolsettings, "use_snap_self", text="")
84 if snap_element == 'VOLUME':
85 row.prop(toolsettings, "use_snap_peel_object", text="")
86 elif snap_element == 'FACE':
87 row.prop(toolsettings, "use_snap_project", text="")
91 if (mode == 'EDIT' and obj.type == 'MESH'):
92 layout.prop(toolsettings, "use_mesh_automerge", text="", icon='AUTOMERGE_ON')
95 row = layout.row(align=True)
96 row.operator("render.opengl", text="", icon='RENDER_STILL')
97 row.operator("render.opengl", text="", icon='RENDER_ANIMATION').animation = True
100 if obj and mode == 'POSE':
101 row = layout.row(align=True)
102 row.operator("pose.copy", text="", icon='COPYDOWN')
103 row.operator("pose.paste", text="", icon='PASTEDOWN')
104 row.operator("pose.paste", text="", icon='PASTEFLIPDOWN').flipped = 1
107 class VIEW3D_MT_editor_menus(Menu):
108 bl_space_type = 'VIEW3D_MT_editor_menus'
111 def draw(self, context):
112 self.draw_menus(self.layout, context)
115 def draw_menus(layout, context):
116 obj = context.active_object
117 mode_string = context.mode
118 edit_object = context.edit_object
120 layout.menu("VIEW3D_MT_view")
123 if mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
125 if mesh.use_paint_mask:
126 layout.menu("VIEW3D_MT_select_paint_mask")
127 elif mesh.use_paint_mask_vertex and mode_string == 'PAINT_WEIGHT':
128 layout.menu("VIEW3D_MT_select_paint_mask_vertex")
129 elif mode_string not in {'EDIT_TEXT', 'SCULPT'}:
130 layout.menu("VIEW3D_MT_select_%s" % mode_string.lower())
132 if mode_string == 'OBJECT':
133 layout.menu("INFO_MT_add", text="Add")
134 elif mode_string == 'EDIT_MESH':
135 layout.menu("INFO_MT_mesh_add", text="Add")
136 elif mode_string == 'EDIT_CURVE':
137 layout.menu("INFO_MT_curve_add", text="Add")
138 elif mode_string == 'EDIT_SURFACE':
139 layout.menu("INFO_MT_surface_add", text="Add")
140 elif mode_string == 'EDIT_METABALL':
141 layout.menu("INFO_MT_metaball_add", text="Add")
142 elif mode_string == 'EDIT_ARMATURE':
143 layout.menu("INFO_MT_edit_armature_add", text="Add")
146 layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
148 if mode_string not in {'PAINT_TEXTURE'}:
149 layout.menu("VIEW3D_MT_%s" % mode_string.lower())
150 if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
151 layout.menu("VIEW3D_MT_brush")
152 if mode_string == 'SCULPT':
153 layout.menu("VIEW3D_MT_hide_mask")
155 layout.menu("VIEW3D_MT_object")
158 # ********** Menu **********
161 # ********** Utilities **********
164 class ShowHideMenu():
165 bl_label = "Show/Hide"
168 def draw(self, context):
171 layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
172 layout.operator("%s.hide" % self._operator_name, text="Hide Selected").unselected = False
173 layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
176 # Standard transforms which apply to all cases
177 # NOTE: this doesn't seem to be able to be used directly
178 class VIEW3D_MT_transform_base(Menu):
179 bl_label = "Transform"
181 # TODO: get rid of the custom text strings?
182 def draw(self, context):
185 layout.operator("transform.translate", text="Grab/Move")
186 # TODO: sub-menu for grab per axis
187 layout.operator("transform.rotate", text="Rotate")
188 # TODO: sub-menu for rot per axis
189 layout.operator("transform.resize", text="Scale")
190 # TODO: sub-menu for scale per axis
194 layout.operator("transform.tosphere", text="To Sphere")
195 layout.operator("transform.shear", text="Shear")
196 layout.operator("transform.bend", text="Bend")
197 layout.operator("transform.push_pull", text="Push/Pull")
198 layout.operator("object.vertex_warp", text="Warp")
199 layout.operator("object.vertex_random", text="Randomize")
202 # Generic transform menu - geometry types
203 class VIEW3D_MT_transform(VIEW3D_MT_transform_base):
204 def draw(self, context):
206 VIEW3D_MT_transform_base.draw(self, context)
210 layout.operator("transform.shrink_fatten", text="Shrink Fatten")
214 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
215 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
218 # Object-specific extensions to Transform menu
219 class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
220 def draw(self, context):
224 VIEW3D_MT_transform_base.draw(self, context)
226 # object-specific option follow...
229 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
230 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
234 layout.operator_context = 'EXEC_REGION_WIN'
235 layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
239 layout.operator_context = 'EXEC_AREA'
241 layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
242 layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
243 layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
244 layout.operator("object.origin_set", text="Origin to Center of Mass").type = 'ORIGIN_CENTER_OF_MASS'
247 layout.operator("object.randomize_transform")
248 layout.operator("object.align")
252 layout.operator("object.anim_transforms_to_deltas")
255 # Armature EditMode extensions to Transform menu
256 class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
257 def draw(self, context):
261 VIEW3D_MT_transform_base.draw(self, context)
263 # armature specific extensions follow...
267 if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}:
268 if obj.data.draw_type == 'BBONE':
269 layout.operator("transform.transform", text="Scale BBone").mode = 'BONE_SIZE'
270 elif obj.data.draw_type == 'ENVELOPE':
271 layout.operator("transform.transform", text="Scale Envelope Distance").mode = 'BONE_SIZE'
272 layout.operator("transform.transform", text="Scale Radius").mode = 'BONE_ENVELOPE'
274 if context.edit_object and context.edit_object.type == 'ARMATURE':
275 layout.operator("armature.align")
278 class VIEW3D_MT_mirror(Menu):
281 def draw(self, context):
284 layout.operator("transform.mirror", text="Interactive Mirror")
288 layout.operator_context = 'INVOKE_REGION_WIN'
290 props = layout.operator("transform.mirror", text="X Global")
291 props.constraint_axis = (True, False, False)
292 props.constraint_orientation = 'GLOBAL'
293 props = layout.operator("transform.mirror", text="Y Global")
294 props.constraint_axis = (False, True, False)
295 props.constraint_orientation = 'GLOBAL'
296 props = layout.operator("transform.mirror", text="Z Global")
297 props.constraint_axis = (False, False, True)
298 props.constraint_orientation = 'GLOBAL'
300 if context.edit_object:
303 props = layout.operator("transform.mirror", text="X Local")
304 props.constraint_axis = (True, False, False)
305 props.constraint_orientation = 'LOCAL'
306 props = layout.operator("transform.mirror", text="Y Local")
307 props.constraint_axis = (False, True, False)
308 props.constraint_orientation = 'LOCAL'
309 props = layout.operator("transform.mirror", text="Z Local")
310 props.constraint_axis = (False, False, True)
311 props.constraint_orientation = 'LOCAL'
313 layout.operator("object.vertex_group_mirror")
316 class VIEW3D_MT_snap(Menu):
319 def draw(self, context):
322 layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
323 layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor").use_offset = False
324 layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor (Offset)").use_offset = True
328 layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
329 layout.operator("view3d.snap_cursor_to_center", text="Cursor to Center")
330 layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
331 layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
334 class VIEW3D_MT_uv_map(Menu):
335 bl_label = "UV Mapping"
337 def draw(self, context):
340 layout.operator("uv.unwrap")
342 layout.operator_context = 'INVOKE_DEFAULT'
343 layout.operator("uv.smart_project")
344 layout.operator("uv.lightmap_pack")
345 layout.operator("uv.follow_active_quads")
349 layout.operator_context = 'EXEC_REGION_WIN'
350 layout.operator("uv.cube_project")
351 layout.operator("uv.cylinder_project")
352 layout.operator("uv.sphere_project")
356 layout.operator_context = 'INVOKE_REGION_WIN'
357 layout.operator("uv.project_from_view").scale_to_bounds = False
358 layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
362 layout.operator("uv.reset")
365 # ********** View menus **********
368 class VIEW3D_MT_view(Menu):
371 def draw(self, context):
374 layout.operator("view3d.properties", icon='MENU_PANEL')
375 layout.operator("view3d.toolshelf", icon='MENU_PANEL')
379 layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA'
380 layout.operator("view3d.viewnumpad", text="Top").type = 'TOP'
381 layout.operator("view3d.viewnumpad", text="Bottom").type = 'BOTTOM'
382 layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT'
383 layout.operator("view3d.viewnumpad", text="Back").type = 'BACK'
384 layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT'
385 layout.operator("view3d.viewnumpad", text="Left").type = 'LEFT'
387 layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
391 layout.operator("view3d.view_persportho")
395 layout.menu("VIEW3D_MT_view_navigation")
396 layout.menu("VIEW3D_MT_view_align")
400 layout.operator_context = 'INVOKE_REGION_WIN'
402 layout.operator("view3d.clip_border", text="Clipping Border...")
403 layout.operator("view3d.zoom_border", text="Zoom Border...")
404 layout.operator("view3d.render_border", text="Render Border...")
408 layout.operator("view3d.layers", text="Show All Layers").nr = 0
412 layout.operator("view3d.localview", text="View Global/Local")
413 layout.operator("view3d.view_selected")
414 layout.operator("view3d.view_all")
418 layout.operator("screen.animation_play", text="Playback Animation")
422 layout.operator("screen.area_dupli")
423 layout.operator("screen.region_quadview")
424 layout.operator("screen.screen_full_area")
427 class VIEW3D_MT_view_navigation(Menu):
428 bl_label = "Navigation"
430 def draw(self, context):
434 layout.operator_enum("view3d.view_orbit", "type")
438 layout.operator("view3d.view_roll", text="Roll Left").angle = pi / -12.0
439 layout.operator("view3d.view_roll", text="Roll Right").angle = pi / 12.0
443 layout.operator_enum("view3d.view_pan", "type")
447 layout.operator("view3d.zoom", text="Zoom In").delta = 1
448 layout.operator("view3d.zoom", text="Zoom Out").delta = -1
449 layout.operator("view3d.zoom_camera_1_to_1", text="Zoom Camera 1:1")
453 layout.operator("view3d.fly")
454 layout.operator("view3d.walk")
457 class VIEW3D_MT_view_align(Menu):
458 bl_label = "Align View"
460 def draw(self, context):
463 layout.menu("VIEW3D_MT_view_align_selected")
467 layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
468 layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
469 layout.operator("view3d.camera_to_view_selected", text="Align Active Camera to Selected")
470 layout.operator("view3d.view_selected")
471 layout.operator("view3d.view_center_cursor")
475 layout.operator("view3d.view_lock_to_active")
476 layout.operator("view3d.view_lock_clear")
479 class VIEW3D_MT_view_align_selected(Menu):
480 bl_label = "Align View to Selected"
482 def draw(self, context):
485 props = layout.operator("view3d.viewnumpad", text="Top")
486 props.align_active = True
489 props = layout.operator("view3d.viewnumpad", text="Bottom")
490 props.align_active = True
491 props.type = 'BOTTOM'
493 props = layout.operator("view3d.viewnumpad", text="Front")
494 props.align_active = True
497 props = layout.operator("view3d.viewnumpad", text="Back")
498 props.align_active = True
501 props = layout.operator("view3d.viewnumpad", text="Right")
502 props.align_active = True
505 props = layout.operator("view3d.viewnumpad", text="Left")
506 props.align_active = True
510 class VIEW3D_MT_view_cameras(Menu):
513 def draw(self, context):
516 layout.operator("view3d.object_as_camera")
517 layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA'
519 # ********** Select menus, suffix from context.mode **********
522 class VIEW3D_MT_select_object(Menu):
525 def draw(self, context):
528 layout.operator("view3d.select_border")
529 layout.operator("view3d.select_circle")
533 layout.operator("object.select_all").action = 'TOGGLE'
534 layout.operator("object.select_all", text="Inverse").action = 'INVERT'
535 layout.operator("object.select_random", text="Random")
536 layout.operator("object.select_mirror", text="Mirror")
537 layout.operator("object.select_by_layer", text="Select All by Layer")
538 layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
539 layout.operator("object.select_camera", text="Select Camera")
543 layout.operator_menu_enum("object.select_grouped", "type", text="Grouped")
544 layout.operator_menu_enum("object.select_linked", "type", text="Linked")
545 layout.operator("object.select_pattern", text="Select Pattern...")
548 class VIEW3D_MT_select_pose(Menu):
551 def draw(self, context):
554 layout.operator("view3d.select_border")
555 layout.operator("view3d.select_circle")
559 layout.operator("pose.select_all").action = 'TOGGLE'
560 layout.operator("pose.select_all", text="Inverse").action = 'INVERT'
561 layout.operator("pose.select_mirror", text="Flip Active")
562 layout.operator("pose.select_constraint_target", text="Constraint Target")
563 layout.operator("pose.select_linked", text="Linked")
567 layout.operator("pose.select_hierarchy", text="Parent").direction = 'PARENT'
568 layout.operator("pose.select_hierarchy", text="Child").direction = 'CHILD'
572 props = layout.operator("pose.select_hierarchy", text="Extend Parent")
574 props.direction = 'PARENT'
576 props = layout.operator("pose.select_hierarchy", text="Extend Child")
578 props.direction = 'CHILD'
582 layout.operator_menu_enum("pose.select_grouped", "type", text="Grouped")
583 layout.operator("object.select_pattern", text="Select Pattern...")
586 class VIEW3D_MT_select_particle(Menu):
589 def draw(self, context):
592 layout.operator("view3d.select_border")
596 layout.operator("particle.select_all").action = 'TOGGLE'
597 layout.operator("particle.select_linked")
598 layout.operator("particle.select_all", text="Inverse").action = 'INVERT'
602 layout.operator("particle.select_more")
603 layout.operator("particle.select_less")
607 layout.operator("particle.select_roots", text="Roots")
608 layout.operator("particle.select_tips", text="Tips")
611 class VIEW3D_MT_select_edit_mesh(Menu):
614 def draw(self, context):
617 layout.operator("view3d.select_border")
618 layout.operator("view3d.select_circle")
623 layout.operator("mesh.select_all").action = 'TOGGLE'
624 layout.operator("mesh.select_all", text="Inverse").action = 'INVERT'
629 layout.operator("mesh.select_random", text="Random")
630 layout.operator("mesh.select_nth")
635 layout.operator("mesh.edges_select_sharp", text="Sharp Edges")
636 layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
641 layout.operator("mesh.select_loose", text="Loose Geometry")
642 if context.scene.tool_settings.mesh_select_mode[2] is False:
643 layout.operator("mesh.select_non_manifold", text="Non Manifold")
644 layout.operator("mesh.select_interior_faces", text="Interior Faces")
645 layout.operator("mesh.select_face_by_sides")
650 layout.operator_menu_enum("mesh.select_similar", "type", text="Similar")
651 layout.operator("mesh.select_ungrouped", text="Ungrouped Verts")
655 layout.operator("mesh.select_more", text="More")
656 layout.operator("mesh.select_less", text="Less")
660 layout.operator("mesh.select_mirror", text="Mirror")
661 layout.operator("mesh.select_axis", text="Side of Active")
663 layout.operator("mesh.select_linked", text="Linked")
664 layout.operator("mesh.shortest_path_select", text="Shortest Path")
665 layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False
666 layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
670 layout.operator("mesh.loop_to_region")
671 layout.operator("mesh.region_to_loop")
674 class VIEW3D_MT_select_edit_curve(Menu):
677 def draw(self, context):
680 layout.operator("view3d.select_border")
681 layout.operator("view3d.select_circle")
685 layout.operator("curve.select_all").action = 'TOGGLE'
686 layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
687 layout.operator("curve.select_random")
688 layout.operator("curve.select_nth")
689 layout.operator("curve.select_linked", text="Select Linked")
693 layout.operator("curve.de_select_first")
694 layout.operator("curve.de_select_last")
695 layout.operator("curve.select_next")
696 layout.operator("curve.select_previous")
700 layout.operator("curve.select_more")
701 layout.operator("curve.select_less")
704 class VIEW3D_MT_select_edit_surface(Menu):
707 def draw(self, context):
710 layout.operator("view3d.select_border")
711 layout.operator("view3d.select_circle")
715 layout.operator("curve.select_all").action = 'TOGGLE'
716 layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
717 layout.operator("curve.select_random")
718 layout.operator("curve.select_nth")
719 layout.operator("curve.select_linked", text="Select Linked")
723 layout.operator("curve.select_row")
727 layout.operator("curve.select_more")
728 layout.operator("curve.select_less")
731 class VIEW3D_MT_select_edit_text(Menu):
732 # intentional name mis-match
733 # select menu for 3d-text doesn't make sense
736 def draw(self, context):
739 layout.operator("font.text_copy", text="Copy")
740 layout.operator("font.text_cut", text="Cut")
741 layout.operator("font.text_paste", text="Paste")
745 layout.operator("font.text_paste_from_file")
746 layout.operator("font.text_paste_from_clipboard")
750 layout.operator("font.select_all")
753 class VIEW3D_MT_select_edit_metaball(Menu):
756 def draw(self, context):
759 layout.operator("view3d.select_border")
760 layout.operator("view3d.select_circle")
764 layout.operator("mball.select_all").action = 'TOGGLE'
765 layout.operator("mball.select_all", text="Inverse").action = 'INVERT'
769 layout.operator("mball.select_random_metaelems")
773 layout.operator_menu_enum("mball.select_similar", "type", text="Similar")
776 class VIEW3D_MT_select_edit_lattice(Menu):
779 def draw(self, context):
782 layout.operator("view3d.select_border")
783 layout.operator("view3d.select_circle")
787 layout.operator("lattice.select_mirror")
788 layout.operator("lattice.select_random")
789 layout.operator("lattice.select_all").action = 'TOGGLE'
790 layout.operator("lattice.select_all", text="Inverse").action = 'INVERT'
794 layout.operator("lattice.select_ungrouped", text="Ungrouped Verts")
797 class VIEW3D_MT_select_edit_armature(Menu):
800 def draw(self, context):
803 layout.operator("view3d.select_border")
804 layout.operator("view3d.select_circle")
808 layout.operator("armature.select_all").action = 'TOGGLE'
809 layout.operator("armature.select_all", text="Inverse").action = 'INVERT'
810 layout.operator("armature.select_mirror", text="Mirror").extend = False
814 layout.operator("armature.select_more", text="More")
815 layout.operator("armature.select_less", text="Less")
819 layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
820 layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
824 props = layout.operator("armature.select_hierarchy", text="Extend Parent")
826 props.direction = 'PARENT'
828 props = layout.operator("armature.select_hierarchy", text="Extend Child")
830 props.direction = 'CHILD'
832 layout.operator_menu_enum("armature.select_similar", "type", text="Similar")
833 layout.operator("object.select_pattern", text="Select Pattern...")
836 class VIEW3D_MT_select_paint_mask(Menu):
839 def draw(self, context):
842 layout.operator("view3d.select_border")
843 layout.operator("view3d.select_circle")
847 layout.operator("paint.face_select_all").action = 'TOGGLE'
848 layout.operator("paint.face_select_all", text="Inverse").action = 'INVERT'
852 layout.operator("paint.face_select_linked", text="Linked")
855 class VIEW3D_MT_select_paint_mask_vertex(Menu):
858 def draw(self, context):
861 layout.operator("view3d.select_border")
862 layout.operator("view3d.select_circle")
866 layout.operator("paint.vert_select_all").action = 'TOGGLE'
867 layout.operator("paint.vert_select_all", text="Inverse").action = 'INVERT'
871 layout.operator("paint.vert_select_ungrouped", text="Ungrouped Verts")
873 # ********** Add menu **********
875 # XXX: INFO_MT_ names used to keep backwards compatibility (Addons etc that hook into the menu)
878 class INFO_MT_mesh_add(Menu):
879 bl_idname = "INFO_MT_mesh_add"
882 def draw(self, context):
883 from .space_view3d_toolbar import VIEW3D_PT_tools_add_object
887 layout.operator_context = 'INVOKE_REGION_WIN'
889 VIEW3D_PT_tools_add_object.draw_add_mesh(layout)
892 class INFO_MT_curve_add(Menu):
893 bl_idname = "INFO_MT_curve_add"
896 def draw(self, context):
897 from .space_view3d_toolbar import VIEW3D_PT_tools_add_object
900 layout.operator_context = 'INVOKE_REGION_WIN'
902 VIEW3D_PT_tools_add_object.draw_add_curve(layout)
905 class INFO_MT_surface_add(Menu):
906 bl_idname = "INFO_MT_surface_add"
909 def draw(self, context):
910 from .space_view3d_toolbar import VIEW3D_PT_tools_add_object
913 layout.operator_context = 'INVOKE_REGION_WIN'
915 VIEW3D_PT_tools_add_object.draw_add_surface(layout)
918 class INFO_MT_metaball_add(Menu):
919 bl_idname = "INFO_MT_metaball_add"
920 bl_label = "Metaball"
922 def draw(self, context):
925 layout.operator_context = 'INVOKE_REGION_WIN'
926 layout.operator_enum("object.metaball_add", "type")
929 class INFO_MT_edit_curve_add(Menu):
930 bl_idname = "INFO_MT_edit_curve_add"
933 def draw(self, context):
934 is_surf = context.active_object.type == 'SURFACE'
937 layout.operator_context = 'EXEC_REGION_WIN'
940 INFO_MT_surface_add.draw(self, context)
942 INFO_MT_curve_add.draw(self, context)
945 class INFO_MT_edit_armature_add(Menu):
946 bl_idname = "INFO_MT_edit_armature_add"
947 bl_label = "Armature"
949 def draw(self, context):
952 layout.operator_context = 'EXEC_REGION_WIN'
953 layout.operator("armature.bone_primitive_add", text="Single Bone", icon='BONE_DATA')
956 class INFO_MT_armature_add(Menu):
957 bl_idname = "INFO_MT_armature_add"
958 bl_label = "Armature"
960 def draw(self, context):
963 layout.operator_context = 'EXEC_REGION_WIN'
964 layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
967 class INFO_MT_add(Menu):
970 def draw(self, context):
973 # note, don't use 'EXEC_SCREEN' or operators wont get the 'v3d' context.
975 # Note: was EXEC_AREA, but this context does not have the 'rv3d', which prevents
976 # "align_view" to work on first call (see [#32719]).
977 layout.operator_context = 'EXEC_REGION_WIN'
979 #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
980 layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
982 #layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
983 layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
984 #layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
985 layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
986 layout.menu("INFO_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
987 layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
990 layout.menu("INFO_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
991 layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
992 layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY')
995 layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
998 layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
999 layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
1002 layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY')
1005 if len(bpy.data.groups) > 10:
1006 layout.operator_context = 'INVOKE_REGION_WIN'
1007 layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY')
1009 layout.operator_menu_enum("object.group_instance_add", "group", text="Group Instance", icon='OUTLINER_OB_EMPTY')
1012 # ********** Object menu **********
1015 class VIEW3D_MT_object(Menu):
1016 bl_context = "objectmode"
1019 def draw(self, context):
1020 layout = self.layout
1022 layout.operator("ed.undo")
1023 layout.operator("ed.redo")
1024 layout.operator("ed.undo_history")
1028 layout.menu("VIEW3D_MT_transform_object")
1029 layout.menu("VIEW3D_MT_mirror")
1030 layout.menu("VIEW3D_MT_object_clear")
1031 layout.menu("VIEW3D_MT_object_apply")
1032 layout.menu("VIEW3D_MT_snap")
1036 layout.menu("VIEW3D_MT_object_animation")
1040 layout.operator("object.duplicate_move")
1041 layout.operator("object.duplicate_move_linked")
1042 layout.operator("object.delete", text="Delete...")
1043 layout.operator("object.proxy_make", text="Make Proxy...")
1044 layout.menu("VIEW3D_MT_make_links", text="Make Links...")
1045 layout.operator("object.make_dupli_face")
1046 layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
1047 layout.menu("VIEW3D_MT_make_single_user")
1051 layout.menu("VIEW3D_MT_object_parent")
1052 layout.menu("VIEW3D_MT_object_track")
1053 layout.menu("VIEW3D_MT_object_group")
1054 layout.menu("VIEW3D_MT_object_constraints")
1058 layout.menu("VIEW3D_MT_object_quick_effects")
1062 layout.menu("VIEW3D_MT_object_game")
1066 layout.operator("object.join")
1070 layout.operator("object.move_to_layer", text="Move to Layer...")
1071 layout.menu("VIEW3D_MT_object_showhide")
1073 layout.operator_menu_enum("object.convert", "target")
1076 class VIEW3D_MT_object_animation(Menu):
1077 bl_label = "Animation"
1079 def draw(self, context):
1080 layout = self.layout
1082 layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
1083 layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframes...")
1084 layout.operator("anim.keyframe_clear_v3d", text="Clear Keyframes...")
1085 layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
1089 layout.operator("nla.bake", text="Bake Action...")
1092 class VIEW3D_MT_object_clear(Menu):
1095 def draw(self, context):
1096 layout = self.layout
1098 layout.operator("object.location_clear", text="Location")
1099 layout.operator("object.rotation_clear", text="Rotation")
1100 layout.operator("object.scale_clear", text="Scale")
1101 layout.operator("object.origin_clear", text="Origin")
1104 class VIEW3D_MT_object_specials(Menu):
1105 bl_label = "Specials"
1108 def poll(cls, context):
1109 # add more special types
1110 return context.object
1112 def draw(self, context):
1113 layout = self.layout
1115 scene = context.scene
1116 obj = context.object
1118 if obj.type == 'CAMERA':
1119 layout.operator_context = 'INVOKE_REGION_WIN'
1121 if obj.data.type == 'PERSP':
1122 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
1123 props.data_path_iter = "selected_editable_objects"
1124 props.data_path_item = "data.lens"
1125 props.input_scale = 0.1
1126 if obj.data.lens_unit == 'MILLIMETERS':
1127 props.header_text = "Camera Lens Angle: %.1fmm"
1129 props.header_text = "Camera Lens Angle: %.1f\u00B0"
1132 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
1133 props.data_path_iter = "selected_editable_objects"
1134 props.data_path_item = "data.ortho_scale"
1135 props.input_scale = 0.01
1136 props.header_text = "Camera Lens Scale: %.3f"
1138 if not obj.data.dof_object:
1139 #layout.label(text="Test Has DOF obj");
1140 props = layout.operator("wm.context_modal_mouse", text="DOF Distance")
1141 props.data_path_iter = "selected_editable_objects"
1142 props.data_path_item = "data.dof_distance"
1143 props.input_scale = 0.02
1144 props.header_text = "DOF Distance: %.3f"
1146 if obj.type in {'CURVE', 'FONT'}:
1147 layout.operator_context = 'INVOKE_REGION_WIN'
1149 props = layout.operator("wm.context_modal_mouse", text="Extrude Size")
1150 props.data_path_iter = "selected_editable_objects"
1151 props.data_path_item = "data.extrude"
1152 props.input_scale = 0.01
1153 props.header_text = "Extrude Size: %.3f"
1155 props = layout.operator("wm.context_modal_mouse", text="Width Size")
1156 props.data_path_iter = "selected_editable_objects"
1157 props.data_path_item = "data.offset"
1158 props.input_scale = 0.01
1159 props.header_text = "Width Size: %.3f"
1161 if obj.type == 'EMPTY':
1162 layout.operator_context = 'INVOKE_REGION_WIN'
1164 props = layout.operator("wm.context_modal_mouse", text="Empty Draw Size")
1165 props.data_path_iter = "selected_editable_objects"
1166 props.data_path_item = "empty_draw_size"
1167 props.input_scale = 0.01
1168 props.header_text = "Empty Draw Size: %.3f"
1170 if obj.type == 'LAMP':
1173 layout.operator_context = 'INVOKE_REGION_WIN'
1175 if scene.render.use_shading_nodes:
1177 value = lamp.node_tree.nodes["Emission"].inputs["Strength"].default_value
1178 except AttributeError:
1181 if value is not None:
1182 props = layout.operator("wm.context_modal_mouse", text="Strength")
1183 props.data_path_iter = "selected_editable_objects"
1184 props.data_path_item = "data.node_tree.nodes[\"Emission\"].inputs[\"Strength\"].default_value"
1185 props.header_text = "Lamp Strength: %.3f"
1186 props.input_scale = 0.1
1189 if lamp.type == 'AREA':
1190 props = layout.operator("wm.context_modal_mouse", text="Size X")
1191 props.data_path_iter = "selected_editable_objects"
1192 props.data_path_item = "data.size"
1193 props.header_text = "Lamp Size X: %.3f"
1195 if lamp.shape == 'RECTANGLE':
1196 props = layout.operator("wm.context_modal_mouse", text="Size Y")
1197 props.data_path_iter = "selected_editable_objects"
1198 props.data_path_item = "data.size_y"
1199 props.header_text = "Lamp Size Y: %.3f"
1201 elif lamp.type in {'SPOT', 'POINT', 'SUN'}:
1202 props = layout.operator("wm.context_modal_mouse", text="Size")
1203 props.data_path_iter = "selected_editable_objects"
1204 props.data_path_item = "data.shadow_soft_size"
1205 props.header_text = "Lamp Size: %.3f"
1207 props = layout.operator("wm.context_modal_mouse", text="Energy")
1208 props.data_path_iter = "selected_editable_objects"
1209 props.data_path_item = "data.energy"
1210 props.header_text = "Lamp Energy: %.3f"
1212 if lamp.type in {'SPOT', 'AREA', 'POINT'}:
1213 props = layout.operator("wm.context_modal_mouse", text="Falloff Distance")
1214 props.data_path_iter = "selected_editable_objects"
1215 props.data_path_item = "data.distance"
1216 props.input_scale = 0.1
1217 props.header_text = "Lamp Falloff Distance: %.1f"
1219 if lamp.type == 'SPOT':
1221 props = layout.operator("wm.context_modal_mouse", text="Spot Size")
1222 props.data_path_iter = "selected_editable_objects"
1223 props.data_path_item = "data.spot_size"
1224 props.input_scale = 0.01
1225 props.header_text = "Spot Size: %.2f"
1227 props = layout.operator("wm.context_modal_mouse", text="Spot Blend")
1228 props.data_path_iter = "selected_editable_objects"
1229 props.data_path_item = "data.spot_blend"
1230 props.input_scale = -0.01
1231 props.header_text = "Spot Blend: %.2f"
1233 if not scene.render.use_shading_nodes:
1234 props = layout.operator("wm.context_modal_mouse", text="Clip Start")
1235 props.data_path_iter = "selected_editable_objects"
1236 props.data_path_item = "data.shadow_buffer_clip_start"
1237 props.input_scale = 0.05
1238 props.header_text = "Clip Start: %.2f"
1240 props = layout.operator("wm.context_modal_mouse", text="Clip End")
1241 props.data_path_iter = "selected_editable_objects"
1242 props.data_path_item = "data.shadow_buffer_clip_end"
1243 props.input_scale = 0.05
1244 props.header_text = "Clip End: %.2f"
1248 props = layout.operator("object.isolate_type_render")
1249 props = layout.operator("object.hide_render_clear_all")
1252 class VIEW3D_MT_object_apply(Menu):
1255 def draw(self, context):
1256 layout = self.layout
1258 props = layout.operator("object.transform_apply", text="Location", text_ctxt=i18n_contexts.default)
1259 props.location, props.rotation, props.scale = True, False, False
1261 props = layout.operator("object.transform_apply", text="Rotation", text_ctxt=i18n_contexts.default)
1262 props.location, props.rotation, props.scale = False, True, False
1264 props = layout.operator("object.transform_apply", text="Scale", text_ctxt=i18n_contexts.default)
1265 props.location, props.rotation, props.scale = False, False, True
1266 props = layout.operator("object.transform_apply", text="Rotation & Scale", text_ctxt=i18n_contexts.default)
1267 props.location, props.rotation, props.scale = False, True, True
1271 layout.operator("object.visual_transform_apply", text="Visual Transform", text_ctxt=i18n_contexts.default)
1272 layout.operator("object.duplicates_make_real")
1275 class VIEW3D_MT_object_parent(Menu):
1278 def draw(self, context):
1279 layout = self.layout
1281 layout.operator_enum("object.parent_set", "type")
1283 layout.operator_enum("object.parent_clear", "type")
1286 class VIEW3D_MT_object_track(Menu):
1289 def draw(self, context):
1290 layout = self.layout
1292 layout.operator_enum("object.track_set", "type")
1294 layout.operator_enum("object.track_clear", "type")
1297 class VIEW3D_MT_object_group(Menu):
1300 def draw(self, context):
1301 layout = self.layout
1303 layout.operator("group.create")
1304 # layout.operator_menu_enum("group.objects_remove", "group") # BUGGY
1305 layout.operator("group.objects_remove")
1306 layout.operator("group.objects_remove_all")
1310 layout.operator("group.objects_add_active")
1311 layout.operator("group.objects_remove_active")
1314 class VIEW3D_MT_object_constraints(Menu):
1315 bl_label = "Constraints"
1317 def draw(self, context):
1318 layout = self.layout
1320 layout.operator("object.constraint_add_with_targets")
1321 layout.operator("object.constraints_copy")
1322 layout.operator("object.constraints_clear")
1325 class VIEW3D_MT_object_quick_effects(Menu):
1326 bl_label = "Quick Effects"
1328 def draw(self, context):
1329 layout = self.layout
1331 layout.operator("object.quick_fur")
1332 layout.operator("object.quick_explode")
1333 layout.operator("object.quick_smoke")
1334 layout.operator("object.quick_fluid")
1337 class VIEW3D_MT_object_showhide(Menu):
1338 bl_label = "Show/Hide"
1340 def draw(self, context):
1341 layout = self.layout
1343 layout.operator("object.hide_view_clear", text="Show Hidden")
1344 layout.operator("object.hide_view_set", text="Hide Selected").unselected = False
1345 layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
1348 class VIEW3D_MT_make_single_user(Menu):
1349 bl_label = "Make Single User"
1351 def draw(self, context):
1352 layout = self.layout
1354 props = layout.operator("object.make_single_user", text="Object")
1356 props.obdata = props.material = props.texture = props.animation = False
1358 props = layout.operator("object.make_single_user", text="Object & Data")
1359 props.object = props.obdata = True
1360 props.material = props.texture = props.animation = False
1362 props = layout.operator("object.make_single_user", text="Object & Data & Materials+Tex")
1363 props.object = props.obdata = props.material = props.texture = True
1364 props.animation = False
1366 props = layout.operator("object.make_single_user", text="Materials+Tex")
1367 props.material = props.texture = True
1368 props.object = props.obdata = props.animation = False
1370 props = layout.operator("object.make_single_user", text="Object Animation")
1371 props.animation = True
1372 props.object = props.obdata = props.material = props.texture = False
1375 class VIEW3D_MT_make_links(Menu):
1376 bl_label = "Make Links"
1378 def draw(self, context):
1379 layout = self.layout
1380 operator_context_default = layout.operator_context
1381 if len(bpy.data.scenes) > 10:
1382 layout.operator_context = 'INVOKE_REGION_WIN'
1383 layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
1385 layout.operator_context = 'EXEC_REGION_WIN'
1386 layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
1387 layout.operator_context = operator_context_default
1389 layout.operator_enum("object.make_links_data", "type") # inline
1391 layout.operator("object.join_uvs") # stupid place to add this!
1394 class VIEW3D_MT_object_game(Menu):
1397 def draw(self, context):
1398 layout = self.layout
1400 layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks")
1401 layout.operator("object.game_physics_copy", text="Copy Physics Properties")
1405 layout.operator("object.game_property_copy", text="Replace Properties").operation = 'REPLACE'
1406 layout.operator("object.game_property_copy", text="Merge Properties").operation = 'MERGE'
1407 layout.operator_menu_enum("object.game_property_copy", "property", text="Copy Properties...")
1411 layout.operator("object.game_property_clear")
1414 # ********** Brush menu **********
1415 class VIEW3D_MT_brush(Menu):
1418 def draw(self, context):
1419 layout = self.layout
1421 settings = UnifiedPaintPanel.paint_settings(context)
1422 brush = settings.brush
1424 ups = context.tool_settings.unified_paint_settings
1425 layout.prop(ups, "use_unified_size", text="Unified Size")
1426 layout.prop(ups, "use_unified_strength", text="Unified Strength")
1430 layout.menu("VIEW3D_MT_brush_paint_modes")
1433 if context.sculpt_object:
1434 layout.operator("brush.reset")
1435 layout.prop_menu_enum(brush, "sculpt_tool")
1436 elif context.image_paint_object:
1437 layout.prop_menu_enum(brush, "image_tool")
1438 elif context.vertex_paint_object or context.weight_paint_object:
1439 layout.prop_menu_enum(brush, "vertex_tool")
1441 # skip if no active brush
1445 # TODO: still missing a lot of brush options here
1448 if context.sculpt_object:
1450 sculpt_tool = brush.sculpt_tool
1453 layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
1456 if sculpt_tool != 'GRAB':
1457 layout.prop_menu_enum(brush, "stroke_method")
1459 if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
1460 layout.prop_menu_enum(brush, "direction")
1462 if sculpt_tool == 'LAYER':
1463 layout.prop(brush, "use_persistent")
1464 layout.operator("sculpt.set_persistent_base")
1467 class VIEW3D_MT_brush_paint_modes(Menu):
1468 bl_label = "Enabled Modes"
1470 def draw(self, context):
1471 layout = self.layout
1473 settings = UnifiedPaintPanel.paint_settings(context)
1474 brush = settings.brush
1476 layout.prop(brush, "use_paint_sculpt", text="Sculpt")
1477 layout.prop(brush, "use_paint_vertex", text="Vertex Paint")
1478 layout.prop(brush, "use_paint_weight", text="Weight Paint")
1479 layout.prop(brush, "use_paint_image", text="Texture Paint")
1481 # ********** Vertex paint menu **********
1484 class VIEW3D_MT_paint_vertex(Menu):
1487 def draw(self, context):
1488 layout = self.layout
1490 layout.operator("ed.undo")
1491 layout.operator("ed.redo")
1495 layout.operator("paint.vertex_color_set")
1496 layout.operator("paint.vertex_color_smooth")
1497 layout.operator("paint.vertex_color_dirt")
1500 class VIEW3D_MT_hook(Menu):
1503 def draw(self, context):
1504 layout = self.layout
1505 layout.operator_context = 'EXEC_AREA'
1506 layout.operator("object.hook_add_newob")
1507 layout.operator("object.hook_add_selob").use_bone = False
1508 layout.operator("object.hook_add_selob", text="Hook to Selected Object Bone").use_bone = True
1510 if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
1512 layout.operator_menu_enum("object.hook_assign", "modifier")
1513 layout.operator_menu_enum("object.hook_remove", "modifier")
1515 layout.operator_menu_enum("object.hook_select", "modifier")
1516 layout.operator_menu_enum("object.hook_reset", "modifier")
1517 layout.operator_menu_enum("object.hook_recenter", "modifier")
1520 class VIEW3D_MT_vertex_group(Menu):
1521 bl_label = "Vertex Groups"
1523 def draw(self, context):
1524 layout = self.layout
1526 layout.operator_context = 'EXEC_AREA'
1527 layout.operator("object.vertex_group_assign_new")
1529 ob = context.active_object
1530 if ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex):
1531 if ob.vertex_groups.active:
1533 layout.operator("object.vertex_group_assign", text="Assign to Active Group")
1534 layout.operator("object.vertex_group_remove_from", text="Remove from Active Group").use_all_groups = False
1535 layout.operator("object.vertex_group_remove_from", text="Remove from All").use_all_groups = True
1538 if ob.vertex_groups.active:
1539 layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
1540 layout.operator("object.vertex_group_remove", text="Remove Active Group").all = False
1541 layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
1543 # ********** Weight paint menu **********
1546 class VIEW3D_MT_paint_weight(Menu):
1547 bl_label = "Weights"
1549 def draw(self, context):
1550 layout = self.layout
1552 layout.operator("ed.undo")
1553 layout.operator("ed.redo")
1554 layout.operator("ed.undo_history")
1558 layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
1559 layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
1563 layout.operator("object.vertex_group_normalize_all", text="Normalize All")
1564 layout.operator("object.vertex_group_normalize", text="Normalize")
1565 layout.operator("object.vertex_group_mirror", text="Mirror")
1566 layout.operator("object.vertex_group_invert", text="Invert")
1567 layout.operator("object.vertex_group_clean", text="Clean")
1568 layout.operator("object.vertex_group_quantize", text="Quantize")
1569 layout.operator("object.vertex_group_levels", text="Levels")
1570 layout.operator("object.vertex_group_blend", text="Blend")
1571 layout.operator("object.vertex_group_transfer_weight", text="Transfer Weights")
1572 layout.operator("object.vertex_group_limit_total", text="Limit Total")
1573 layout.operator("object.vertex_group_fix", text="Fix Deforms")
1577 layout.operator("paint.weight_set")
1579 # ********** Sculpt menu **********
1582 class VIEW3D_MT_sculpt(Menu):
1585 def draw(self, context):
1586 layout = self.layout
1588 toolsettings = context.tool_settings
1589 sculpt = toolsettings.sculpt
1591 layout.operator("ed.undo")
1592 layout.operator("ed.redo")
1596 layout.prop(sculpt, "use_symmetry_x")
1597 layout.prop(sculpt, "use_symmetry_y")
1598 layout.prop(sculpt, "use_symmetry_z")
1600 layout.prop(sculpt, "lock_x")
1601 layout.prop(sculpt, "lock_y")
1602 layout.prop(sculpt, "lock_z")
1605 layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
1606 layout.prop(sculpt, "show_low_resolution")
1607 layout.prop(sculpt, "show_brush")
1608 layout.prop(sculpt, "use_deform_only")
1609 layout.prop(sculpt, "show_diffuse_color")
1612 class VIEW3D_MT_hide_mask(Menu):
1613 bl_label = "Hide/Mask"
1615 def draw(self, context):
1616 layout = self.layout
1618 props = layout.operator("paint.hide_show", text="Show All")
1619 props.action = 'SHOW'
1622 props = layout.operator("paint.hide_show", text="Hide Bounding Box")
1623 props.action = 'HIDE'
1624 props.area = 'INSIDE'
1626 props = layout.operator("paint.hide_show", text="Show Bounding Box")
1627 props.action = 'SHOW'
1628 props.area = 'INSIDE'
1630 props = layout.operator("paint.hide_show", text="Hide Masked")
1631 props.area = 'MASKED'
1632 props.action = 'HIDE'
1636 props = layout.operator("paint.mask_flood_fill", text="Invert Mask")
1637 props.mode = 'INVERT'
1639 props = layout.operator("paint.mask_flood_fill", text="Fill Mask")
1640 props.mode = 'VALUE'
1643 props = layout.operator("paint.mask_flood_fill", text="Clear Mask")
1644 props.mode = 'VALUE'
1647 props = layout.operator("view3d.select_border", text="Box Mask")
1648 props = layout.operator("paint.mask_lasso_gesture", text="Lasso Mask")
1651 # ********** Particle menu **********
1654 class VIEW3D_MT_particle(Menu):
1655 bl_label = "Particle"
1657 def draw(self, context):
1658 layout = self.layout
1660 particle_edit = context.tool_settings.particle_edit
1662 layout.operator("ed.undo")
1663 layout.operator("ed.redo")
1664 layout.operator("ed.undo_history")
1668 layout.operator("particle.mirror")
1672 layout.operator("particle.remove_doubles")
1673 layout.operator("particle.delete")
1675 if particle_edit.select_mode == 'POINT':
1676 layout.operator("particle.subdivide")
1678 layout.operator("particle.rekey")
1679 layout.operator("particle.weight_set")
1683 layout.menu("VIEW3D_MT_particle_showhide")
1686 class VIEW3D_MT_particle_specials(Menu):
1687 bl_label = "Specials"
1689 def draw(self, context):
1690 layout = self.layout
1692 particle_edit = context.tool_settings.particle_edit
1694 layout.operator("particle.rekey")
1695 layout.operator("particle.delete")
1696 layout.operator("particle.remove_doubles")
1698 if particle_edit.select_mode == 'POINT':
1699 layout.operator("particle.subdivide")
1701 layout.operator("particle.weight_set")
1704 layout.operator("particle.mirror")
1706 if particle_edit.select_mode == 'POINT':
1708 layout.operator("particle.select_roots")
1709 layout.operator("particle.select_tips")
1713 layout.operator("particle.select_more")
1714 layout.operator("particle.select_less")
1718 layout.operator("particle.select_all").action = 'TOGGLE'
1719 layout.operator("particle.select_linked")
1720 layout.operator("particle.select_all", text="Inverse").action = 'INVERT'
1723 class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu):
1724 _operator_name = "particle"
1726 # ********** Pose Menu **********
1729 class VIEW3D_MT_pose(Menu):
1732 def draw(self, context):
1733 layout = self.layout
1735 layout.operator("ed.undo")
1736 layout.operator("ed.redo")
1737 layout.operator("ed.undo_history")
1741 layout.menu("VIEW3D_MT_transform_armature")
1743 layout.menu("VIEW3D_MT_pose_transform")
1744 layout.menu("VIEW3D_MT_pose_apply")
1746 layout.menu("VIEW3D_MT_snap")
1750 layout.menu("VIEW3D_MT_object_animation")
1754 layout.menu("VIEW3D_MT_pose_slide")
1755 layout.menu("VIEW3D_MT_pose_propagate")
1759 layout.operator("pose.copy")
1760 layout.operator("pose.paste")
1761 layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True
1765 layout.menu("VIEW3D_MT_pose_library")
1766 layout.menu("VIEW3D_MT_pose_motion")
1767 layout.menu("VIEW3D_MT_pose_group")
1771 layout.menu("VIEW3D_MT_object_parent")
1772 layout.menu("VIEW3D_MT_pose_ik")
1773 layout.menu("VIEW3D_MT_pose_constraints")
1777 layout.operator_context = 'EXEC_AREA'
1778 layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
1779 layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
1780 layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
1782 layout.operator("pose.flip_names")
1784 layout.operator("pose.quaternions_flip")
1788 layout.operator_context = 'INVOKE_AREA'
1789 layout.operator("pose.armature_layers", text="Change Armature Layers...")
1790 layout.operator("pose.bone_layers", text="Change Bone Layers...")
1794 layout.menu("VIEW3D_MT_pose_showhide")
1795 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
1798 class VIEW3D_MT_pose_transform(Menu):
1799 bl_label = "Clear Transform"
1801 def draw(self, context):
1802 layout = self.layout
1804 layout.operator("pose.transforms_clear", text="All")
1808 layout.operator("pose.loc_clear", text="Location")
1809 layout.operator("pose.rot_clear", text="Rotation")
1810 layout.operator("pose.scale_clear", text="Scale")
1814 layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
1817 class VIEW3D_MT_pose_slide(Menu):
1818 bl_label = "In-Betweens"
1820 def draw(self, context):
1821 layout = self.layout
1823 layout.operator("pose.push")
1824 layout.operator("pose.relax")
1825 layout.operator("pose.breakdown")
1828 class VIEW3D_MT_pose_propagate(Menu):
1829 bl_label = "Propagate"
1831 def draw(self, context):
1832 layout = self.layout
1834 layout.operator("pose.propagate").mode = 'WHILE_HELD'
1838 layout.operator("pose.propagate", text="To Next Keyframe").mode = 'NEXT_KEY'
1839 layout.operator("pose.propagate", text="To Last Keyframe (Make Cyclic)").mode = 'LAST_KEY'
1843 layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
1846 class VIEW3D_MT_pose_library(Menu):
1847 bl_label = "Pose Library"
1849 def draw(self, context):
1850 layout = self.layout
1852 layout.operator("poselib.browse_interactive", text="Browse Poses...")
1856 layout.operator("poselib.pose_add", text="Add Pose...")
1857 layout.operator("poselib.pose_rename", text="Rename Pose...")
1858 layout.operator("poselib.pose_remove", text="Remove Pose...")
1861 class VIEW3D_MT_pose_motion(Menu):
1862 bl_label = "Motion Paths"
1864 def draw(self, context):
1865 layout = self.layout
1867 layout.operator("pose.paths_calculate", text="Calculate")
1868 layout.operator("pose.paths_clear", text="Clear")
1871 class VIEW3D_MT_pose_group(Menu):
1872 bl_label = "Bone Groups"
1874 def draw(self, context):
1875 layout = self.layout
1877 pose = context.active_object.pose
1879 layout.operator_context = 'EXEC_AREA'
1880 layout.operator("pose.group_assign", text="Assign to New Group").type = 0
1881 if pose.bone_groups:
1882 active_group = pose.bone_groups.active_index + 1
1883 layout.operator("pose.group_assign", text="Assign to Group").type = active_group
1887 #layout.operator_context = 'INVOKE_AREA'
1888 layout.operator("pose.group_unassign")
1889 layout.operator("pose.group_remove")
1892 class VIEW3D_MT_pose_ik(Menu):
1893 bl_label = "Inverse Kinematics"
1895 def draw(self, context):
1896 layout = self.layout
1898 layout.operator("pose.ik_add")
1899 layout.operator("pose.ik_clear")
1902 class VIEW3D_MT_pose_constraints(Menu):
1903 bl_label = "Constraints"
1905 def draw(self, context):
1906 layout = self.layout
1908 layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
1909 layout.operator("pose.constraints_copy")
1910 layout.operator("pose.constraints_clear")
1913 class VIEW3D_MT_pose_showhide(ShowHideMenu, Menu):
1914 _operator_name = "pose"
1917 class VIEW3D_MT_pose_apply(Menu):
1920 def draw(self, context):
1921 layout = self.layout
1923 layout.operator("pose.armature_apply")
1924 layout.operator("pose.visual_transform_apply")
1927 class VIEW3D_MT_pose_specials(Menu):
1928 bl_label = "Specials"
1930 def draw(self, context):
1931 layout = self.layout
1933 layout.operator("paint.weight_from_bones", text="Assign Automatic from Bones").type = 'AUTOMATIC'
1934 layout.operator("paint.weight_from_bones", text="Assign from Bone Envelopes").type = 'ENVELOPES'
1938 layout.operator("pose.select_constraint_target")
1939 layout.operator("pose.flip_names")
1940 layout.operator("pose.paths_calculate")
1941 layout.operator("pose.paths_clear")
1942 layout.operator("pose.user_transforms_clear")
1943 layout.operator("pose.user_transforms_clear", text="Clear User Transforms (All)").only_selected = False
1944 layout.operator("pose.relax")
1948 layout.operator_menu_enum("pose.autoside_names", "axis")
1952 def draw(self, context):
1953 layout = self.layout
1958 "use_envelope_multiply",
1959 "use_inherit_rotation",
1960 "use_inherit_scale",
1963 if context.mode == 'EDIT_ARMATURE':
1964 bone_props = bpy.types.EditBone.bl_rna.properties
1965 data_path_iter = "selected_bones"
1967 options.append("lock")
1969 bone_props = bpy.types.Bone.bl_rna.properties
1970 data_path_iter = "selected_pose_bones"
1971 opt_suffix = "bone."
1974 props = layout.operator("wm.context_collection_boolean_set", text=bone_props[opt].name,
1975 text_ctxt=i18n_contexts.default)
1976 props.data_path_iter = data_path_iter
1977 props.data_path_item = opt_suffix + opt
1978 props.type = self.type
1981 class VIEW3D_MT_bone_options_toggle(Menu, BoneOptions):
1982 bl_label = "Toggle Bone Options"
1986 class VIEW3D_MT_bone_options_enable(Menu, BoneOptions):
1987 bl_label = "Enable Bone Options"
1991 class VIEW3D_MT_bone_options_disable(Menu, BoneOptions):
1992 bl_label = "Disable Bone Options"
1995 # ********** Edit Menus, suffix from ob.type **********
1998 class VIEW3D_MT_edit_mesh(Menu):
2001 def draw(self, context):
2002 layout = self.layout
2004 toolsettings = context.tool_settings
2006 layout.operator("ed.undo")
2007 layout.operator("ed.redo")
2008 layout.operator("ed.undo_history")
2012 layout.menu("VIEW3D_MT_transform")
2013 layout.menu("VIEW3D_MT_mirror")
2014 layout.menu("VIEW3D_MT_snap")
2018 layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...")
2022 layout.operator("mesh.duplicate_move")
2023 layout.menu("VIEW3D_MT_edit_mesh_extrude")
2024 layout.menu("VIEW3D_MT_edit_mesh_delete")
2028 layout.menu("VIEW3D_MT_edit_mesh_vertices")
2029 layout.menu("VIEW3D_MT_edit_mesh_edges")
2030 layout.menu("VIEW3D_MT_edit_mesh_faces")
2031 layout.menu("VIEW3D_MT_edit_mesh_normals")
2032 layout.menu("VIEW3D_MT_edit_mesh_clean")
2036 layout.operator("mesh.symmetrize")
2037 layout.operator("mesh.symmetry_snap")
2038 layout.operator("mesh.bisect")
2039 layout.operator_menu_enum("mesh.sort_elements", "type", text="Sort Elements...")
2043 layout.prop(toolsettings, "use_mesh_automerge")
2044 layout.prop_menu_enum(toolsettings, "proportional_edit")
2045 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
2049 layout.menu("VIEW3D_MT_edit_mesh_showhide")
2052 class VIEW3D_MT_edit_mesh_specials(Menu):
2053 bl_label = "Specials"
2055 def draw(self, context):
2056 layout = self.layout
2058 layout.operator_context = 'INVOKE_REGION_WIN'
2060 layout.operator("mesh.subdivide", text="Subdivide").smoothness = 0.0
2061 layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
2065 layout.operator("mesh.merge", text="Merge...")
2066 layout.operator("mesh.remove_doubles")
2070 layout.operator("mesh.hide", text="Hide").unselected = False
2071 layout.operator("mesh.reveal", text="Reveal")
2072 layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT'
2076 layout.operator("mesh.flip_normals")
2077 layout.operator("mesh.vertices_smooth", text="Smooth")
2078 layout.operator("mesh.vertices_smooth_laplacian", text="Laplacian Smooth")
2082 layout.operator("mesh.inset")
2083 layout.operator("mesh.bevel", text="Bevel")
2084 layout.operator("mesh.bridge_edge_loops")
2088 layout.operator("mesh.faces_shade_smooth")
2089 layout.operator("mesh.faces_shade_flat")
2093 layout.operator("mesh.blend_from_shape")
2094 layout.operator("mesh.shape_propagate_to_all")
2095 layout.operator("mesh.shortest_path_select")
2096 layout.operator("mesh.sort_elements")
2097 layout.operator("mesh.symmetrize")
2098 layout.operator("mesh.symmetry_snap")
2101 class VIEW3D_MT_edit_mesh_select_mode(Menu):
2102 bl_label = "Mesh Select Mode"
2104 def draw(self, context):
2105 layout = self.layout
2107 layout.operator_context = 'INVOKE_REGION_WIN'
2108 layout.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL').type = 'VERT'
2109 layout.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type = 'EDGE'
2110 layout.operator("mesh.select_mode", text="Face", icon='FACESEL').type = 'FACE'
2113 class VIEW3D_MT_edit_mesh_extrude(Menu):
2114 bl_label = "Extrude"
2117 'VERT': lambda layout:
2118 layout.operator("mesh.extrude_vertices_move", text="Vertices Only"),
2119 'EDGE': lambda layout:
2120 layout.operator("mesh.extrude_edges_move", text="Edges Only"),
2121 'FACE': lambda layout:
2122 layout.operator("mesh.extrude_faces_move", text="Individual Faces"),
2123 'REGION': lambda layout:
2124 layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"),
2125 'REGION_VERT_NORMAL': lambda layout:
2126 layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten", text="Region (Vertex Normals)"),
2130 def extrude_options(context):
2131 mesh = context.object.data
2132 select_mode = context.tool_settings.mesh_select_mode
2135 if mesh.total_face_sel:
2136 menu += ['REGION', 'REGION_VERT_NORMAL', 'FACE']
2137 if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
2139 if mesh.total_vert_sel and select_mode[0]:
2142 # should never get here
2145 def draw(self, context):
2146 layout = self.layout
2147 layout.operator_context = 'INVOKE_REGION_WIN'
2149 for menu_id in self.extrude_options(context):
2150 self._extrude_funcs[menu_id](layout)
2153 class VIEW3D_MT_edit_mesh_vertices(Menu):
2154 bl_label = "Vertices"
2156 def draw(self, context):
2157 layout = self.layout
2158 layout.operator_context = 'INVOKE_REGION_WIN'
2160 layout.operator("mesh.merge")
2161 layout.operator("mesh.rip_move")
2162 layout.operator("mesh.rip_move_fill")
2163 layout.operator("mesh.split")
2164 layout.operator_menu_enum("mesh.separate", "type")
2165 layout.operator("mesh.vert_connect", text="Connect")
2166 layout.operator("transform.vert_slide", text="Slide")
2170 op = layout.operator("mesh.mark_sharp", text="Shade Smooth")
2173 layout.operator("mesh.mark_sharp", text="Shade Sharp").use_verts = True
2177 layout.operator("mesh.bevel").vertex_only = True
2178 layout.operator("mesh.convex_hull")
2179 layout.operator("mesh.vertices_smooth")
2180 layout.operator("mesh.remove_doubles")
2182 layout.operator("mesh.blend_from_shape")
2184 layout.operator("object.vertex_group_blend")
2185 layout.operator("mesh.shape_propagate_to_all")
2189 layout.menu("VIEW3D_MT_vertex_group")
2190 layout.menu("VIEW3D_MT_hook")
2193 class VIEW3D_MT_edit_mesh_edges(Menu):
2196 def draw(self, context):
2197 layout = self.layout
2199 with_freestyle = bpy.app.build_options.freestyle
2200 scene = context.scene
2202 layout.operator_context = 'INVOKE_REGION_WIN'
2204 layout.operator("mesh.edge_face_add")
2205 layout.operator("mesh.subdivide")
2206 layout.operator("mesh.unsubdivide")
2210 layout.operator("transform.edge_crease")
2211 layout.operator("transform.edge_bevelweight")
2215 layout.operator("mesh.mark_seam").clear = False
2216 layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
2220 layout.operator("mesh.mark_sharp")
2221 layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
2225 if with_freestyle and not scene.render.use_shading_nodes:
2226 layout.operator("mesh.mark_freestyle_edge").clear = False
2227 layout.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True
2230 layout.operator("mesh.edge_rotate", text="Rotate Edge CW").use_ccw = False
2231 layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").use_ccw = True
2235 layout.operator("mesh.bevel").vertex_only = False
2236 layout.operator("mesh.edge_split")
2237 layout.operator("mesh.bridge_edge_loops")
2241 layout.operator("transform.edge_slide")
2242 layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False
2243 layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
2244 layout.operator("mesh.loop_to_region")
2245 layout.operator("mesh.region_to_loop")
2248 class VIEW3D_MT_edit_mesh_faces(Menu):
2250 bl_idname = "VIEW3D_MT_edit_mesh_faces"
2252 def draw(self, context):
2253 layout = self.layout
2255 with_freestyle = bpy.app.build_options.freestyle
2256 scene = context.scene
2258 layout.operator_context = 'INVOKE_REGION_WIN'
2260 layout.operator("mesh.flip_normals")
2261 layout.operator("mesh.edge_face_add")
2262 layout.operator("mesh.fill")
2263 layout.operator("mesh.fill_grid")
2264 layout.operator("mesh.beautify_fill")
2265 layout.operator("mesh.inset")
2266 layout.operator("mesh.bevel").vertex_only = False
2267 layout.operator("mesh.solidify")
2268 layout.operator("mesh.wireframe")
2272 if with_freestyle and not scene.render.use_shading_nodes:
2273 layout.operator("mesh.mark_freestyle_face").clear = False
2274 layout.operator("mesh.mark_freestyle_face", text="Clear Freestyle Face").clear = True
2277 layout.operator("mesh.poke")
2278 layout.operator("mesh.quads_convert_to_tris")
2279 layout.operator("mesh.tris_convert_to_quads")
2283 layout.operator("mesh.faces_shade_smooth")
2284 layout.operator("mesh.faces_shade_flat")
2288 layout.operator("mesh.edge_rotate", text="Rotate Edge CW").use_ccw = False
2292 layout.operator("mesh.uvs_rotate")
2293 layout.operator("mesh.uvs_reverse")
2294 layout.operator("mesh.colors_rotate")
2295 layout.operator("mesh.colors_reverse")
2298 class VIEW3D_MT_edit_mesh_normals(Menu):
2299 bl_label = "Normals"
2301 def draw(self, context):
2302 layout = self.layout
2304 layout.operator("mesh.normals_make_consistent", text="Recalculate Outside").inside = False
2305 layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True
2309 layout.operator("mesh.flip_normals")
2312 class VIEW3D_MT_edit_mesh_clean(Menu):
2313 bl_label = "Clean up"
2315 def draw(self, context):
2316 layout = self.layout
2318 layout.operator("mesh.delete_loose")
2322 layout.operator("mesh.dissolve_degenerate")
2323 layout.operator("mesh.dissolve_limited")
2324 layout.operator("mesh.vert_connect_nonplanar")
2325 layout.operator("mesh.fill_holes")
2328 class VIEW3D_MT_edit_mesh_delete(Menu):
2331 def draw(self, context):
2332 layout = self.layout
2334 layout.operator_enum("mesh.delete", "type")
2338 layout.operator("mesh.dissolve_verts")
2339 layout.operator("mesh.dissolve_edges")
2340 layout.operator("mesh.dissolve_faces")
2344 layout.operator("mesh.dissolve_limited")
2348 layout.operator("mesh.edge_collapse")
2349 layout.operator("mesh.delete_edgeloop", text="Edge Loop")
2352 class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu):
2353 _operator_name = "mesh"
2356 # draw_curve is used by VIEW3D_MT_edit_curve and VIEW3D_MT_edit_surface
2359 def draw_curve(self, context):
2360 layout = self.layout
2362 toolsettings = context.tool_settings
2364 layout.menu("VIEW3D_MT_transform")
2365 layout.menu("VIEW3D_MT_mirror")
2366 layout.menu("VIEW3D_MT_snap")
2370 layout.operator("curve.extrude_move")
2371 layout.operator("curve.duplicate_move")
2372 layout.operator("curve.split")
2373 layout.operator("curve.separate")
2374 layout.operator("curve.make_segment")
2375 layout.operator("curve.cyclic_toggle")
2376 layout.operator("curve.delete", text="Delete...")
2380 layout.menu("VIEW3D_MT_edit_curve_ctrlpoints")
2381 layout.menu("VIEW3D_MT_edit_curve_segments")
2385 layout.prop_menu_enum(toolsettings, "proportional_edit")
2386 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
2390 layout.menu("VIEW3D_MT_edit_curve_showhide")
2393 class VIEW3D_MT_edit_curve(Menu):
2399 class VIEW3D_MT_edit_curve_ctrlpoints(Menu):
2400 bl_label = "Control Points"
2402 def draw(self, context):
2403 layout = self.layout
2405 edit_object = context.edit_object
2407 if edit_object.type == 'CURVE':
2408 layout.operator("transform.tilt")
2409 layout.operator("curve.tilt_clear")
2410 layout.operator("curve.separate")
2414 layout.operator_menu_enum("curve.handle_type_set", "type")
2415 layout.operator("curve.normals_make_consistent")
2419 layout.menu("VIEW3D_MT_hook")
2422 class VIEW3D_MT_edit_curve_segments(Menu):
2423 bl_label = "Segments"
2425 def draw(self, context):
2426 layout = self.layout
2428 layout.operator("curve.subdivide")
2429 layout.operator("curve.switch_direction")
2432 class VIEW3D_MT_edit_curve_specials(Menu):
2433 bl_label = "Specials"
2435 def draw(self, context):
2436 layout = self.layout
2438 layout.operator("curve.subdivide")
2439 layout.operator("curve.switch_direction")
2440 layout.operator("curve.spline_weight_set")
2441 layout.operator("curve.radius_set")
2442 layout.operator("curve.smooth")
2443 layout.operator("curve.smooth_weight")
2444 layout.operator("curve.smooth_radius")
2445 layout.operator("curve.smooth_tilt")
2448 class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, Menu):
2449 _operator_name = "curve"
2452 class VIEW3D_MT_edit_surface(Menu):
2453 bl_label = "Surface"
2458 class VIEW3D_MT_edit_font(Menu):
2461 def draw(self, context):
2462 layout = self.layout
2464 layout.menu("VIEW3D_MT_edit_text_chars")
2468 layout.operator("font.style_toggle", text="Toggle Bold").style = 'BOLD'
2469 layout.operator("font.style_toggle", text="Toggle Italic").style = 'ITALIC'
2470 layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE'
2471 layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS'
2475 layout.operator("font.insert_lorem")
2478 class VIEW3D_MT_edit_text_chars(Menu):
2479 bl_label = "Special Characters"
2481 def draw(self, context):
2482 layout = self.layout
2484 layout.operator("font.text_insert", text="Copyright|Alt C").text = "\u00A9"
2485 layout.operator("font.text_insert", text="Registered Trademark|Alt R").text = "\u00AE"
2489 layout.operator("font.text_insert", text="Degree Sign|Alt G").text = "\u00B0"
2490 layout.operator("font.text_insert", text="Multiplication Sign|Alt x").text = "\u00D7"
2491 layout.operator("font.text_insert", text="Circle|Alt .").text = "\u008A"
2492 layout.operator("font.text_insert", text="Superscript 1|Alt 1").text = "\u00B9"
2493 layout.operator("font.text_insert", text="Superscript 2|Alt 2").text = "\u00B2"
2494 layout.operator("font.text_insert", text="Superscript 3|Alt 3").text = "\u00B3"
2495 layout.operator("font.text_insert", text="Double >>|Alt >").text = "\u00BB"
2496 layout.operator("font.text_insert", text="Double <<|Alt <").text = "\u00AB"
2497 layout.operator("font.text_insert", text="Promillage|Alt %").text = "\u2030"
2501 layout.operator("font.text_insert", text="Dutch Florin|Alt F").text = "\u00A4"
2502 layout.operator("font.text_insert", text="British Pound|Alt L").text = "\u00A3"
2503 layout.operator("font.text_insert", text="Japanese Yen|Alt Y").text = "\u00A5"
2507 layout.operator("font.text_insert", text="German S|Alt S").text = "\u00DF"
2508 layout.operator("font.text_insert", text="Spanish Question Mark|Alt ?").text = "\u00BF"
2509 layout.operator("font.text_insert", text="Spanish Exclamation Mark|Alt !").text = "\u00A1"
2512 class VIEW3D_MT_edit_meta(Menu):
2513 bl_label = "Metaball"
2515 def draw(self, context):
2516 layout = self.layout
2518 toolsettings = context.tool_settings
2520 layout.operator("ed.undo")
2521 layout.operator("ed.redo")
2522 layout.operator("ed.undo_history")
2526 layout.menu("VIEW3D_MT_transform")
2527 layout.menu("VIEW3D_MT_mirror")
2528 layout.menu("VIEW3D_MT_snap")
2532 layout.operator("mball.delete_metaelems", text="Delete...")
2533 layout.operator("mball.duplicate_metaelems")
2537 layout.prop_menu_enum(toolsettings, "proportional_edit")
2538 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
2542 layout.menu("VIEW3D_MT_edit_meta_showhide")
2545 class VIEW3D_MT_edit_meta_showhide(Menu):
2546 bl_label = "Show/Hide"
2548 def draw(self, context):
2549 layout = self.layout
2551 layout.operator("mball.reveal_metaelems", text="Show Hidden")
2552 layout.operator("mball.hide_metaelems", text="Hide Selected").unselected = False
2553 layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
2556 class VIEW3D_MT_edit_lattice(Menu):
2557 bl_label = "Lattice"
2559 def draw(self, context):
2560 layout = self.layout
2562 toolsettings = context.tool_settings
2564 layout.menu("VIEW3D_MT_transform")
2565 layout.menu("VIEW3D_MT_mirror")
2566 layout.menu("VIEW3D_MT_snap")
2567 layout.operator_menu_enum("lattice.flip", "axis")
2571 layout.operator("lattice.make_regular")
2575 layout.prop_menu_enum(toolsettings, "proportional_edit")
2576 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
2579 class VIEW3D_MT_edit_armature(Menu):
2580 bl_label = "Armature"
2582 def draw(self, context):
2583 layout = self.layout
2585 edit_object = context.edit_object
2586 arm = edit_object.data
2588 layout.menu("VIEW3D_MT_transform_armature")
2589 layout.menu("VIEW3D_MT_mirror")
2590 layout.menu("VIEW3D_MT_snap")
2591 layout.menu("VIEW3D_MT_edit_armature_roll")
2595 layout.operator("armature.extrude_move")
2597 if arm.use_mirror_x:
2598 layout.operator("armature.extrude_forked")
2600 layout.operator("armature.duplicate_move")
2601 layout.operator("armature.merge")
2602 layout.operator("armature.fill")
2603 layout.operator("armature.delete")
2604 layout.operator("armature.split")
2605 layout.operator("armature.separate")
2609 layout.operator("armature.subdivide", text="Subdivide")
2610 layout.operator("armature.switch_direction", text="Switch Direction")
2614 layout.operator_context = 'EXEC_AREA'
2615 layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
2616 layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
2617 layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
2618 layout.operator("armature.flip_names")
2622 layout.operator_context = 'INVOKE_DEFAULT'
2623 layout.operator("armature.armature_layers")
2624 layout.operator("armature.bone_layers")
2628 layout.menu("VIEW3D_MT_edit_armature_parent")
2632 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
2635 class VIEW3D_MT_armature_specials(Menu):
2636 bl_label = "Specials"
2638 def draw(self, context):
2639 layout = self.layout
2641 layout.operator_context = 'INVOKE_REGION_WIN'
2643 layout.operator("armature.subdivide", text="Subdivide")
2644 layout.operator("armature.switch_direction", text="Switch Direction")
2648 layout.operator_context = 'EXEC_REGION_WIN'
2649 layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
2650 layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
2651 layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
2652 layout.operator("armature.flip_names", text="Flip Names")
2655 class VIEW3D_MT_edit_armature_parent(Menu):
2658 def draw(self, context):
2659 layout = self.layout
2661 layout.operator("armature.parent_set", text="Make")
2662 layout.operator("armature.parent_clear", text="Clear")
2665 class VIEW3D_MT_edit_armature_roll(Menu):
2666 bl_label = "Bone Roll"
2668 def draw(self, context):
2669 layout = self.layout
2671 layout.operator_menu_enum("armature.calculate_roll", "type")
2675 layout.operator("transform.transform", text="Set Roll").mode = 'BONE_ROLL'
2677 # ********** Panel **********
2680 class VIEW3D_PT_view3d_properties(Panel):
2681 bl_space_type = 'VIEW_3D'
2682 bl_region_type = 'UI'
2686 def poll(cls, context):
2687 view = context.space_data
2690 def draw(self, context):
2691 layout = self.layout
2693 view = context.space_data
2695 col = layout.column()
2696 col.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews)
2697 col.prop(view, "lens")
2698 col.label(text="Lock to Object:")
2699 col.prop(view, "lock_object", text="")
2700 lock_object = view.lock_object
2702 if lock_object.type == 'ARMATURE':
2703 col.prop_search(view, "lock_bone", lock_object.data,
2704 "edit_bones" if lock_object.mode == 'EDIT'
2708 col.prop(view, "lock_cursor", text="Lock to Cursor")
2710 col = layout.column()
2711 col.prop(view, "lock_camera")
2713 col = layout.column(align=True)
2714 col.label(text="Clip:")
2715 col.prop(view, "clip_start", text="Start")
2716 col.prop(view, "clip_end", text="End")
2718 subcol = col.column(align=True)
2719 subcol.enabled = not view.lock_camera_and_layers
2720 subcol.label(text="Local Camera:")
2721 subcol.prop(view, "camera", text="")
2723 col = layout.column(align=True)
2724 col.prop(view, "use_render_border")
2725 col.active = view.region_3d.view_perspective != 'CAMERA'
2728 class VIEW3D_PT_view3d_cursor(Panel):
2729 bl_space_type = 'VIEW_3D'
2730 bl_region_type = 'UI'
2731 bl_label = "3D Cursor"
2734 def poll(cls, context):
2735 view = context.space_data
2736 return (view is not None)
2738 def draw(self, context):
2739 layout = self.layout
2741 view = context.space_data
2742 layout.column().prop(view, "cursor_location", text="Location")
2745 class VIEW3D_PT_view3d_name(Panel):
2746 bl_space_type = 'VIEW_3D'
2747 bl_region_type = 'UI'
2751 def poll(cls, context):
2752 return (context.space_data and context.active_object)
2754 def draw(self, context):
2755 layout = self.layout
2757 ob = context.active_object
2759 row.label(text="", icon='OBJECT_DATA')
2760 row.prop(ob, "name", text="")
2762 if ob.type == 'ARMATURE' and ob.mode in {'EDIT', 'POSE'}:
2763 bone = context.active_bone
2766 row.label(text="", icon='BONE_DATA')
2767 row.prop(bone, "name", text="")
2769 elif ob.type == 'MESH':
2772 row.prop(me, "use_auto_smooth")
2774 if not me.use_auto_smooth:
2776 row.prop(me, "auto_smooth_angle", text="")
2779 class VIEW3D_PT_view3d_display(Panel):
2780 bl_space_type = 'VIEW_3D'
2781 bl_region_type = 'UI'
2782 bl_label = "Display"
2783 bl_options = {'DEFAULT_CLOSED'}
2786 def poll(cls, context):
2787 view = context.space_data
2790 def draw(self, context):
2791 layout = self.layout
2793 view = context.space_data
2794 scene = context.scene
2796 col = layout.column()
2797 col.prop(view, "show_only_render")
2799 col = layout.column()
2800 display_all = not view.show_only_render
2801 col.active = display_all
2802 col.prop(view, "show_outline_selected")
2803 col.prop(view, "show_all_objects_origin")
2804 col.prop(view, "show_relationship_lines")
2806 col = layout.column()
2807 col.active = display_all
2808 split = col.split(percentage=0.55)
2809 split.prop(view, "show_floor", text="Grid Floor")
2811 row = split.row(align=True)
2812 row.prop(view, "show_axis_x", text="X", toggle=True)
2813 row.prop(view, "show_axis_y", text="Y", toggle=True)
2814 row.prop(view, "show_axis_z", text="Z", toggle=True)
2816 sub = col.column(align=True)
2817 sub.active = (display_all and view.show_floor)
2818 sub.prop(view, "grid_lines", text="Lines")
2819 sub.prop(view, "grid_scale", text="Scale")
2820 subsub = sub.column(align=True)
2821 subsub.active = scene.unit_settings.system == 'NONE'
2822 subsub.prop(view, "grid_subdivisions", text="Subdivisions")
2826 layout.operator("screen.region_quadview", text="Toggle Quad View")
2828 if view.region_quadviews:
2829 region = view.region_quadviews[2]
2830 col = layout.column()
2831 col.prop(region, "lock_rotation")
2833 row.enabled = region.lock_rotation
2834 row.prop(region, "show_sync_view")
2836 row.enabled = region.lock_rotation and region.show_sync_view
2837 row.prop(region, "use_box_clip")
2840 class VIEW3D_PT_view3d_shading(Panel):
2841 bl_space_type = 'VIEW_3D'
2842 bl_region_type = 'UI'
2843 bl_label = "Shading"
2844 bl_options = {'DEFAULT_CLOSED'}
2847 def poll(cls, context):
2848 view = context.space_data
2851 def draw(self, context):
2852 layout = self.layout
2854 view = context.space_data
2855 scene = context.scene
2856 gs = scene.game_settings
2857 obj = context.object
2859 col = layout.column()
2861 if not scene.render.use_shading_nodes:
2862 col.prop(gs, "material_mode", text="")
2864 if view.viewport_shade == 'SOLID':
2865 col.prop(view, "show_textured_solid")
2866 col.prop(view, "use_matcap")
2868 col.template_icon_view(view, "matcap_icon")
2869 elif view.viewport_shade == 'TEXTURED':
2870 if scene.render.use_shading_nodes or gs.material_mode != 'GLSL':
2871 col.prop(view, "show_textured_shadeless")
2873 col.prop(view, "show_backface_culling")
2874 if obj and obj.mode == 'EDIT' and view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'}:
2875 col.prop(view, "show_occlude_wire")
2878 class VIEW3D_PT_view3d_motion_tracking(Panel):
2879 bl_space_type = 'VIEW_3D'
2880 bl_region_type = 'UI'
2881 bl_label = "Motion Tracking"
2882 bl_options = {'DEFAULT_CLOSED'}
2885 def poll(cls, context):
2886 view = context.space_data
2889 def draw_header(self, context):
2890 view = context.space_data
2892 self.layout.prop(view, "show_reconstruction", text="")
2894 def draw(self, context):
2895 layout = self.layout
2897 view = context.space_data
2899 col = layout.column()
2900 col.active = view.show_reconstruction
2901 col.prop(view, "show_camera_path", text="Camera Path")
2902 col.prop(view, "show_bundle_names", text="3D Marker Names")
2903 col.label(text="Track Type and Size:")
2904 row = col.row(align=True)
2905 row.prop(view, "tracks_draw_type", text="")
2906 row.prop(view, "tracks_draw_size", text="")
2909 class VIEW3D_PT_view3d_meshdisplay(Panel):
2910 bl_space_type = 'VIEW_3D'
2911 bl_region_type = 'UI'
2912 bl_label = "Mesh Display"
2915 def poll(cls, context):
2916 # The active object check is needed because of local-mode
2917 return (context.active_object and (context.mode == 'EDIT_MESH'))
2919 def draw(self, context):
2920 layout = self.layout
2921 with_freestyle = bpy.app.build_options.freestyle
2923 mesh = context.active_object.data
2924 scene = context.scene
2926 split = layout.split()
2928 col = split.column()
2929 col.label(text="Overlays:")
2930 col.prop(mesh, "show_faces", text="Faces")
2931 col.prop(mesh, "show_edges", text="Edges")
2932 col.prop(mesh, "show_edge_crease", text="Creases")
2934 col.prop(mesh, "show_edge_seams", text="Seams")
2936 layout.prop(mesh, "show_weight")
2938 col = split.column()
2940 if not with_freestyle:
2941 col.prop(mesh, "show_edge_seams", text="Seams")
2942 col.prop(mesh, "show_edge_sharp", text="Sharp", text_ctxt=i18n_contexts.plural)
2943 col.prop(mesh, "show_edge_bevel_weight", text="Bevel")
2944 if with_freestyle and not scene.render.use_shading_nodes:
2945 col.prop(mesh, "show_freestyle_edge_marks", text="Edge Marks")
2946 col.prop(mesh, "show_freestyle_face_marks", text="Face Marks")
2948 col = layout.column()
2951 col.label(text="Normals:")
2952 row = col.row(align=True)
2954 row.prop(mesh, "show_normal_vertex", text="", icon='VERTEXSEL')
2955 row.prop(mesh, "show_normal_loop", text="", icon='VERTEXSEL')
2956 row.prop(mesh, "show_normal_face", text="", icon='FACESEL')
2958 sub = row.row(align=True)
2959 sub.active = mesh.show_normal_vertex or mesh.show_normal_face or mesh.show_normal_loop
2960 sub.prop(context.scene.tool_settings, "normal_size", text="Size")
2963 split = layout.split()
2964 col = split.column()
2965 col.label(text="Edge Info:")
2966 col.prop(mesh, "show_extra_edge_length", text="Length")
2967 col.prop(mesh, "show_extra_edge_angle", text="Angle")
2968 col = split.column()
2969 col.label(text="Face Info:")
2970 col.prop(mesh, "show_extra_face_area", text="Area")
2971 col.prop(mesh, "show_extra_face_angle", text="Angle")
2973 layout.prop(mesh, "show_extra_indices")
2976 class VIEW3D_PT_view3d_meshstatvis(Panel):
2977 bl_space_type = 'VIEW_3D'
2978 bl_region_type = 'UI'
2979 bl_label = "Mesh Analysis"
2982 def poll(cls, context):
2983 # The active object check is needed because of local-mode
2984 return (context.active_object and (context.mode == 'EDIT_MESH'))
2986 def draw_header(self, context):
2987 mesh = context.active_object.data
2989 self.layout.prop(mesh, "show_statvis", text="")
2991 def draw(self, context):
2992 layout = self.layout
2994 mesh = context.active_object.data
2995 statvis = context.tool_settings.statvis
2996 layout.active = mesh.show_statvis
2998 layout.prop(statvis, "type")
2999 statvis_type = statvis.type
3000 if statvis_type == 'OVERHANG':
3001 row = layout.row(align=True)
3002 row.prop(statvis, "overhang_min", text="")
3003 row.prop(statvis, "overhang_max", text="")
3004 layout.prop(statvis, "overhang_axis", expand=True)
3005 elif statvis_type == 'THICKNESS':
3006 row = layout.row(align=True)
3007 row.prop(statvis, "thickness_min", text="")
3008 row.prop(statvis, "thickness_max", text="")
3009 layout.prop(statvis, "thickness_samples")
3010 elif statvis_type == 'INTERSECT':
3012 elif statvis_type == 'DISTORT':
3013 row = layout.row(align=True)
3014 row.prop(statvis, "distort_min", text="")
3015 row.prop(statvis, "distort_max", text="")
3016 elif statvis_type == 'SHARP':
3017 row = layout.row(align=True)
3018 row.prop(statvis, "sharp_min", text="")
3019 row.prop(statvis, "sharp_max", text="")
3022 class VIEW3D_PT_view3d_curvedisplay(Panel):
3023 bl_space_type = 'VIEW_3D'
3024 bl_region_type = 'UI'
3025 bl_label = "Curve Display"
3028 def poll(cls, context):
3029 editmesh = context.mode == 'EDIT_CURVE'
3032 def draw(self, context):
3033 layout = self.layout
3035 curve = context.active_object.data
3037 col = layout.column()
3039 row.prop(curve, "show_handles", text="Handles")
3040 row.prop(curve, "show_normal_face", text="Normals")
3041 col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
3044 class VIEW3D_PT_background_image(Panel):
3045 bl_space_type = 'VIEW_3D'
3046 bl_region_type = 'UI'
3047 bl_label = "Background Images"
3048 bl_options = {'DEFAULT_CLOSED'}
3050 def draw_header(self, context):
3051 view = context.space_data
3053 self.layout.prop(view, "show_background_images", text="")
3055 def draw(self, context):
3056 layout = self.layout
3058 view = context.space_data
3060 col = layout.column()
3061 col.operator("view3d.background_image_add", text="Add Image")
3063 for i, bg in enumerate(view.background_images):
3064 layout.active = view.show_background_images
3066 row = box.row(align=True)
3067 row.prop(bg, "show_expanded", text="", emboss=False)
3068 if bg.source == 'IMAGE' and bg.image:
3069 row.prop(bg.image, "name", text="", emboss=False)
3070 elif bg.source == 'MOVIE_CLIP' and bg.clip:
3071 row.prop(bg.clip, "name", text="", emboss=False)
3073 row.label(text="Not Set")
3075 if bg.show_background_image:
3076 row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_OFF')
3078 row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_ON')
3080 row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
3082 box.prop(bg, "view_axis", text="Axis")
3084 if bg.show_expanded:
3086 row.prop(bg, "source", expand=True)
3089 if bg.source == 'IMAGE':
3091 row.template_ID(bg, "image", open="image.open")
3092 if bg.image is not None:
3093 box.template_image(bg, "image", bg.image_user, compact=True)
3096 elif bg.source == 'MOVIE_CLIP':
3097 box.prop(bg, "use_camera_clip")
3099 column = box.column()
3100 column.active = not bg.use_camera_clip
3101 column.template_ID(bg, "clip", open="clip.open")
3104 column.template_movieclip(bg, "clip", compact=True)
3106 if bg.use_camera_clip or bg.clip:
3109 column = box.column()
3110 column.active = has_bg
3111 column.prop(bg.clip_user, "proxy_render_size", text="")
3112 column.prop(bg.clip_user, "use_render_undistorted")
3116 col.prop(bg, "opacity", slider=True)
3117 col.row().prop(bg, "draw_depth", expand=True)
3119 if bg.view_axis in {'CAMERA', 'ALL'}:
3120 col.row().prop(bg, "frame_method", expand=True)
3122 row = col.row(align=True)
3123 row.prop(bg, "offset_x", text="X")
3124 row.prop(bg, "offset_y", text="Y")
3126 if bg.view_axis != 'CAMERA':
3127 col.prop(bg, "size")
3130 class VIEW3D_PT_transform_orientations(Panel):
3131 bl_space_type = 'VIEW_3D'
3132 bl_region_type = 'UI'
3133 bl_label = "Transform Orientations"
3134 bl_options = {'DEFAULT_CLOSED'}
3137 def poll(cls, context):
3138 view = context.space_data
3141 def draw(self, context):
3142 layout = self.layout
3144 view = context.space_data
3145 orientation = view.current_orientation
3147 row = layout.row(align=True)
3148 row.prop(view, "transform_orientation", text="")
3149 row.operator("transform.create_orientation", text="", icon='ZOOMIN')
3152 row = layout.row(align=True)
3153 row.prop(orientation, "name", text="")
3154 row.operator("transform.delete_orientation", text="", icon='X')
3157 class VIEW3D_PT_etch_a_ton(Panel):
3158 bl_space_type = 'VIEW_3D'
3159 bl_region_type = 'UI'
3160 bl_label = "Skeleton Sketching"
3161 bl_options = {'DEFAULT_CLOSED'}
3164 def poll(cls, context):
3165 scene = context.space_data
3166 ob = context.active_object
3167 return scene and ob and ob.type == 'ARMATURE' and ob.mode == 'EDIT'
3169 def draw_header(self, context):
3170 layout = self.layout
3171 toolsettings = context.scene.tool_settings
3173 layout.prop(toolsettings, "use_bone_sketching", text="")
3175 def draw(self, context):
3176 layout = self.layout
3178 toolsettings = context.scene.tool_settings
3180 col = layout.column()
3182 col.prop(toolsettings, "use_etch_quick")
3183 col.prop(toolsettings, "use_etch_overdraw")
3187 col.prop(toolsettings, "etch_convert_mode")
3189 if toolsettings.etch_convert_mode == 'LENGTH':
3190 col.prop(toolsettings, "etch_length_limit")
3191 elif toolsettings.etch_convert_mode == 'ADAPTIVE':
3192 col.prop(toolsettings, "etch_adaptive_limit")
3193 elif toolsettings.etch_convert_mode == 'FIXED':
3194 col.prop(toolsettings, "etch_subdivision_number")
3195 elif toolsettings.etch_convert_mode == 'RETARGET':
3196 col.prop(toolsettings, "etch_template")
3197 col.prop(toolsettings, "etch_roll_mode")
3201 colsub = col.column(align=True)
3202 colsub.prop(toolsettings, "use_etch_autoname")
3203 sub = colsub.column(align=True)
3204 sub.enabled = not toolsettings.use_etch_autoname
3205 sub.prop(toolsettings, "etch_number")
3206 sub.prop(toolsettings, "etch_side")
3210 col.operator("sketch.convert", text="Convert to Bones")
3211 col.operator("sketch.delete", text="Delete Strokes")
3214 class VIEW3D_PT_context_properties(Panel):
3215 bl_space_type = 'VIEW_3D'
3216 bl_region_type = 'UI'
3217 bl_label = "Properties"
3218 bl_options = {'DEFAULT_CLOSED'}
3220 def _active_context_member(context):
3221 obj = context.object
3225 return "active_pose_bone"
3226 elif mode == 'EDIT' and obj.type == 'ARMATURE':
3227 return "active_bone"
3234 def poll(cls, context):
3235 member = cls._active_context_member(context)
3237 context_member = getattr(context, member)
3238 return context_member and context_member.keys()
3242 def draw(self, context):
3244 member = VIEW3D_PT_context_properties._active_context_member(context)
3247 # Draw with no edit button
3248 rna_prop_ui.draw(self.layout, context, member, object, False)
3252 bpy.utils.register_module(__name__)
3256 bpy.utils.unregister_module(__name__)
3258 if __name__ == "__main__":