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
25 class VIEW3D_HT_header(Header):
26 bl_space_type = 'VIEW_3D'
28 def draw(self, context):
31 view = context.space_data
32 mode_string = context.mode
33 edit_object = context.edit_object
34 obj = context.active_object
35 toolsettings = context.tool_settings
37 row = layout.row(align=True)
41 if context.area.show_menus:
42 sub = row.row(align=True)
44 sub.menu("VIEW3D_MT_view")
47 if mode_string not in {'EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
48 sub.menu("VIEW3D_MT_select_%s" % mode_string.lower())
51 sub.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
53 if mode_string not in {'PAINT_TEXTURE'}:
54 sub.menu("VIEW3D_MT_%s" % mode_string.lower())
55 if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
56 sub.menu("VIEW3D_MT_brush")
57 if mode_string == 'SCULPT':
58 sub.menu("VIEW3D_MT_hide_mask")
60 sub.menu("VIEW3D_MT_object")
62 # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
64 layout.template_header_3D()
69 if mode == 'PARTICLE_EDIT':
70 row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
73 if view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH')):
74 row.prop(view, "use_occlude_geometry", text="")
76 # Proportional editing
77 if mode in {'EDIT', 'PARTICLE_EDIT'}:
78 row = layout.row(align=True)
79 row.prop(toolsettings, "proportional_edit", text="", icon_only=True)
80 if toolsettings.proportional_edit != 'DISABLED':
81 row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
82 elif mode == 'OBJECT':
83 row = layout.row(align=True)
84 row.prop(toolsettings, "use_proportional_edit_objects", text="", icon_only=True)
85 if toolsettings.use_proportional_edit_objects:
86 row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
89 if not obj or mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
90 snap_element = toolsettings.snap_element
91 row = layout.row(align=True)
92 row.prop(toolsettings, "use_snap", text="")
93 row.prop(toolsettings, "snap_element", text="", icon_only=True)
94 if snap_element != 'INCREMENT':
95 row.prop(toolsettings, "snap_target", text="")
97 if mode in {'OBJECT', 'POSE'} and snap_element != 'VOLUME':
98 row.prop(toolsettings, "use_snap_align_rotation", text="")
100 row.prop(toolsettings, "use_snap_self", text="")
102 if snap_element == 'VOLUME':
103 row.prop(toolsettings, "use_snap_peel_object", text="")
104 elif snap_element == 'FACE':
105 row.prop(toolsettings, "use_snap_project", text="")
108 row = layout.row(align=True)
109 row.operator("render.opengl", text="", icon='RENDER_STILL')
110 props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
111 props.animation = True
114 if obj and mode == 'POSE':
115 row = layout.row(align=True)
116 row.operator("pose.copy", text="", icon='COPYDOWN')
117 row.operator("pose.paste", text="", icon='PASTEDOWN')
118 props = row.operator("pose.paste", text="", icon='PASTEFLIPDOWN')
122 # ********** Menu **********
124 # ********** Utilities **********
127 class ShowHideMenu():
128 bl_label = "Show/Hide"
131 def draw(self, context):
134 layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
135 layout.operator("%s.hide" % self._operator_name, text="Hide Selected").unselected = False
136 layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
139 # Standard transforms which apply to all cases
140 # NOTE: this doesn't seem to be able to be used directly
141 class VIEW3D_MT_transform_base(Menu):
142 bl_label = "Transform"
144 # TODO: get rid of the custom text strings?
145 def draw(self, context):
148 layout.operator("transform.translate", text="Grab/Move")
149 # TODO: sub-menu for grab per axis
150 layout.operator("transform.rotate", text="Rotate")
151 # TODO: sub-menu for rot per axis
152 layout.operator("transform.resize", text="Scale")
153 # TODO: sub-menu for scale per axis
157 layout.operator("transform.tosphere", text="To Sphere")
158 layout.operator("transform.shear", text="Shear")
159 layout.operator("transform.warp", text="Warp")
160 layout.operator("transform.push_pull", text="Push/Pull")
163 # Generic transform menu - geometry types
164 class VIEW3D_MT_transform(VIEW3D_MT_transform_base):
165 def draw(self, context):
167 VIEW3D_MT_transform_base.draw(self, context)
173 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
174 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
177 # Object-specific extensions to Transform menu
178 class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
179 def draw(self, context):
183 VIEW3D_MT_transform_base.draw(self, context)
185 # object-specific option follow...
188 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
189 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
193 layout.operator_context = 'EXEC_REGION_WIN'
194 layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
198 layout.operator_context = 'EXEC_AREA'
200 layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
201 layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
202 layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
206 layout.operator("object.randomize_transform")
207 layout.operator("object.align")
211 layout.operator("object.anim_transforms_to_deltas")
214 # Armature EditMode extensions to Transform menu
215 class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
216 def draw(self, context):
220 VIEW3D_MT_transform_base.draw(self, context)
222 # armature specific extensions follow...
226 if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
227 obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
228 layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
230 if context.edit_object and context.edit_object.type == 'ARMATURE':
231 layout.operator("armature.align")
234 class VIEW3D_MT_mirror(Menu):
237 def draw(self, context):
240 layout.operator("transform.mirror", text="Interactive Mirror")
244 layout.operator_context = 'INVOKE_REGION_WIN'
246 props = layout.operator("transform.mirror", text="X Global")
247 props.constraint_axis = (True, False, False)
248 props.constraint_orientation = 'GLOBAL'
249 props = layout.operator("transform.mirror", text="Y Global")
250 props.constraint_axis = (False, True, False)
251 props.constraint_orientation = 'GLOBAL'
252 props = layout.operator("transform.mirror", text="Z Global")
253 props.constraint_axis = (False, False, True)
254 props.constraint_orientation = 'GLOBAL'
256 if context.edit_object:
259 props = layout.operator("transform.mirror", text="X Local")
260 props.constraint_axis = (True, False, False)
261 props.constraint_orientation = 'LOCAL'
262 props = layout.operator("transform.mirror", text="Y Local")
263 props.constraint_axis = (False, True, False)
264 props.constraint_orientation = 'LOCAL'
265 props = layout.operator("transform.mirror", text="Z Local")
266 props.constraint_axis = (False, False, True)
267 props.constraint_orientation = 'LOCAL'
269 layout.operator("object.vertex_group_mirror")
272 class VIEW3D_MT_snap(Menu):
275 def draw(self, context):
278 layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
279 layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
283 layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
284 layout.operator("view3d.snap_cursor_to_center", text="Cursor to Center")
285 layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
286 layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
289 class VIEW3D_MT_uv_map(Menu):
290 bl_label = "UV Mapping"
292 def draw(self, context):
295 layout.operator("uv.unwrap")
297 layout.operator_context = 'INVOKE_DEFAULT'
298 layout.operator("uv.smart_project")
299 layout.operator("uv.lightmap_pack")
300 layout.operator("uv.follow_active_quads")
304 layout.operator_context = 'EXEC_REGION_WIN'
305 layout.operator("uv.cube_project")
306 layout.operator("uv.cylinder_project")
307 layout.operator("uv.sphere_project")
311 layout.operator_context = 'EXEC_REGION_WIN'
312 layout.operator("uv.project_from_view").scale_to_bounds = False
313 layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
317 layout.operator("uv.reset")
320 # ********** View menus **********
323 class VIEW3D_MT_view(Menu):
326 def draw(self, context):
329 layout.operator("view3d.properties", icon='MENU_PANEL')
330 layout.operator("view3d.toolshelf", icon='MENU_PANEL')
334 layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA'
335 layout.operator("view3d.viewnumpad", text="Top").type = 'TOP'
336 layout.operator("view3d.viewnumpad", text="Bottom").type = 'BOTTOM'
337 layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT'
338 layout.operator("view3d.viewnumpad", text="Back").type = 'BACK'
339 layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT'
340 layout.operator("view3d.viewnumpad", text="Left").type = 'LEFT'
342 layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
346 layout.operator("view3d.view_persportho")
350 layout.menu("VIEW3D_MT_view_navigation")
351 layout.menu("VIEW3D_MT_view_align")
355 layout.operator_context = 'INVOKE_REGION_WIN'
357 layout.operator("view3d.clip_border", text="Clipping Border...")
358 layout.operator("view3d.zoom_border", text="Zoom Border...")
362 layout.operator("view3d.layers", text="Show All Layers").nr = 0
366 layout.operator("view3d.localview", text="View Global/Local")
367 layout.operator("view3d.view_selected")
368 layout.operator("view3d.view_all")
372 layout.operator("screen.animation_play", text="Playback Animation")
376 layout.operator("screen.area_dupli")
377 layout.operator("screen.region_quadview")
378 layout.operator("screen.screen_full_area")
381 class VIEW3D_MT_view_navigation(Menu):
382 bl_label = "Navigation"
384 def draw(self, context):
387 layout.operator_enum("view3d.view_orbit", "type")
391 layout.operator_enum("view3d.view_pan", "type")
395 layout.operator("view3d.zoom", text="Zoom In").delta = 1
396 layout.operator("view3d.zoom", text="Zoom Out").delta = -1
397 layout.operator("view3d.zoom_camera_1_to_1", text="Zoom Camera 1:1")
401 layout.operator("view3d.fly")
404 class VIEW3D_MT_view_align(Menu):
405 bl_label = "Align View"
407 def draw(self, context):
410 layout.menu("VIEW3D_MT_view_align_selected")
414 layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
415 layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
416 layout.operator("view3d.camera_to_view_selected", text="Align Active Camera to Selected")
417 layout.operator("view3d.view_selected")
418 layout.operator("view3d.view_center_cursor")
422 layout.operator("view3d.view_lock_to_active")
423 layout.operator("view3d.view_lock_clear")
426 class VIEW3D_MT_view_align_selected(Menu):
427 bl_label = "Align View to Selected"
429 def draw(self, context):
432 props = layout.operator("view3d.viewnumpad", text="Top")
433 props.align_active = True
436 props = layout.operator("view3d.viewnumpad", text="Bottom")
437 props.align_active = True
438 props.type = 'BOTTOM'
440 props = layout.operator("view3d.viewnumpad", text="Front")
441 props.align_active = True
444 props = layout.operator("view3d.viewnumpad", text="Back")
445 props.align_active = True
448 props = layout.operator("view3d.viewnumpad", text="Right")
449 props.align_active = True
452 props = layout.operator("view3d.viewnumpad", text="Left")
453 props.align_active = True
457 class VIEW3D_MT_view_cameras(Menu):
460 def draw(self, context):
463 layout.operator("view3d.object_as_camera")
464 layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA'
466 # ********** Select menus, suffix from context.mode **********
469 class VIEW3D_MT_select_object(Menu):
472 def draw(self, context):
475 layout.operator("view3d.select_border")
476 layout.operator("view3d.select_circle")
480 layout.operator("object.select_all").action = 'TOGGLE'
481 layout.operator("object.select_all", text="Inverse").action = 'INVERT'
482 layout.operator("object.select_random", text="Random")
483 layout.operator("object.select_mirror", text="Mirror")
484 layout.operator("object.select_by_layer", text="Select All by Layer")
485 layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
486 layout.operator("object.select_camera", text="Select Camera")
490 layout.operator_menu_enum("object.select_grouped", "type", text="Grouped")
491 layout.operator_menu_enum("object.select_linked", "type", text="Linked")
492 layout.operator("object.select_pattern", text="Select Pattern...")
495 class VIEW3D_MT_select_pose(Menu):
498 def draw(self, context):
501 layout.operator("view3d.select_border")
505 layout.operator("pose.select_all").action = 'TOGGLE'
506 layout.operator("pose.select_all", text="Inverse").action = 'INVERT'
507 layout.operator("pose.select_flip_active", text="Flip Active")
508 layout.operator("pose.select_constraint_target", text="Constraint Target")
509 layout.operator("pose.select_linked", text="Linked")
513 layout.operator("pose.select_hierarchy", text="Parent").direction = 'PARENT'
514 layout.operator("pose.select_hierarchy", text="Child").direction = 'CHILD'
518 props = layout.operator("pose.select_hierarchy", text="Extend Parent")
520 props.direction = 'PARENT'
522 props = layout.operator("pose.select_hierarchy", text="Extend Child")
524 props.direction = 'CHILD'
528 layout.operator_menu_enum("pose.select_grouped", "type", text="Grouped")
529 layout.operator("object.select_pattern", text="Select Pattern...")
532 class VIEW3D_MT_select_particle(Menu):
535 def draw(self, context):
538 layout.operator("view3d.select_border")
542 layout.operator("particle.select_all").action = 'TOGGLE'
543 layout.operator("particle.select_linked")
544 layout.operator("particle.select_all", text="Inverse").action = 'INVERT'
548 layout.operator("particle.select_more")
549 layout.operator("particle.select_less")
553 layout.operator("particle.select_roots", text="Roots")
554 layout.operator("particle.select_tips", text="Tips")
557 class VIEW3D_MT_select_edit_mesh(Menu):
560 def draw(self, context):
563 layout.operator("view3d.select_border")
564 layout.operator("view3d.select_circle")
568 layout.operator("mesh.select_all").action = 'TOGGLE'
569 layout.operator("mesh.select_all", text="Inverse").action = 'INVERT'
573 layout.operator("mesh.select_random", text="Random")
574 layout.operator("mesh.select_nth", text="Every N Number of Verts")
575 layout.operator("mesh.edges_select_sharp", text="Sharp Edges")
576 layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
577 layout.operator("mesh.select_interior_faces", text="Interior Faces")
578 layout.operator("mesh.select_axis", text="Side of Active")
582 layout.operator("mesh.select_by_number_vertices", text="By Number of Verts")
583 if context.scene.tool_settings.mesh_select_mode[2] == False:
584 layout.operator("mesh.select_non_manifold", text="Non Manifold")
585 layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
586 layout.operator_menu_enum("mesh.select_similar", "type", text="Similar")
590 layout.operator("mesh.select_less", text="Less")
591 layout.operator("mesh.select_more", text="More")
595 layout.operator("mesh.select_mirror", text="Mirror")
597 layout.operator("mesh.select_linked", text="Linked")
598 layout.operator("mesh.select_vertex_path", text="Vertex Path")
599 layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False
600 layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
604 layout.operator("mesh.loop_to_region")
605 layout.operator("mesh.region_to_loop")
608 class VIEW3D_MT_select_edit_curve(Menu):
611 def draw(self, context):
614 layout.operator("view3d.select_border")
615 layout.operator("view3d.select_circle")
619 layout.operator("curve.select_all").action = 'TOGGLE'
620 layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
621 layout.operator("curve.select_random")
622 layout.operator("curve.select_nth", text="Every Nth Number of Points")
623 layout.operator("curve.select_linked", text="Select Linked")
627 layout.operator("curve.de_select_first")
628 layout.operator("curve.de_select_last")
629 layout.operator("curve.select_next")
630 layout.operator("curve.select_previous")
634 layout.operator("curve.select_more")
635 layout.operator("curve.select_less")
638 class VIEW3D_MT_select_edit_surface(Menu):
641 def draw(self, context):
644 layout.operator("view3d.select_border")
645 layout.operator("view3d.select_circle")
649 layout.operator("curve.select_all").action = 'TOGGLE'
650 layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
651 layout.operator("curve.select_random")
652 layout.operator("curve.select_nth", text="Every Nth Number of Points")
653 layout.operator("curve.select_linked", text="Select Linked")
657 layout.operator("curve.select_row")
661 layout.operator("curve.select_more")
662 layout.operator("curve.select_less")
665 class VIEW3D_MT_select_edit_metaball(Menu):
668 def draw(self, context):
671 layout.operator("view3d.select_border")
675 layout.operator("mball.select_all").action = 'TOGGLE'
676 layout.operator("mball.select_all", text="Inverse").action = 'INVERT'
680 layout.operator("mball.select_random_metaelems")
683 class VIEW3D_MT_select_edit_lattice(Menu):
686 def draw(self, context):
689 layout.operator("view3d.select_border")
693 layout.operator("lattice.select_all").action = 'TOGGLE'
694 layout.operator("lattice.select_all", text="Inverse").action = 'INVERT'
697 class VIEW3D_MT_select_edit_armature(Menu):
700 def draw(self, context):
703 layout.operator("view3d.select_border")
707 layout.operator("armature.select_all").action = 'TOGGLE'
708 layout.operator("armature.select_all", text="Inverse").action = 'INVERT'
712 layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
713 layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
717 props = layout.operator("armature.select_hierarchy", text="Extend Parent")
719 props.direction = 'PARENT'
721 props = layout.operator("armature.select_hierarchy", text="Extend Child")
723 props.direction = 'CHILD'
725 layout.operator_menu_enum("armature.select_similar", "type", text="Similar")
726 layout.operator("object.select_pattern", text="Select Pattern...")
729 class VIEW3D_MT_select_face(Menu): # XXX no matching enum
732 def draw(self, context):
733 # layout = self.layout
736 # see view3d_select_faceselmenu
739 # ********** Object menu **********
742 class VIEW3D_MT_object(Menu):
743 bl_context = "objectmode"
746 def draw(self, context):
749 layout.operator("ed.undo")
750 layout.operator("ed.redo")
751 layout.operator("ed.undo_history")
755 layout.menu("VIEW3D_MT_transform_object")
756 layout.menu("VIEW3D_MT_mirror")
757 layout.menu("VIEW3D_MT_object_clear")
758 layout.menu("VIEW3D_MT_object_apply")
759 layout.menu("VIEW3D_MT_snap")
763 layout.menu("VIEW3D_MT_object_animation")
767 layout.operator("object.duplicate_move")
768 layout.operator("object.duplicate_move_linked")
769 layout.operator("object.delete", text="Delete...")
770 layout.operator("object.proxy_make", text="Make Proxy...")
771 layout.menu("VIEW3D_MT_make_links", text="Make Links...")
772 layout.operator("object.make_dupli_face")
773 layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
774 layout.menu("VIEW3D_MT_make_single_user")
778 layout.menu("VIEW3D_MT_object_parent")
779 layout.menu("VIEW3D_MT_object_track")
780 layout.menu("VIEW3D_MT_object_group")
781 layout.menu("VIEW3D_MT_object_constraints")
785 layout.menu("VIEW3D_MT_object_quick_effects")
789 layout.menu("VIEW3D_MT_object_game")
793 layout.operator("object.join")
797 layout.operator("object.move_to_layer", text="Move to Layer...")
798 layout.menu("VIEW3D_MT_object_showhide")
800 layout.operator_menu_enum("object.convert", "target")
803 class VIEW3D_MT_object_animation(Menu):
804 bl_label = "Animation"
806 def draw(self, context):
809 layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
810 layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframes...")
811 layout.operator("anim.keyframe_clear_v3d", text="Clear Keyframes...")
812 layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
816 layout.operator("nla.bake", text="Bake Action...")
819 class VIEW3D_MT_object_clear(Menu):
822 def draw(self, context):
825 layout.operator("object.location_clear", text="Location")
826 layout.operator("object.rotation_clear", text="Rotation")
827 layout.operator("object.scale_clear", text="Scale")
828 layout.operator("object.origin_clear", text="Origin")
831 class VIEW3D_MT_object_specials(Menu):
832 bl_label = "Specials"
835 def poll(cls, context):
836 # add more special types
837 return context.object
839 def draw(self, context):
843 if obj.type == 'CAMERA':
844 layout.operator_context = 'INVOKE_REGION_WIN'
846 if obj.data.type == 'PERSP':
847 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
848 props.data_path_iter = "selected_editable_objects"
849 props.data_path_item = "data.lens"
850 props.input_scale = 0.1
851 if obj.data.lens_unit == 'MILLIMETERS':
852 props.header_text = "Camera Lens Angle: %.1fmm"
854 props.header_text = "Camera Lens Angle: %.1f\u00B0"
857 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
858 props.data_path_iter = "selected_editable_objects"
859 props.data_path_item = "data.ortho_scale"
860 props.input_scale = 0.01
861 props.header_text = "Camera Lens Scale: %.3f"
863 if not obj.data.dof_object:
864 #layout.label(text="Test Has DOF obj");
865 props = layout.operator("wm.context_modal_mouse", text="DOF Distance")
866 props.data_path_iter = "selected_editable_objects"
867 props.data_path_item = "data.dof_distance"
868 props.input_scale = 0.02
869 props.header_text = "DOF Distance: %.3f"
871 if obj.type in {'CURVE', 'FONT'}:
872 layout.operator_context = 'INVOKE_REGION_WIN'
874 props = layout.operator("wm.context_modal_mouse", text="Extrude Size")
875 props.data_path_iter = "selected_editable_objects"
876 props.data_path_item = "data.extrude"
877 props.input_scale = 0.01
878 props.header_text = "Extrude Size: %.3f"
880 props = layout.operator("wm.context_modal_mouse", text="Width Size")
881 props.data_path_iter = "selected_editable_objects"
882 props.data_path_item = "data.offset"
883 props.input_scale = 0.01
884 props.header_text = "Width Size: %.3f"
886 if obj.type == 'EMPTY':
887 layout.operator_context = 'INVOKE_REGION_WIN'
889 props = layout.operator("wm.context_modal_mouse", text="Empty Draw Size")
890 props.data_path_iter = "selected_editable_objects"
891 props.data_path_item = "empty_draw_size"
892 props.input_scale = 0.01
893 props.header_text = "Empty Draw Size: %.3f"
895 if obj.type == 'LAMP':
896 layout.operator_context = 'INVOKE_REGION_WIN'
898 props = layout.operator("wm.context_modal_mouse", text="Energy")
899 props.data_path_iter = "selected_editable_objects"
900 props.data_path_item = "data.energy"
901 props.header_text = "Lamp Energy: %.3f"
903 if obj.data.type in {'SPOT', 'AREA', 'POINT'}:
904 props = layout.operator("wm.context_modal_mouse", text="Falloff Distance")
905 props.data_path_iter = "selected_editable_objects"
906 props.data_path_item = "data.distance"
907 props.input_scale = 0.1
908 props.header_text = "Lamp Falloff Distance: %.1f"
910 if obj.data.type == 'SPOT':
912 props = layout.operator("wm.context_modal_mouse", text="Spot Size")
913 props.data_path_iter = "selected_editable_objects"
914 props.data_path_item = "data.spot_size"
915 props.input_scale = 0.01
916 props.header_text = "Spot Size: %.2f"
918 props = layout.operator("wm.context_modal_mouse", text="Spot Blend")
919 props.data_path_iter = "selected_editable_objects"
920 props.data_path_item = "data.spot_blend"
921 props.input_scale = -0.01
922 props.header_text = "Spot Blend: %.2f"
924 props = layout.operator("wm.context_modal_mouse", text="Clip Start")
925 props.data_path_iter = "selected_editable_objects"
926 props.data_path_item = "data.shadow_buffer_clip_start"
927 props.input_scale = 0.05
928 props.header_text = "Clip Start: %.2f"
930 props = layout.operator("wm.context_modal_mouse", text="Clip End")
931 props.data_path_iter = "selected_editable_objects"
932 props.data_path_item = "data.shadow_buffer_clip_end"
933 props.input_scale = 0.05
934 props.header_text = "Clip End: %.2f"
938 props = layout.operator("object.isolate_type_render")
939 props = layout.operator("object.hide_render_clear_all")
942 class VIEW3D_MT_object_apply(Menu):
945 def draw(self, context):
948 props = layout.operator("object.transform_apply", text="Location")
949 props.location, props.rotation, props.scale = True, False, False
951 props = layout.operator("object.transform_apply", text="Rotation")
952 props.location, props.rotation, props.scale = False, True, False
954 props = layout.operator("object.transform_apply", text="Scale")
955 props.location, props.rotation, props.scale = False, False, True
956 props = layout.operator("object.transform_apply", text="Rotation & Scale")
957 props.location, props.rotation, props.scale = False, True, True
961 layout.operator("object.visual_transform_apply", text="Visual Transform")
962 layout.operator("object.duplicates_make_real")
965 class VIEW3D_MT_object_parent(Menu):
968 def draw(self, context):
971 layout.operator_menu_enum("object.parent_set", "type", text="Set")
972 layout.operator_menu_enum("object.parent_clear", "type", text="Clear")
975 class VIEW3D_MT_object_track(Menu):
978 def draw(self, context):
981 layout.operator_menu_enum("object.track_set", "type", text="Set")
982 layout.operator_menu_enum("object.track_clear", "type", text="Clear")
985 class VIEW3D_MT_object_group(Menu):
988 def draw(self, context):
991 layout.operator("group.create")
992 # layout.operator_menu_enum("group.objects_remove", "group") # BUGGY
993 layout.operator("group.objects_remove")
994 layout.operator("group.objects_remove_all")
998 layout.operator("group.objects_add_active")
999 layout.operator("group.objects_remove_active")
1002 class VIEW3D_MT_object_constraints(Menu):
1003 bl_label = "Constraints"
1005 def draw(self, context):
1006 layout = self.layout
1008 layout.operator("object.constraint_add_with_targets")
1009 layout.operator("object.constraints_copy")
1010 layout.operator("object.constraints_clear")
1013 class VIEW3D_MT_object_quick_effects(Menu):
1014 bl_label = "Quick Effects"
1016 def draw(self, context):
1017 layout = self.layout
1019 layout.operator("object.quick_fur")
1020 layout.operator("object.quick_explode")
1021 layout.operator("object.quick_smoke")
1022 layout.operator("object.quick_fluid")
1025 class VIEW3D_MT_object_showhide(Menu):
1026 bl_label = "Show/Hide"
1028 def draw(self, context):
1029 layout = self.layout
1031 layout.operator("object.hide_view_clear", text="Show Hidden")
1032 layout.operator("object.hide_view_set", text="Hide Selected").unselected = False
1033 layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
1036 class VIEW3D_MT_make_single_user(Menu):
1037 bl_label = "Make Single User"
1039 def draw(self, context):
1040 layout = self.layout
1042 props = layout.operator("object.make_single_user", text="Object")
1045 props = layout.operator("object.make_single_user", text="Object & Data")
1046 props.object = props.obdata = True
1048 props = layout.operator("object.make_single_user", text="Object & Data & Materials+Tex")
1049 props.object = props.obdata = props.material = props.texture = True
1051 props = layout.operator("object.make_single_user", text="Materials+Tex")
1052 props.material = props.texture = True
1054 props = layout.operator("object.make_single_user", text="Object Animation")
1055 props.animation = True
1058 class VIEW3D_MT_make_links(Menu):
1059 bl_label = "Make Links"
1061 def draw(self, context):
1062 layout = self.layout
1064 if(len(bpy.data.scenes) > 10):
1065 layout.operator_context = 'INVOKE_DEFAULT'
1066 layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
1068 layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
1070 layout.operator_enum("object.make_links_data", "type") # inline
1072 layout.operator("object.join_uvs") # stupid place to add this!
1075 class VIEW3D_MT_object_game(Menu):
1078 def draw(self, context):
1079 layout = self.layout
1081 layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks")
1082 layout.operator("object.game_physics_copy", text="Copy Physics Properties")
1086 layout.operator("object.game_property_copy", text="Replace Properties").operation = 'REPLACE'
1087 layout.operator("object.game_property_copy", text="Merge Properties").operation = 'MERGE'
1088 layout.operator_menu_enum("object.game_property_copy", "property", text="Copy Properties...")
1092 layout.operator("object.game_property_clear")
1095 # ********** Brush menu **********
1096 class VIEW3D_MT_brush(Menu):
1099 def draw(self, context):
1100 layout = self.layout
1102 settings = UnifiedPaintPanel.paint_settings(context)
1103 brush = settings.brush
1105 ups = context.tool_settings.unified_paint_settings
1106 layout.prop(ups, "use_unified_size", text="Unified Size")
1107 layout.prop(ups, "use_unified_strength", text="Unified Strength")
1111 layout.menu("VIEW3D_MT_brush_paint_modes")
1114 if context.sculpt_object:
1115 layout.operator("brush.reset")
1116 layout.prop_menu_enum(brush, "sculpt_tool")
1117 elif context.image_paint_object:
1118 layout.prop_menu_enum(brush, "image_tool")
1119 elif context.vertex_paint_object or context.weight_paint_object:
1120 layout.prop_menu_enum(brush, "vertex_tool")
1122 # skip if no active brush
1126 # TODO: still missing a lot of brush options here
1129 if context.sculpt_object:
1131 sculpt_tool = brush.sculpt_tool
1134 layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
1137 if sculpt_tool != 'GRAB':
1138 layout.prop_menu_enum(brush, "stroke_method")
1140 if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
1141 layout.prop_menu_enum(brush, "direction")
1143 if sculpt_tool == 'LAYER':
1144 layout.prop(brush, "use_persistent")
1145 layout.operator("sculpt.set_persistent_base")
1148 class VIEW3D_MT_brush_paint_modes(Menu):
1149 bl_label = "Enabled Modes"
1151 def draw(self, context):
1152 layout = self.layout
1154 settings = UnifiedPaintPanel.paint_settings(context)
1155 brush = settings.brush
1157 layout.prop(brush, "use_paint_sculpt", text="Sculpt")
1158 layout.prop(brush, "use_paint_vertex", text="Vertex Paint")
1159 layout.prop(brush, "use_paint_weight", text="Weight Paint")
1160 layout.prop(brush, "use_paint_image", text="Texture Paint")
1162 # ********** Vertex paint menu **********
1165 class VIEW3D_MT_paint_vertex(Menu):
1168 def draw(self, context):
1169 layout = self.layout
1171 layout.operator("ed.undo")
1172 layout.operator("ed.redo")
1176 layout.operator("paint.vertex_color_set")
1177 layout.operator("paint.vertex_color_dirt")
1180 class VIEW3D_MT_hook(Menu):
1183 def draw(self, context):
1184 layout = self.layout
1185 layout.operator_context = 'EXEC_AREA'
1186 layout.operator("object.hook_add_newob")
1187 layout.operator("object.hook_add_selob").use_bone = False
1188 layout.operator("object.hook_add_selob", text="Hook to Selected Object Bone").use_bone = True
1190 if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
1192 layout.operator_menu_enum("object.hook_assign", "modifier")
1193 layout.operator_menu_enum("object.hook_remove", "modifier")
1195 layout.operator_menu_enum("object.hook_select", "modifier")
1196 layout.operator_menu_enum("object.hook_reset", "modifier")
1197 layout.operator_menu_enum("object.hook_recenter", "modifier")
1200 class VIEW3D_MT_vertex_group(Menu):
1201 bl_label = "Vertex Groups"
1203 def draw(self, context):
1204 layout = self.layout
1206 layout.operator_context = 'EXEC_AREA'
1207 layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True
1209 ob = context.active_object
1210 if ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex):
1211 if ob.vertex_groups.active:
1213 layout.operator("object.vertex_group_assign", text="Assign to Active Group").new = False
1214 layout.operator("object.vertex_group_remove_from", text="Remove from Active Group").all = False
1215 layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
1218 if ob.vertex_groups.active:
1219 layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
1220 layout.operator("object.vertex_group_remove", text="Remove Active Group").all = False
1221 layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
1223 # ********** Weight paint menu **********
1226 class VIEW3D_MT_paint_weight(Menu):
1227 bl_label = "Weights"
1229 def draw(self, context):
1230 layout = self.layout
1232 layout.operator("ed.undo")
1233 layout.operator("ed.redo")
1234 layout.operator("ed.undo_history")
1238 layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
1239 layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
1243 layout.operator("object.vertex_group_normalize_all", text="Normalize All")
1244 layout.operator("object.vertex_group_normalize", text="Normalize")
1245 layout.operator("object.vertex_group_mirror", text="Mirror")
1246 layout.operator("object.vertex_group_invert", text="Invert")
1247 layout.operator("object.vertex_group_clean", text="Clean")
1248 layout.operator("object.vertex_group_levels", text="Levels")
1249 layout.operator("object.vertex_group_blend", text="Blend")
1250 layout.operator("object.vertex_group_fix", text="Fix Deforms")
1254 layout.operator("paint.weight_set")
1256 # ********** Sculpt menu **********
1259 class VIEW3D_MT_sculpt(Menu):
1262 def draw(self, context):
1263 layout = self.layout
1265 toolsettings = context.tool_settings
1266 sculpt = toolsettings.sculpt
1268 layout.operator("ed.undo")
1269 layout.operator("ed.redo")
1273 layout.prop(sculpt, "use_symmetry_x")
1274 layout.prop(sculpt, "use_symmetry_y")
1275 layout.prop(sculpt, "use_symmetry_z")
1277 layout.prop(sculpt, "lock_x")
1278 layout.prop(sculpt, "lock_y")
1279 layout.prop(sculpt, "lock_z")
1282 layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
1283 layout.prop(sculpt, "show_low_resolution")
1284 layout.prop(sculpt, "show_brush")
1285 layout.prop(sculpt, "use_deform_only")
1288 class VIEW3D_MT_hide_mask(Menu):
1289 bl_label = "Hide/Mask"
1291 def draw(self, context):
1292 layout = self.layout
1294 op = layout.operator("paint.hide_show", text="Show All")
1298 op = layout.operator("paint.hide_show", text="Hide Bounding Box")
1302 op = layout.operator("paint.hide_show", text="Show Bounding Box")
1306 op = layout.operator("paint.hide_show", text="Hide Masked")
1312 op = layout.operator("paint.mask_flood_fill", text="Invert Mask")
1315 op = layout.operator("paint.mask_flood_fill", text="Fill Mask")
1319 op = layout.operator("paint.mask_flood_fill", text="Clear Mask")
1324 # ********** Particle menu **********
1327 class VIEW3D_MT_particle(Menu):
1328 bl_label = "Particle"
1330 def draw(self, context):
1331 layout = self.layout
1333 particle_edit = context.tool_settings.particle_edit
1335 layout.operator("ed.undo")
1336 layout.operator("ed.redo")
1337 layout.operator("ed.undo_history")
1341 layout.operator("particle.mirror")
1345 layout.operator("particle.remove_doubles")
1346 layout.operator("particle.delete")
1348 if particle_edit.select_mode == 'POINT':
1349 layout.operator("particle.subdivide")
1351 layout.operator("particle.rekey")
1352 layout.operator("particle.weight_set")
1356 layout.menu("VIEW3D_MT_particle_showhide")
1359 class VIEW3D_MT_particle_specials(Menu):
1360 bl_label = "Specials"
1362 def draw(self, context):
1363 layout = self.layout
1365 particle_edit = context.tool_settings.particle_edit
1367 layout.operator("particle.rekey")
1370 if particle_edit.select_mode == 'POINT':
1371 layout.operator("particle.subdivide")
1372 layout.operator("particle.select_roots")
1373 layout.operator("particle.select_tips")
1375 layout.operator("particle.remove_doubles")
1378 class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu):
1379 _operator_name = "particle"
1381 # ********** Pose Menu **********
1384 class VIEW3D_MT_pose(Menu):
1387 def draw(self, context):
1388 layout = self.layout
1390 layout.operator("ed.undo")
1391 layout.operator("ed.redo")
1392 layout.operator("ed.undo_history")
1396 layout.menu("VIEW3D_MT_transform_armature")
1398 layout.menu("VIEW3D_MT_pose_transform")
1399 layout.menu("VIEW3D_MT_pose_apply")
1401 layout.menu("VIEW3D_MT_snap")
1405 layout.menu("VIEW3D_MT_object_animation")
1409 layout.menu("VIEW3D_MT_pose_slide")
1410 layout.menu("VIEW3D_MT_pose_propagate")
1414 layout.operator("pose.copy")
1415 layout.operator("pose.paste")
1416 layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True
1420 layout.menu("VIEW3D_MT_pose_library")
1421 layout.menu("VIEW3D_MT_pose_motion")
1422 layout.menu("VIEW3D_MT_pose_group")
1426 layout.menu("VIEW3D_MT_object_parent")
1427 layout.menu("VIEW3D_MT_pose_ik")
1428 layout.menu("VIEW3D_MT_pose_constraints")
1432 layout.operator_context = 'EXEC_AREA'
1433 layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
1434 layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
1435 layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
1437 layout.operator("pose.flip_names")
1439 layout.operator("pose.quaternions_flip")
1443 layout.operator_context = 'INVOKE_AREA'
1444 layout.operator("pose.armature_layers", text="Change Armature Layers...")
1445 layout.operator("pose.bone_layers", text="Change Bone Layers...")
1449 layout.menu("VIEW3D_MT_pose_showhide")
1450 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
1453 class VIEW3D_MT_pose_transform(Menu):
1454 bl_label = "Clear Transform"
1456 def draw(self, context):
1457 layout = self.layout
1459 layout.operator("pose.transforms_clear", text="All")
1463 layout.operator("pose.loc_clear", text="Location")
1464 layout.operator("pose.rot_clear", text="Rotation")
1465 layout.operator("pose.scale_clear", text="Scale")
1469 layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
1472 class VIEW3D_MT_pose_slide(Menu):
1473 bl_label = "In-Betweens"
1475 def draw(self, context):
1476 layout = self.layout
1478 layout.operator("pose.push")
1479 layout.operator("pose.relax")
1480 layout.operator("pose.breakdown")
1483 class VIEW3D_MT_pose_propagate(Menu):
1484 bl_label = "Propagate"
1486 def draw(self, context):
1487 layout = self.layout
1489 layout.operator("pose.propagate").mode = 'WHILE_HELD'
1493 layout.operator("pose.propagate", text="To Next Keyframe").mode = 'NEXT_KEY'
1494 layout.operator("pose.propagate", text="To Last Keyframe (Make Cyclic)").mode = 'LAST_KEY'
1498 layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
1501 class VIEW3D_MT_pose_library(Menu):
1502 bl_label = "Pose Library"
1504 def draw(self, context):
1505 layout = self.layout
1507 layout.operator("poselib.browse_interactive", text="Browse Poses...")
1511 layout.operator("poselib.pose_add", text="Add Pose...")
1512 layout.operator("poselib.pose_rename", text="Rename Pose...")
1513 layout.operator("poselib.pose_remove", text="Remove Pose...")
1516 class VIEW3D_MT_pose_motion(Menu):
1517 bl_label = "Motion Paths"
1519 def draw(self, context):
1520 layout = self.layout
1522 layout.operator("pose.paths_calculate", text="Calculate")
1523 layout.operator("pose.paths_clear", text="Clear")
1526 class VIEW3D_MT_pose_group(Menu):
1527 bl_label = "Bone Groups"
1529 def draw(self, context):
1530 layout = self.layout
1531 layout.operator("pose.group_add")
1532 layout.operator("pose.group_remove")
1536 layout.operator("pose.group_assign")
1537 layout.operator("pose.group_unassign")
1540 class VIEW3D_MT_pose_ik(Menu):
1541 bl_label = "Inverse Kinematics"
1543 def draw(self, context):
1544 layout = self.layout
1546 layout.operator("pose.ik_add")
1547 layout.operator("pose.ik_clear")
1550 class VIEW3D_MT_pose_constraints(Menu):
1551 bl_label = "Constraints"
1553 def draw(self, context):
1554 layout = self.layout
1556 layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
1557 layout.operator("pose.constraints_copy")
1558 layout.operator("pose.constraints_clear")
1561 class VIEW3D_MT_pose_showhide(ShowHideMenu, Menu):
1562 _operator_name = "pose"
1565 class VIEW3D_MT_pose_apply(Menu):
1568 def draw(self, context):
1569 layout = self.layout
1571 layout.operator("pose.armature_apply")
1572 layout.operator("pose.visual_transform_apply")
1575 class VIEW3D_MT_pose_specials(Menu):
1576 bl_label = "Specials"
1578 def draw(self, context):
1579 layout = self.layout
1580 layout.operator("pose.select_constraint_target")
1581 layout.operator("pose.flip_names")
1582 layout.operator("pose.paths_calculate")
1583 layout.operator("pose.paths_clear")
1584 layout.operator("pose.user_transforms_clear")
1585 layout.operator("pose.user_transforms_clear", text="Clear User Transforms (All)").only_selected = False
1586 layout.operator("pose.relax")
1590 layout.operator_menu_enum("pose.autoside_names", "axis")
1594 def draw(self, context):
1595 layout = self.layout
1600 "use_envelope_multiply",
1601 "use_inherit_rotation",
1602 "use_inherit_scale",
1605 if context.mode == 'EDIT_ARMATURE':
1606 bone_props = bpy.types.EditBone.bl_rna.properties
1607 data_path_iter = "selected_bones"
1609 options.append("lock")
1611 bone_props = bpy.types.Bone.bl_rna.properties
1612 data_path_iter = "selected_pose_bones"
1613 opt_suffix = "bone."
1616 props = layout.operator("wm.context_collection_boolean_set", text=bone_props[opt].name)
1617 props.data_path_iter = data_path_iter
1618 props.data_path_item = opt_suffix + opt
1619 props.type = self.type
1622 class VIEW3D_MT_bone_options_toggle(Menu, BoneOptions):
1623 bl_label = "Toggle Bone Options"
1627 class VIEW3D_MT_bone_options_enable(Menu, BoneOptions):
1628 bl_label = "Enable Bone Options"
1632 class VIEW3D_MT_bone_options_disable(Menu, BoneOptions):
1633 bl_label = "Disable Bone Options"
1636 # ********** Edit Menus, suffix from ob.type **********
1639 class VIEW3D_MT_edit_mesh(Menu):
1642 def draw(self, context):
1643 layout = self.layout
1645 toolsettings = context.tool_settings
1647 layout.operator("ed.undo")
1648 layout.operator("ed.redo")
1649 layout.operator("ed.undo_history")
1653 layout.menu("VIEW3D_MT_transform")
1654 layout.menu("VIEW3D_MT_mirror")
1655 layout.menu("VIEW3D_MT_snap")
1659 layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...")
1663 layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
1664 layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
1665 layout.operator("mesh.duplicate_move")
1666 layout.menu("VIEW3D_MT_edit_mesh_delete")
1667 layout.menu("VIEW3D_MT_edit_mesh_dissolve")
1671 layout.menu("VIEW3D_MT_edit_mesh_vertices")
1672 layout.menu("VIEW3D_MT_edit_mesh_edges")
1673 layout.menu("VIEW3D_MT_edit_mesh_faces")
1674 layout.menu("VIEW3D_MT_edit_mesh_normals")
1678 layout.prop(toolsettings, "use_mesh_automerge")
1679 layout.prop_menu_enum(toolsettings, "proportional_edit")
1680 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
1684 layout.menu("VIEW3D_MT_edit_mesh_showhide")
1687 class VIEW3D_MT_edit_mesh_specials(Menu):
1688 bl_label = "Specials"
1690 def draw(self, context):
1691 layout = self.layout
1693 layout.operator_context = 'INVOKE_REGION_WIN'
1695 layout.operator("mesh.subdivide", text="Subdivide").smoothness = 0.0
1696 layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
1697 layout.operator("mesh.merge", text="Merge...")
1698 layout.operator("mesh.remove_doubles")
1699 layout.operator("mesh.hide", text="Hide").unselected = False
1700 layout.operator("mesh.reveal", text="Reveal")
1701 layout.operator("mesh.select_all", text="Select Inverse").action = 'INVERT'
1702 layout.operator("mesh.flip_normals")
1703 layout.operator("mesh.vertices_smooth", text="Smooth")
1704 layout.operator("mesh.inset")
1705 layout.operator("mesh.bevel", text="Bevel")
1706 layout.operator("mesh.bridge_edge_loops")
1707 layout.operator("mesh.faces_shade_smooth")
1708 layout.operator("mesh.faces_shade_flat")
1709 layout.operator("mesh.blend_from_shape")
1710 layout.operator("mesh.shape_propagate_to_all")
1711 layout.operator("mesh.select_vertex_path")
1712 layout.operator("mesh.sort_elements")
1715 class VIEW3D_MT_edit_mesh_select_mode(Menu):
1716 bl_label = "Mesh Select Mode"
1718 def draw(self, context):
1719 layout = self.layout
1721 layout.operator_context = 'INVOKE_REGION_WIN'
1723 props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
1724 props.value = "(True, False, False)"
1725 props.data_path = "tool_settings.mesh_select_mode"
1727 props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
1728 props.value = "(False, True, False)"
1729 props.data_path = "tool_settings.mesh_select_mode"
1731 props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
1732 props.value = "(False, False, True)"
1733 props.data_path = "tool_settings.mesh_select_mode"
1736 class VIEW3D_MT_edit_mesh_extrude(Menu):
1737 bl_label = "Extrude"
1740 'VERT': lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"),
1741 'EDGE': lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"),
1742 'FACE': lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"),
1743 'REGION': lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"),
1747 def extrude_options(context):
1748 mesh = context.object.data
1749 select_mode = context.tool_settings.mesh_select_mode
1752 if mesh.total_face_sel:
1753 menu += ['REGION', 'FACE']
1754 if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
1756 if mesh.total_vert_sel and select_mode[0]:
1759 # should never get here
1762 def draw(self, context):
1763 layout = self.layout
1764 layout.operator_context = 'INVOKE_REGION_WIN'
1766 for menu_id in self.extrude_options(context):
1767 self._extrude_funcs[menu_id](layout)
1770 class VIEW3D_MT_edit_mesh_vertices(Menu):
1771 bl_label = "Vertices"
1773 def draw(self, context):
1774 layout = self.layout
1775 layout.operator_context = 'INVOKE_REGION_WIN'
1777 layout.operator("mesh.merge")
1778 layout.operator("mesh.rip_move")
1779 layout.operator("mesh.split")
1780 layout.operator_menu_enum("mesh.separate", "type")
1781 layout.operator("mesh.vert_connect")
1782 layout.operator("mesh.vert_slide")
1786 layout.operator("mesh.vertices_smooth")
1787 layout.operator("mesh.remove_doubles")
1788 layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
1790 layout.operator("mesh.select_vertex_path")
1792 layout.operator("mesh.blend_from_shape")
1794 layout.operator("object.vertex_group_blend")
1795 layout.operator("mesh.shape_propagate_to_all")
1799 layout.menu("VIEW3D_MT_vertex_group")
1800 layout.menu("VIEW3D_MT_hook")
1803 class VIEW3D_MT_edit_mesh_edges(Menu):
1806 def draw(self, context):
1807 layout = self.layout
1809 layout.operator_context = 'INVOKE_REGION_WIN'
1811 layout.operator("mesh.edge_face_add")
1812 layout.operator("mesh.subdivide")
1816 layout.operator("transform.edge_crease")
1817 layout.operator("transform.edge_bevelweight")
1821 layout.operator("mesh.mark_seam").clear = False
1822 layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
1826 layout.operator("mesh.mark_sharp").clear = False
1827 layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
1831 layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
1832 layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
1836 layout.operator("mesh.bevel")
1837 layout.operator("mesh.edge_split")
1838 layout.operator("mesh.bridge_edge_loops")
1839 layout.operator("mesh.sort_elements", text="Sort Edges").elements = {'EDGE'}
1843 layout.operator("transform.edge_slide")
1844 layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False
1845 layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
1846 layout.operator("mesh.loop_to_region")
1847 layout.operator("mesh.region_to_loop")
1850 class VIEW3D_MT_edit_mesh_faces(Menu):
1852 bl_idname = "VIEW3D_MT_edit_mesh_faces"
1854 def draw(self, context):
1855 layout = self.layout
1857 layout.operator_context = 'INVOKE_REGION_WIN'
1859 layout.operator("mesh.flip_normals")
1860 layout.operator("mesh.edge_face_add")
1861 layout.operator("mesh.fill")
1862 layout.operator("mesh.beautify_fill")
1863 layout.operator("mesh.inset")
1864 layout.operator("mesh.bevel")
1865 layout.operator("mesh.solidify")
1866 layout.operator("mesh.wireframe")
1867 layout.operator("mesh.sort_elements", text="Sort Faces").elements = {'FACE'}
1871 layout.operator("mesh.quads_convert_to_tris")
1872 layout.operator("mesh.tris_convert_to_quads")
1876 layout.operator("mesh.faces_shade_smooth")
1877 layout.operator("mesh.faces_shade_flat")
1881 layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
1885 layout.operator_menu_enum("mesh.uvs_rotate", "direction")
1886 layout.operator("mesh.uvs_reverse")
1887 layout.operator_menu_enum("mesh.colors_rotate", "direction")
1888 layout.operator("mesh.colors_reverse")
1891 class VIEW3D_MT_edit_mesh_normals(Menu):
1892 bl_label = "Normals"
1894 def draw(self, context):
1895 layout = self.layout
1897 layout.operator("mesh.normals_make_consistent", text="Recalculate Outside").inside = False
1898 layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True
1902 layout.operator("mesh.flip_normals")
1905 class VIEW3D_MT_edit_mesh_delete(Menu):
1908 def draw(self, context):
1909 layout = self.layout
1911 layout.operator_enum("mesh.delete", "type")
1915 layout.operator("mesh.dissolve")
1916 layout.operator("mesh.edge_collapse")
1917 layout.operator("mesh.delete_edgeloop", text="Edge Loop")
1920 class VIEW3D_MT_edit_mesh_dissolve(Menu):
1921 bl_label = "Dissolve"
1923 def draw(self, context):
1924 layout = self.layout
1926 layout.operator("mesh.dissolve")
1930 layout.operator_enum("mesh.dissolve", "type")
1934 layout.operator("mesh.dissolve_limited")
1937 class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu):
1938 _operator_name = "mesh"
1941 # draw_curve is used by VIEW3D_MT_edit_curve and VIEW3D_MT_edit_surface
1944 def draw_curve(self, context):
1945 layout = self.layout
1947 toolsettings = context.tool_settings
1949 layout.menu("VIEW3D_MT_transform")
1950 layout.menu("VIEW3D_MT_mirror")
1951 layout.menu("VIEW3D_MT_snap")
1955 layout.operator("curve.extrude_move")
1956 layout.operator("curve.duplicate_move")
1957 layout.operator("curve.separate")
1958 layout.operator("curve.make_segment")
1959 layout.operator("curve.cyclic_toggle")
1960 layout.operator("curve.delete", text="Delete...")
1964 layout.menu("VIEW3D_MT_edit_curve_ctrlpoints")
1965 layout.menu("VIEW3D_MT_edit_curve_segments")
1969 layout.prop_menu_enum(toolsettings, "proportional_edit")
1970 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
1974 layout.menu("VIEW3D_MT_edit_curve_showhide")
1977 class VIEW3D_MT_edit_curve(Menu):
1983 class VIEW3D_MT_edit_curve_ctrlpoints(Menu):
1984 bl_label = "Control Points"
1986 def draw(self, context):
1987 layout = self.layout
1989 edit_object = context.edit_object
1991 if edit_object.type == 'CURVE':
1992 layout.operator("transform.tilt")
1993 layout.operator("curve.tilt_clear")
1994 layout.operator("curve.separate")
1998 layout.operator_menu_enum("curve.handle_type_set", "type")
2002 layout.menu("VIEW3D_MT_hook")
2005 class VIEW3D_MT_edit_curve_segments(Menu):
2006 bl_label = "Segments"
2008 def draw(self, context):
2009 layout = self.layout
2011 layout.operator("curve.subdivide")
2012 layout.operator("curve.switch_direction")
2015 class VIEW3D_MT_edit_curve_specials(Menu):
2016 bl_label = "Specials"
2018 def draw(self, context):
2019 layout = self.layout
2021 layout.operator("curve.subdivide")
2022 layout.operator("curve.switch_direction")
2023 layout.operator("curve.spline_weight_set")
2024 layout.operator("curve.radius_set")
2025 layout.operator("curve.smooth")
2026 layout.operator("curve.smooth_radius")
2029 class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, Menu):
2030 _operator_name = "curve"
2033 class VIEW3D_MT_edit_surface(Menu):
2034 bl_label = "Surface"
2039 class VIEW3D_MT_edit_font(Menu):
2042 def draw(self, context):
2043 layout = self.layout
2045 layout.operator("font.file_paste")
2049 layout.menu("VIEW3D_MT_edit_text_chars")
2053 layout.operator("font.style_toggle", text="Toggle Bold").style = 'BOLD'
2054 layout.operator("font.style_toggle", text="Toggle Italic").style = 'ITALIC'
2055 layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE'
2056 layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS'
2059 class VIEW3D_MT_edit_text_chars(Menu):
2060 bl_label = "Special Characters"
2062 def draw(self, context):
2063 layout = self.layout
2065 layout.operator("font.text_insert", text="Copyright|Alt C").text = "\u00A9"
2066 layout.operator("font.text_insert", text="Registered Trademark|Alt R").text = "\u00AE"
2070 layout.operator("font.text_insert", text="Degree Sign|Alt G").text = "\u00B0"
2071 layout.operator("font.text_insert", text="Multiplication Sign|Alt x").text = "\u00D7"
2072 layout.operator("font.text_insert", text="Circle|Alt .").text = "\u008A"
2073 layout.operator("font.text_insert", text="Superscript 1|Alt 1").text = "\u00B9"
2074 layout.operator("font.text_insert", text="Superscript 2|Alt 2").text = "\u00B2"
2075 layout.operator("font.text_insert", text="Superscript 3|Alt 3").text = "\u00B3"
2076 layout.operator("font.text_insert", text="Double >>|Alt >").text = "\u00BB"
2077 layout.operator("font.text_insert", text="Double <<|Alt <").text = "\u00AB"
2078 layout.operator("font.text_insert", text="Promillage|Alt %").text = "\u2030"
2082 layout.operator("font.text_insert", text="Dutch Florin|Alt F").text = "\u00A4"
2083 layout.operator("font.text_insert", text="British Pound|Alt L").text = "\u00A3"
2084 layout.operator("font.text_insert", text="Japanese Yen|Alt Y").text = "\u00A5"
2088 layout.operator("font.text_insert", text="German S|Alt S").text = "\u00DF"
2089 layout.operator("font.text_insert", text="Spanish Question Mark|Alt ?").text = "\u00BF"
2090 layout.operator("font.text_insert", text="Spanish Exclamation Mark|Alt !").text = "\u00A1"
2093 class VIEW3D_MT_edit_meta(Menu):
2094 bl_label = "Metaball"
2096 def draw(self, context):
2097 layout = self.layout
2099 toolsettings = context.tool_settings
2101 layout.operator("ed.undo")
2102 layout.operator("ed.redo")
2103 layout.operator("ed.undo_history")
2107 layout.menu("VIEW3D_MT_transform")
2108 layout.menu("VIEW3D_MT_mirror")
2109 layout.menu("VIEW3D_MT_snap")
2113 layout.operator("mball.delete_metaelems", text="Delete...")
2114 layout.operator("mball.duplicate_metaelems")
2118 layout.prop_menu_enum(toolsettings, "proportional_edit")
2119 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
2123 layout.menu("VIEW3D_MT_edit_meta_showhide")
2126 class VIEW3D_MT_edit_meta_showhide(Menu):
2127 bl_label = "Show/Hide"
2129 def draw(self, context):
2130 layout = self.layout
2132 layout.operator("mball.reveal_metaelems", text="Show Hidden")
2133 layout.operator("mball.hide_metaelems", text="Hide Selected").unselected = False
2134 layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
2137 class VIEW3D_MT_edit_lattice(Menu):
2138 bl_label = "Lattice"
2140 def draw(self, context):
2141 layout = self.layout
2143 toolsettings = context.tool_settings
2145 layout.menu("VIEW3D_MT_transform")
2146 layout.menu("VIEW3D_MT_mirror")
2147 layout.menu("VIEW3D_MT_snap")
2151 layout.operator("lattice.make_regular")
2155 layout.prop_menu_enum(toolsettings, "proportional_edit")
2156 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
2159 class VIEW3D_MT_edit_armature(Menu):
2160 bl_label = "Armature"
2162 def draw(self, context):
2163 layout = self.layout
2165 edit_object = context.edit_object
2166 arm = edit_object.data
2168 layout.menu("VIEW3D_MT_transform_armature")
2169 layout.menu("VIEW3D_MT_mirror")
2170 layout.menu("VIEW3D_MT_snap")
2171 layout.menu("VIEW3D_MT_edit_armature_roll")
2175 layout.operator("armature.extrude_move")
2177 if arm.use_mirror_x:
2178 layout.operator("armature.extrude_forked")
2180 layout.operator("armature.duplicate_move")
2181 layout.operator("armature.merge")
2182 layout.operator("armature.fill")
2183 layout.operator("armature.delete")
2184 layout.operator("armature.separate")
2188 layout.operator("armature.subdivide", text="Subdivide")
2189 layout.operator("armature.switch_direction", text="Switch Direction")
2193 layout.operator_context = 'EXEC_AREA'
2194 layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
2195 layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
2196 layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
2197 layout.operator("armature.flip_names")
2201 layout.operator_context = 'INVOKE_DEFAULT'
2202 layout.operator("armature.armature_layers")
2203 layout.operator("armature.bone_layers")
2207 layout.menu("VIEW3D_MT_edit_armature_parent")
2211 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
2214 class VIEW3D_MT_armature_specials(Menu):
2215 bl_label = "Specials"
2217 def draw(self, context):
2218 layout = self.layout
2220 layout.operator_context = 'INVOKE_REGION_WIN'
2222 layout.operator("armature.subdivide", text="Subdivide")
2223 layout.operator("armature.switch_direction", text="Switch Direction")
2227 layout.operator_context = 'EXEC_REGION_WIN'
2228 layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
2229 layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
2230 layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
2231 layout.operator("armature.flip_names", text="Flip Names")
2234 class VIEW3D_MT_edit_armature_parent(Menu):
2237 def draw(self, context):
2238 layout = self.layout
2240 layout.operator("armature.parent_set", text="Make")
2241 layout.operator("armature.parent_clear", text="Clear")
2244 class VIEW3D_MT_edit_armature_roll(Menu):
2245 bl_label = "Bone Roll"
2247 def draw(self, context):
2248 layout = self.layout
2250 layout.operator_menu_enum("armature.calculate_roll", "type")
2254 layout.operator("transform.transform", text="Set Roll").mode = 'BONE_ROLL'
2256 # ********** Panel **********
2259 class VIEW3D_PT_view3d_properties(Panel):
2260 bl_space_type = 'VIEW_3D'
2261 bl_region_type = 'UI'
2265 def poll(cls, context):
2266 view = context.space_data
2269 def draw(self, context):
2270 layout = self.layout
2272 view = context.space_data
2274 col = layout.column()
2275 col.active = bool(view.region_3d.view_perspective != 'CAMERA' or
2276 view.region_quadview)
2277 col.prop(view, "lens")
2278 col.label(text="Lock to Object:")
2279 col.prop(view, "lock_object", text="")
2280 lock_object = view.lock_object
2282 if lock_object.type == 'ARMATURE':
2283 col.prop_search(view, "lock_bone", lock_object.data,
2284 "edit_bones" if lock_object.mode == 'EDIT'
2288 col.prop(view, "lock_cursor", text="Lock to Cursor")
2290 col = layout.column()
2291 col.prop(view, "lock_camera")
2293 col = layout.column(align=True)
2294 col.label(text="Clip:")
2295 col.prop(view, "clip_start", text="Start")
2296 col.prop(view, "clip_end", text="End")
2298 subcol = col.column()
2299 subcol.enabled = not view.lock_camera_and_layers
2300 subcol.label(text="Local Camera:")
2301 subcol.prop(view, "camera", text="")
2304 class VIEW3D_PT_view3d_cursor(Panel):
2305 bl_space_type = 'VIEW_3D'
2306 bl_region_type = 'UI'
2307 bl_label = "3D Cursor"
2310 def poll(cls, context):
2311 view = context.space_data
2312 return (view is not None)
2314 def draw(self, context):
2315 layout = self.layout
2317 view = context.space_data
2318 layout.column().prop(view, "cursor_location", text="Location")
2321 class VIEW3D_PT_view3d_name(Panel):
2322 bl_space_type = 'VIEW_3D'
2323 bl_region_type = 'UI'
2327 def poll(cls, context):
2328 return (context.space_data and context.active_object)
2330 def draw(self, context):
2331 layout = self.layout
2333 ob = context.active_object
2335 row.label(text="", icon='OBJECT_DATA')
2336 row.prop(ob, "name", text="")
2338 if ob.type == 'ARMATURE' and ob.mode in {'EDIT', 'POSE'}:
2339 bone = context.active_bone
2342 row.label(text="", icon='BONE_DATA')
2343 row.prop(bone, "name", text="")
2346 class VIEW3D_PT_view3d_display(Panel):
2347 bl_space_type = 'VIEW_3D'
2348 bl_region_type = 'UI'
2349 bl_label = "Display"
2350 bl_options = {'DEFAULT_CLOSED'}
2353 def poll(cls, context):
2354 view = context.space_data
2357 def draw(self, context):
2358 layout = self.layout
2360 view = context.space_data
2361 scene = context.scene
2362 gs = scene.game_settings
2365 col = layout.column()
2366 col.prop(view, "show_only_render")
2368 col = layout.column()
2369 display_all = not view.show_only_render
2370 col.active = display_all
2371 col.prop(view, "show_outline_selected")
2372 col.prop(view, "show_all_objects_origin")
2373 col.prop(view, "show_relationship_lines")
2374 if ob and ob.type == 'MESH':
2376 col.prop(mesh, "show_all_edges")
2378 col = layout.column()
2379 col.active = display_all
2380 split = col.split(percentage=0.55)
2381 split.prop(view, "show_floor", text="Grid Floor")
2383 row = split.row(align=True)
2384 row.prop(view, "show_axis_x", text="X", toggle=True)
2385 row.prop(view, "show_axis_y", text="Y", toggle=True)
2386 row.prop(view, "show_axis_z", text="Z", toggle=True)
2388 sub = col.column(align=True)
2389 sub.active = (display_all and view.show_floor)
2390 sub.prop(view, "grid_lines", text="Lines")
2391 sub.prop(view, "grid_scale", text="Scale")
2392 subsub = sub.column(align=True)
2393 subsub.active = scene.unit_settings.system == 'NONE'
2394 subsub.prop(view, "grid_subdivisions", text="Subdivisions")
2396 if not scene.render.use_shading_nodes:
2397 col = layout.column()
2398 col.label(text="Shading:")
2399 col.prop(gs, "material_mode", text="")
2400 col.prop(view, "show_textured_solid")
2402 col.prop(view, "show_backface_culling")
2406 region = view.region_quadview
2408 layout.operator("screen.region_quadview", text="Toggle Quad View")
2411 col = layout.column()
2412 col.prop(region, "lock_rotation")
2414 row.enabled = region.lock_rotation
2415 row.prop(region, "show_sync_view")
2417 row.enabled = region.lock_rotation and region.show_sync_view
2418 row.prop(region, "use_box_clip")
2421 class VIEW3D_PT_view3d_motion_tracking(Panel):
2422 bl_space_type = 'VIEW_3D'
2423 bl_region_type = 'UI'
2424 bl_label = "Motion Tracking"
2425 bl_options = {'DEFAULT_CLOSED'}
2428 def poll(cls, context):
2429 view = context.space_data
2432 def draw_header(self, context):
2433 view = context.space_data
2435 self.layout.prop(view, "show_reconstruction", text="")
2437 def draw(self, context):
2438 layout = self.layout
2440 view = context.space_data
2442 col = layout.column()
2443 col.active = view.show_reconstruction
2444 col.prop(view, "show_bundle_names")
2445 col.prop(view, "show_camera_path")
2446 col.label(text="Tracks:")
2447 col.prop(view, "tracks_draw_type", text="")
2448 col.prop(view, "tracks_draw_size", text="Size")
2451 class VIEW3D_PT_view3d_meshdisplay(Panel):
2452 bl_space_type = 'VIEW_3D'
2453 bl_region_type = 'UI'
2454 bl_label = "Mesh Display"
2457 def poll(cls, context):
2458 # The active object check is needed because of local-mode
2459 return (context.active_object and (context.mode == 'EDIT_MESH'))
2461 def draw(self, context):
2462 layout = self.layout
2464 mesh = context.active_object.data
2466 col = layout.column()
2467 col.label(text="Overlays:")
2468 col.prop(mesh, "show_edges", text="Edges")
2469 col.prop(mesh, "show_faces", text="Faces")
2470 col.prop(mesh, "show_edge_crease", text="Creases")
2471 col.prop(mesh, "show_edge_bevel_weight", text="Bevel Weights")
2472 col.prop(mesh, "show_edge_seams", text="Seams")
2473 col.prop(mesh, "show_edge_sharp", text="Sharp")
2476 col.label(text="Normals:")
2478 sub = row.row(align=True)
2479 sub.prop(mesh, "show_normal_vertex", text="", icon='VERTEXSEL')
2480 sub.prop(mesh, "show_normal_face", text="", icon='FACESEL')
2481 row.prop(context.scene.tool_settings, "normal_size", text="Size")
2484 col.label(text="Numerics:")
2485 col.prop(mesh, "show_extra_edge_length")
2486 col.prop(mesh, "show_extra_face_angle")
2487 col.prop(mesh, "show_extra_face_area")
2489 col.prop(mesh, "show_extra_indices")
2492 class VIEW3D_PT_view3d_curvedisplay(Panel):
2493 bl_space_type = 'VIEW_3D'
2494 bl_region_type = 'UI'
2495 bl_label = "Curve Display"
2498 def poll(cls, context):
2499 editmesh = context.mode == 'EDIT_CURVE'
2502 def draw(self, context):
2503 layout = self.layout
2505 curve = context.active_object.data
2507 col = layout.column()
2508 col.label(text="Overlays:")
2509 col.prop(curve, "show_handles", text="Handles")
2510 col.prop(curve, "show_normal_face", text="Normals")
2511 col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
2514 class VIEW3D_PT_background_image(Panel):
2515 bl_space_type = 'VIEW_3D'
2516 bl_region_type = 'UI'
2517 bl_label = "Background Images"
2518 bl_options = {'DEFAULT_CLOSED'}
2520 def draw_header(self, context):
2521 view = context.space_data
2523 self.layout.prop(view, "show_background_images", text="")
2525 def draw(self, context):
2526 layout = self.layout
2528 view = context.space_data
2530 col = layout.column()
2531 col.operator("view3d.background_image_add", text="Add Image")
2533 for i, bg in enumerate(view.background_images):
2534 layout.active = view.show_background_images
2536 row = box.row(align=True)
2537 row.prop(bg, "show_expanded", text="", emboss=False)
2538 if bg.source == 'IMAGE' and bg.image:
2539 row.prop(bg.image, "name", text="", emboss=False)
2540 elif bg.source == 'MOVIE_CLIP' and bg.clip:
2541 row.prop(bg.clip, "name", text="", emboss=False)
2543 row.label(text="Not Set")
2545 if bg.show_background_image:
2546 row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_OFF')
2548 row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_ON')
2550 row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
2552 box.prop(bg, "view_axis", text="Axis")
2554 if bg.show_expanded:
2556 row.prop(bg, "source", expand=True)
2559 if bg.source == 'IMAGE':
2561 row.template_ID(bg, "image", open="image.open")
2562 if bg.image is not None:
2563 box.template_image(bg, "image", bg.image_user, compact=True)
2566 elif bg.source == 'MOVIE_CLIP':
2567 box.prop(bg, "use_camera_clip")
2569 column = box.column()
2570 column.active = not bg.use_camera_clip
2571 column.template_ID(bg, "clip", open="clip.open")
2574 column.template_movieclip(bg, "clip", compact=True)
2576 if bg.use_camera_clip or bg.clip:
2579 column = box.column()
2580 column.active = has_bg
2581 column.prop(bg.clip_user, "proxy_render_size", text="")
2582 column.prop(bg.clip_user, "use_render_undistorted")
2586 col.prop(bg, "opacity", slider=True)
2589 rowsub.prop(bg, "draw_depth", expand=True)
2591 if bg.view_axis in {'CAMERA', 'ALL'}:
2593 rowsub.prop(bg, "frame_method", expand=True)
2595 row = col.row(align=True)
2596 row.prop(bg, "offset_x", text="X")
2597 row.prop(bg, "offset_y", text="Y")
2599 if bg.view_axis != 'CAMERA':
2600 col.prop(bg, "size")
2603 class VIEW3D_PT_transform_orientations(Panel):
2604 bl_space_type = 'VIEW_3D'
2605 bl_region_type = 'UI'
2606 bl_label = "Transform Orientations"
2607 bl_options = {'DEFAULT_CLOSED'}
2610 def poll(cls, context):
2611 view = context.space_data
2614 def draw(self, context):
2615 layout = self.layout
2617 view = context.space_data
2618 orientation = view.current_orientation
2620 row = layout.row(align=True)
2621 row.prop(view, "transform_orientation", text="")
2622 row.operator("transform.create_orientation", text="", icon='ZOOMIN')
2625 row = layout.row(align=True)
2626 row.prop(orientation, "name", text="")
2627 row.operator("transform.delete_orientation", text="", icon="X")
2630 class VIEW3D_PT_etch_a_ton(Panel):
2631 bl_space_type = 'VIEW_3D'
2632 bl_region_type = 'UI'
2633 bl_label = "Skeleton Sketching"
2634 bl_options = {'DEFAULT_CLOSED'}
2637 def poll(cls, context):
2638 scene = context.space_data
2639 ob = context.active_object
2640 return scene and ob and ob.type == 'ARMATURE' and ob.mode == 'EDIT'
2642 def draw_header(self, context):
2643 layout = self.layout
2644 toolsettings = context.scene.tool_settings
2646 layout.prop(toolsettings, "use_bone_sketching", text="")
2648 def draw(self, context):
2649 layout = self.layout
2651 toolsettings = context.scene.tool_settings
2653 col = layout.column()
2655 col.prop(toolsettings, "use_etch_quick")
2656 col.prop(toolsettings, "use_etch_overdraw")
2658 col.prop(toolsettings, "etch_convert_mode")
2660 if toolsettings.etch_convert_mode == 'LENGTH':
2661 col.prop(toolsettings, "etch_length_limit")
2662 elif toolsettings.etch_convert_mode == 'ADAPTIVE':
2663 col.prop(toolsettings, "etch_adaptive_limit")
2664 elif toolsettings.etch_convert_mode == 'FIXED':
2665 col.prop(toolsettings, "etch_subdivision_number")
2666 elif toolsettings.etch_convert_mode == 'RETARGET':
2667 col.prop(toolsettings, "etch_template")
2668 col.prop(toolsettings, "etch_roll_mode")
2669 col.prop(toolsettings, "use_etch_autoname")
2670 col.prop(toolsettings, "etch_number")
2671 col.prop(toolsettings, "etch_side")
2673 col.operator("sketch.convert", text="Convert")
2676 class VIEW3D_PT_context_properties(Panel):
2677 bl_space_type = 'VIEW_3D'
2678 bl_region_type = 'UI'
2679 bl_label = "Properties"
2680 bl_options = {'DEFAULT_CLOSED'}
2682 def _active_context_member(context):
2683 obj = context.object
2687 return "active_pose_bone"
2688 elif mode == 'EDIT' and obj.type == 'ARMATURE':
2689 return "active_bone"
2696 def poll(cls, context):
2697 member = cls._active_context_member(context)
2699 context_member = getattr(context, member)
2700 return context_member and context_member.keys()
2704 def draw(self, context):
2706 member = VIEW3D_PT_context_properties._active_context_member(context)
2709 # Draw with no edit button
2710 rna_prop_ui.draw(self.layout, context, member, object, False)
2714 bpy.utils.register_module(__name__)
2718 bpy.utils.unregister_module(__name__)
2720 if __name__ == "__main__":
2723 if __name__ == "__main__": # only for live edit.
2724 bpy.utils.register_module(__name__)