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 #####
23 class VIEW3D_HT_header(bpy.types.Header):
24 bl_space_type = 'VIEW_3D'
26 def draw(self, context):
29 view = context.space_data
30 mode_string = context.mode
31 edit_object = context.edit_object
32 obj = context.active_object
33 toolsettings = context.tool_settings
35 row = layout.row(align=True)
39 if context.area.show_menus:
40 sub = row.row(align=True)
42 sub.menu("VIEW3D_MT_view")
45 if mode_string not in {'EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
46 sub.menu("VIEW3D_MT_select_%s" % mode_string.lower())
49 sub.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
51 if mode_string not in {'PAINT_TEXTURE'}:
52 sub.menu("VIEW3D_MT_%s" % mode_string.lower())
54 sub.menu("VIEW3D_MT_object")
57 # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
58 row.template_header_3D()
62 if obj.mode == 'PARTICLE_EDIT':
63 row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
66 if view.viewport_shade in {'SOLID', 'SHADED', 'TEXTURED'} and (obj.mode == 'PARTICLE_EDIT' or (obj.mode == 'EDIT' and obj.type == 'MESH')):
67 row.prop(view, "use_occlude_geometry", text="")
69 # Proportional editing
70 if obj.mode in {'EDIT', 'PARTICLE_EDIT'}:
71 row = layout.row(align=True)
72 row.prop(toolsettings, "proportional_edit", text="", icon_only=True)
73 if toolsettings.proportional_edit != 'DISABLED':
74 row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
75 elif obj.mode == 'OBJECT':
76 row = layout.row(align=True)
77 row.prop(toolsettings, "use_proportional_edit_objects", text="", icon_only=True)
78 if toolsettings.use_proportional_edit_objects:
79 row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
82 snap_element = toolsettings.snap_element
83 row = layout.row(align=True)
84 row.prop(toolsettings, "use_snap", text="")
85 row.prop(toolsettings, "snap_element", text="", icon_only=True)
86 if snap_element != 'INCREMENT':
87 row.prop(toolsettings, "snap_target", text="")
89 if obj.mode == 'OBJECT':
90 row.prop(toolsettings, "use_snap_align_rotation", text="")
91 elif obj.mode == 'EDIT':
92 row.prop(toolsettings, "use_snap_self", text="")
94 if snap_element == 'VOLUME':
95 row.prop(toolsettings, "use_snap_peel_object", text="")
96 elif snap_element == 'FACE':
97 row.prop(toolsettings, "use_snap_project", text="")
100 row = layout.row(align=True)
101 row.operator("render.opengl", text="", icon='RENDER_STILL')
102 props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
103 props.animation = True
106 if obj and obj.mode == 'POSE':
107 row = layout.row(align=True)
108 row.operator("pose.copy", text="", icon='COPYDOWN')
109 row.operator("pose.paste", text="", icon='PASTEDOWN')
110 props = row.operator("pose.paste", text="", icon='PASTEFLIPDOWN')
114 # ********** Menu **********
116 # ********** Utilities **********
119 class ShowHideMenu():
120 bl_label = "Show/Hide"
123 def draw(self, context):
126 layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
127 layout.operator("%s.hide" % self._operator_name, text="Hide Selected")
128 layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
131 class VIEW3D_MT_transform(bpy.types.Menu):
132 bl_label = "Transform"
134 # TODO: get rid of the custom text strings?
135 def draw(self, context):
138 layout.operator("transform.translate", text="Grab/Move")
139 # TODO: sub-menu for grab per axis
140 layout.operator("transform.rotate", text="Rotate")
141 # TODO: sub-menu for rot per axis
142 layout.operator("transform.resize", text="Scale")
143 # TODO: sub-menu for scale per axis
147 layout.operator("transform.tosphere", text="To Sphere")
148 layout.operator("transform.shear", text="Shear")
149 layout.operator("transform.warp", text="Warp")
150 layout.operator("transform.push_pull", text="Push/Pull")
154 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
155 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
160 if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and obj.data.draw_type in {'BBONE', 'ENVELOPE'}:
161 layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
163 if context.edit_object and context.edit_object.type == 'ARMATURE':
164 layout.operator("armature.align")
166 layout.operator_context = 'EXEC_REGION_WIN'
167 layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
171 layout.operator_context = 'EXEC_AREA'
173 layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
174 layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
175 layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
179 layout.operator("object.randomize_transform")
180 layout.operator("object.align")
183 class VIEW3D_MT_mirror(bpy.types.Menu):
186 def draw(self, context):
189 layout.operator("transform.mirror", text="Interactive Mirror")
193 layout.operator_context = 'INVOKE_REGION_WIN'
195 props = layout.operator("transform.mirror", text="X Global")
196 props.constraint_axis = (True, False, False)
197 props.constraint_orientation = 'GLOBAL'
198 props = layout.operator("transform.mirror", text="Y Global")
199 props.constraint_axis = (False, True, False)
200 props.constraint_orientation = 'GLOBAL'
201 props = layout.operator("transform.mirror", text="Z Global")
202 props.constraint_axis = (False, False, True)
203 props.constraint_orientation = 'GLOBAL'
205 if context.edit_object:
208 props = layout.operator("transform.mirror", text="X Local")
209 props.constraint_axis = (True, False, False)
210 props.constraint_orientation = 'LOCAL'
211 props = layout.operator("transform.mirror", text="Y Local")
212 props.constraint_axis = (False, True, False)
213 props.constraint_orientation = 'LOCAL'
214 props = layout.operator("transform.mirror", text="Z Local")
215 props.constraint_axis = (False, False, True)
216 props.constraint_orientation = 'LOCAL'
218 layout.operator("object.vertex_group_mirror")
221 class VIEW3D_MT_snap(bpy.types.Menu):
224 def draw(self, context):
227 layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
228 layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
232 layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
233 layout.operator("view3d.snap_cursor_to_center", text="Cursor to Center")
234 layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
235 layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
238 class VIEW3D_MT_uv_map(bpy.types.Menu):
239 bl_label = "UV Mapping"
241 def draw(self, context):
244 layout.operator("uv.unwrap")
246 layout.operator_context = 'INVOKE_DEFAULT'
247 layout.operator("uv.smart_project")
248 layout.operator("uv.lightmap_pack")
249 layout.operator("uv.follow_active_quads")
253 layout.operator_context = 'EXEC_DEFAULT'
254 layout.operator("uv.cube_project")
255 layout.operator("uv.cylinder_project")
256 layout.operator("uv.sphere_project")
260 layout.operator("uv.project_from_view")
261 layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
265 layout.operator("uv.reset")
268 # ********** View menus **********
271 class VIEW3D_MT_view(bpy.types.Menu):
274 def draw(self, context):
277 layout.operator("view3d.properties", icon='MENU_PANEL')
278 layout.operator("view3d.toolshelf", icon='MENU_PANEL')
282 layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA'
283 layout.operator("view3d.viewnumpad", text="Top").type = 'TOP'
284 layout.operator("view3d.viewnumpad", text="Bottom").type = 'BOTTOM'
285 layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT'
286 layout.operator("view3d.viewnumpad", text="Back").type = 'BACK'
287 layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT'
288 layout.operator("view3d.viewnumpad", text="Left").type = 'LEFT'
290 layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
294 layout.operator("view3d.view_persportho")
298 layout.menu("VIEW3D_MT_view_navigation")
299 layout.menu("VIEW3D_MT_view_align")
303 layout.operator_context = 'INVOKE_REGION_WIN'
305 layout.operator("view3d.clip_border", text="Clipping Border...")
306 layout.operator("view3d.zoom_border", text="Zoom Border...")
310 layout.operator("view3d.layers", text="Show All Layers").nr = 0
314 layout.operator("view3d.localview", text="View Global/Local")
315 layout.operator("view3d.view_selected")
316 layout.operator("view3d.view_all")
320 layout.operator("screen.animation_play", text="Playback Animation")
324 layout.operator("screen.area_dupli")
325 layout.operator("screen.region_quadview")
326 layout.operator("screen.screen_full_area")
329 class VIEW3D_MT_view_navigation(bpy.types.Menu):
330 bl_label = "Navigation"
332 def draw(self, context):
335 layout.operator_enum("view3d.view_orbit", "type")
339 layout.operator_enum("view3d.view_pan", "type")
343 layout.operator("view3d.zoom", text="Zoom In").delta = 1
344 layout.operator("view3d.zoom", text="Zoom Out").delta = -1
345 layout.operator("view3d.zoom_camera_1_to_1", text="Zoom Camera 1:1")
349 layout.operator("view3d.fly")
352 class VIEW3D_MT_view_align(bpy.types.Menu):
353 bl_label = "Align View"
355 def draw(self, context):
358 layout.menu("VIEW3D_MT_view_align_selected")
362 layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
363 layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
364 layout.operator("view3d.view_selected")
365 layout.operator("view3d.view_center_cursor")
368 class VIEW3D_MT_view_align_selected(bpy.types.Menu):
369 bl_label = "Align View to Selected"
371 def draw(self, context):
374 props = layout.operator("view3d.viewnumpad", text="Top")
375 props.align_active = True
377 props = layout.operator("view3d.viewnumpad", text="Bottom")
378 props.align_active = True
379 props.type = 'BOTTOM'
380 props = layout.operator("view3d.viewnumpad", text="Front")
381 props.align_active = True
383 props = layout.operator("view3d.viewnumpad", text="Back")
384 props.align_active = True
386 props = layout.operator("view3d.viewnumpad", text="Right")
387 props.align_active = True
389 props = layout.operator("view3d.viewnumpad", text="Left")
390 props.align_active = True
394 class VIEW3D_MT_view_cameras(bpy.types.Menu):
397 def draw(self, context):
400 layout.operator("view3d.object_as_camera")
401 layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA'
403 # ********** Select menus, suffix from context.mode **********
406 class VIEW3D_MT_select_object(bpy.types.Menu):
409 def draw(self, context):
412 layout.operator("view3d.select_border")
413 layout.operator("view3d.select_circle")
417 layout.operator("object.select_all", text="Select/Deselect All")
418 layout.operator("object.select_inverse", text="Inverse")
419 layout.operator("object.select_random", text="Random")
420 layout.operator("object.select_mirror", text="Mirror")
421 layout.operator("object.select_by_layer", text="Select All by Layer")
422 layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
423 layout.operator("object.select_camera", text="Select Camera")
427 layout.operator_menu_enum("object.select_grouped", "type", text="Grouped")
428 layout.operator_menu_enum("object.select_linked", "type", text="Linked")
429 layout.operator("object.select_pattern", text="Select Pattern...")
432 class VIEW3D_MT_select_pose(bpy.types.Menu):
435 def draw(self, context):
438 layout.operator("view3d.select_border")
442 layout.operator("pose.select_all", text="Select/Deselect All")
443 layout.operator("pose.select_inverse", text="Inverse")
444 layout.operator("pose.select_flip_active", text="Flip Active")
445 layout.operator("pose.select_constraint_target", text="Constraint Target")
446 layout.operator("pose.select_linked", text="Linked")
450 layout.operator("pose.select_hierarchy", text="Parent").direction = 'PARENT'
451 layout.operator("pose.select_hierarchy", text="Child").direction = 'CHILD'
455 props = layout.operator("pose.select_hierarchy", text="Extend Parent")
457 props.direction = 'PARENT'
459 props = layout.operator("pose.select_hierarchy", text="Extend Child")
461 props.direction = 'CHILD'
465 layout.operator_menu_enum("pose.select_grouped", "type", text="Grouped")
466 layout.operator("object.select_pattern", text="Select Pattern...")
469 class VIEW3D_MT_select_particle(bpy.types.Menu):
472 def draw(self, context):
475 layout.operator("view3d.select_border")
479 layout.operator("particle.select_all", text="Select/Deselect All")
480 layout.operator("particle.select_linked")
481 layout.operator("particle.select_inverse")
485 layout.operator("particle.select_more")
486 layout.operator("particle.select_less")
490 layout.operator("particle.select_roots", text="Roots")
491 layout.operator("particle.select_tips", text="Tips")
494 class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
497 def draw(self, context):
500 layout.operator("view3d.select_border")
501 layout.operator("view3d.select_circle")
505 layout.operator("mesh.select_all", text="Select/Deselect All")
506 layout.operator("mesh.select_inverse", text="Inverse")
510 layout.operator("mesh.select_random", text="Random")
511 layout.operator("mesh.select_nth", text="Every N Number of Verts")
512 layout.operator("mesh.edges_select_sharp", text="Sharp Edges")
513 layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
514 layout.operator("mesh.faces_select_interior", text="Interior Faces")
515 layout.operator("mesh.select_axis", text="Side of Active")
519 layout.operator("mesh.select_by_number_vertices", text="Triangles").type = 'TRIANGLES'
520 layout.operator("mesh.select_by_number_vertices", text="Quads").type = 'QUADS'
521 if context.scene.tool_settings.mesh_select_mode[2] == False:
522 layout.operator("mesh.select_non_manifold", text="Non Manifold")
523 layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER'
524 layout.operator("mesh.select_similar", text="Similar")
528 layout.operator("mesh.select_less", text="Less")
529 layout.operator("mesh.select_more", text="More")
533 layout.operator("mesh.select_mirror", text="Mirror")
535 layout.operator("mesh.select_linked", text="Linked")
536 layout.operator("mesh.select_vertex_path", text="Vertex Path")
537 layout.operator("mesh.loop_multi_select", text="Edge Loop")
538 layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
542 layout.operator("mesh.loop_to_region")
543 layout.operator("mesh.region_to_loop")
546 class VIEW3D_MT_select_edit_curve(bpy.types.Menu):
549 def draw(self, context):
552 layout.operator("view3d.select_border")
553 layout.operator("view3d.select_circle")
557 layout.operator("curve.select_all", text="Select/Deselect All")
558 layout.operator("curve.select_inverse")
559 layout.operator("curve.select_random")
560 layout.operator("curve.select_nth", text="Every Nth Number of Points")
564 layout.operator("curve.de_select_first")
565 layout.operator("curve.de_select_last")
566 layout.operator("curve.select_next")
567 layout.operator("curve.select_previous")
571 layout.operator("curve.select_more")
572 layout.operator("curve.select_less")
575 class VIEW3D_MT_select_edit_surface(bpy.types.Menu):
578 def draw(self, context):
581 layout.operator("view3d.select_border")
582 layout.operator("view3d.select_circle")
586 layout.operator("curve.select_all", text="Select/Deselect All")
587 layout.operator("curve.select_inverse")
588 layout.operator("curve.select_random")
589 layout.operator("curve.select_nth", text="Every Nth Number of Points")
593 layout.operator("curve.select_row")
597 layout.operator("curve.select_more")
598 layout.operator("curve.select_less")
601 class VIEW3D_MT_select_edit_metaball(bpy.types.Menu):
604 def draw(self, context):
607 layout.operator("view3d.select_border")
611 layout.operator("mball.select_all").action = 'TOGGLE'
612 layout.operator("mball.select_inverse_metaelems")
616 layout.operator("mball.select_random_metaelems")
619 class VIEW3D_MT_select_edit_lattice(bpy.types.Menu):
622 def draw(self, context):
625 layout.operator("view3d.select_border")
629 layout.operator("lattice.select_all", text="Select/Deselect All")
632 class VIEW3D_MT_select_edit_armature(bpy.types.Menu):
635 def draw(self, context):
638 layout.operator("view3d.select_border")
642 layout.operator("armature.select_all", text="Select/Deselect All")
643 layout.operator("armature.select_inverse", text="Inverse")
647 layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
648 layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
652 props = layout.operator("armature.select_hierarchy", text="Extend Parent")
654 props.direction = 'PARENT'
656 props = layout.operator("armature.select_hierarchy", text="Extend Child")
658 props.direction = 'CHILD'
660 layout.operator("object.select_pattern", text="Select Pattern...")
663 class VIEW3D_MT_select_face(bpy.types.Menu): # XXX no matching enum
666 def draw(self, context):
667 # layout = self.layout
670 # see view3d_select_faceselmenu
673 # ********** Object menu **********
676 class VIEW3D_MT_object(bpy.types.Menu):
677 bl_context = "objectmode"
680 def draw(self, context):
683 layout.operator("ed.undo")
684 layout.operator("ed.redo")
685 layout.operator("ed.undo_history")
689 layout.menu("VIEW3D_MT_transform")
690 layout.menu("VIEW3D_MT_mirror")
691 layout.menu("VIEW3D_MT_object_clear")
692 layout.menu("VIEW3D_MT_object_apply")
693 layout.menu("VIEW3D_MT_snap")
697 layout.menu("VIEW3D_MT_object_animation")
701 layout.operator("object.duplicate_move")
702 layout.operator("object.duplicate_move_linked")
703 layout.operator("object.delete", text="Delete...")
704 layout.operator("object.proxy_make", text="Make Proxy...")
705 layout.menu("VIEW3D_MT_make_links", text="Make Links...")
706 layout.operator("object.make_dupli_face")
707 layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
708 layout.menu("VIEW3D_MT_make_single_user")
712 layout.menu("VIEW3D_MT_object_parent")
713 layout.menu("VIEW3D_MT_object_track")
714 layout.menu("VIEW3D_MT_object_group")
715 layout.menu("VIEW3D_MT_object_constraints")
719 layout.menu("VIEW3D_MT_object_game")
723 layout.operator("object.join_uvs")
724 layout.operator("object.join")
728 layout.operator("object.move_to_layer", text="Move to Layer...")
729 layout.menu("VIEW3D_MT_object_showhide")
731 layout.operator_menu_enum("object.convert", "target")
734 class VIEW3D_MT_object_animation(bpy.types.Menu):
735 bl_label = "Animation"
737 def draw(self, context):
740 layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
741 layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
742 layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
745 class VIEW3D_MT_object_clear(bpy.types.Menu):
748 def draw(self, context):
751 layout.operator("object.location_clear", text="Location")
752 layout.operator("object.rotation_clear", text="Rotation")
753 layout.operator("object.scale_clear", text="Scale")
754 layout.operator("object.origin_clear", text="Origin")
757 class VIEW3D_MT_object_specials(bpy.types.Menu):
758 bl_label = "Specials"
761 def poll(cls, context):
762 # add more special types
763 return context.object
765 def draw(self, context):
769 if obj.type == 'CAMERA':
770 layout.operator_context = 'INVOKE_REGION_WIN'
772 if obj.data.type == 'PERSP':
773 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
774 props.data_path_iter = "selected_editable_objects"
775 props.data_path_item = "data.lens"
776 props.input_scale = 0.1
778 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
779 props.data_path_iter = "selected_editable_objects"
780 props.data_path_item = "data.ortho_scale"
781 props.input_scale = 0.01
783 if not obj.data.dof_object:
784 #layout.label(text="Test Has DOF obj");
785 props = layout.operator("wm.context_modal_mouse", text="DOF Distance")
786 props.data_path_iter = "selected_editable_objects"
787 props.data_path_item = "data.dof_distance"
788 props.input_scale = 0.02
790 if obj.type in {'CURVE', 'FONT'}:
791 layout.operator_context = 'INVOKE_REGION_WIN'
793 props = layout.operator("wm.context_modal_mouse", text="Extrude Size")
794 props.data_path_iter = "selected_editable_objects"
795 props.data_path_item = "data.extrude"
796 props.input_scale = 0.01
798 props = layout.operator("wm.context_modal_mouse", text="Width Size")
799 props.data_path_iter = "selected_editable_objects"
800 props.data_path_item = "data.offset"
801 props.input_scale = 0.01
803 if obj.type == 'EMPTY':
804 layout.operator_context = 'INVOKE_REGION_WIN'
806 props = layout.operator("wm.context_modal_mouse", text="Empty Draw Size")
807 props.data_path_iter = "selected_editable_objects"
808 props.data_path_item = "empty_draw_size"
809 props.input_scale = 0.01
811 if obj.type == 'LAMP':
812 layout.operator_context = 'INVOKE_REGION_WIN'
814 props = layout.operator("wm.context_modal_mouse", text="Energy")
815 props.data_path_iter = "selected_editable_objects"
816 props.data_path_item = "data.energy"
818 if obj.data.type in {'SPOT', 'AREA', 'POINT'}:
819 props = layout.operator("wm.context_modal_mouse", text="Falloff Distance")
820 props.data_path_iter = "selected_editable_objects"
821 props.data_path_item = "data.distance"
822 props.input_scale = 0.1
824 if obj.data.type == 'SPOT':
826 props = layout.operator("wm.context_modal_mouse", text="Spot Size")
827 props.data_path_iter = "selected_editable_objects"
828 props.data_path_item = "data.spot_size"
829 props.input_scale = 0.01
831 props = layout.operator("wm.context_modal_mouse", text="Spot Blend")
832 props.data_path_iter = "selected_editable_objects"
833 props.data_path_item = "data.spot_blend"
834 props.input_scale = -0.01
836 props = layout.operator("wm.context_modal_mouse", text="Clip Start")
837 props.data_path_iter = "selected_editable_objects"
838 props.data_path_item = "data.shadow_buffer_clip_start"
839 props.input_scale = 0.05
841 props = layout.operator("wm.context_modal_mouse", text="Clip End")
842 props.data_path_iter = "selected_editable_objects"
843 props.data_path_item = "data.shadow_buffer_clip_end"
844 props.input_scale = 0.05
848 props = layout.operator("object.isolate_type_render")
849 props = layout.operator("object.hide_render_clear_all")
852 class VIEW3D_MT_object_apply(bpy.types.Menu):
855 def draw(self, context):
858 layout.operator("object.transform_apply", text="Location").location = True
859 layout.operator("object.transform_apply", text="Rotation").rotation = True
860 layout.operator("object.transform_apply", text="Scale").scale = True
861 props = layout.operator("object.transform_apply", text="Rotation & Scale")
863 props.rotation = True
867 layout.operator("object.visual_transform_apply", text="Visual Transform")
868 layout.operator("object.duplicates_make_real")
871 class VIEW3D_MT_object_parent(bpy.types.Menu):
874 def draw(self, context):
877 layout.operator("object.parent_set", text="Set")
878 layout.operator("object.parent_clear", text="Clear")
881 class VIEW3D_MT_object_track(bpy.types.Menu):
884 def draw(self, context):
887 layout.operator("object.track_set", text="Set")
888 layout.operator("object.track_clear", text="Clear")
891 class VIEW3D_MT_object_group(bpy.types.Menu):
894 def draw(self, context):
897 layout.operator("group.create")
898 layout.operator("group.objects_remove")
902 layout.operator("group.objects_add_active")
903 layout.operator("group.objects_remove_active")
906 class VIEW3D_MT_object_constraints(bpy.types.Menu):
907 bl_label = "Constraints"
909 def draw(self, context):
912 layout.operator("object.constraint_add_with_targets")
913 layout.operator("object.constraints_copy")
914 layout.operator("object.constraints_clear")
917 class VIEW3D_MT_object_showhide(bpy.types.Menu):
918 bl_label = "Show/Hide"
920 def draw(self, context):
923 layout.operator("object.hide_view_clear", text="Show Hidden")
924 layout.operator("object.hide_view_set", text="Hide Selected")
925 layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
928 class VIEW3D_MT_make_single_user(bpy.types.Menu):
929 bl_label = "Make Single User"
931 def draw(self, context):
934 props = layout.operator("object.make_single_user", text="Object")
937 props = layout.operator("object.make_single_user", text="Object & Data")
938 props.object = props.obdata = True
940 props = layout.operator("object.make_single_user", text="Object & Data & Materials+Tex")
941 props.object = props.obdata = props.material = props.texture = True
943 props = layout.operator("object.make_single_user", text="Materials+Tex")
944 props.material = props.texture = True
946 props = layout.operator("object.make_single_user", text="Object Animation")
947 props.animation = True
950 class VIEW3D_MT_make_links(bpy.types.Menu):
951 bl_label = "Make Links"
953 def draw(self, context):
956 if(len(bpy.data.scenes) > 10):
957 layout.operator_context = 'INVOKE_DEFAULT'
958 layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
959 layout.operator("object.make_links_scene", text="Markers to Scene...", icon='OUTLINER_OB_EMPTY')
961 layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
962 layout.operator_menu_enum("marker.make_links_scene", "scene", text="Markers to Scene...")
964 layout.operator_enum("object.make_links_data", "type") # inline
967 class VIEW3D_MT_object_game(bpy.types.Menu):
970 def draw(self, context):
973 layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks")
977 layout.operator("object.game_property_copy", text="Replace Properties").operation = 'REPLACE'
978 layout.operator("object.game_property_copy", text="Merge Properties").operation = 'MERGE'
979 layout.operator_menu_enum("object.game_property_copy", "property", text="Copy Properties...")
983 layout.operator("object.game_property_clear")
986 # ********** Vertex paint menu **********
989 class VIEW3D_MT_paint_vertex(bpy.types.Menu):
992 def draw(self, context):
995 layout.operator("ed.undo")
996 layout.operator("ed.redo")
1000 layout.operator("paint.vertex_color_set")
1001 layout.operator("paint.vertex_color_dirt")
1004 class VIEW3D_MT_hook(bpy.types.Menu):
1007 def draw(self, context):
1008 layout = self.layout
1009 layout.operator_context = 'EXEC_AREA'
1010 layout.operator("object.hook_add_newob")
1011 layout.operator("object.hook_add_selob")
1013 if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
1015 layout.operator_menu_enum("object.hook_assign", "modifier")
1016 layout.operator_menu_enum("object.hook_remove", "modifier")
1018 layout.operator_menu_enum("object.hook_select", "modifier")
1019 layout.operator_menu_enum("object.hook_reset", "modifier")
1020 layout.operator_menu_enum("object.hook_recenter", "modifier")
1023 class VIEW3D_MT_vertex_group(bpy.types.Menu):
1024 bl_label = "Vertex Groups"
1026 def draw(self, context):
1027 layout = self.layout
1028 layout.operator_context = 'EXEC_AREA'
1029 layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True
1031 ob = context.active_object
1032 if ob.mode == 'EDIT':
1033 if ob.vertex_groups.active:
1035 layout.operator("object.vertex_group_assign", text="Assign to Active Group")
1036 layout.operator("object.vertex_group_remove_from", text="Remove from Active Group")
1037 layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
1040 if ob.vertex_groups.active:
1041 layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
1042 layout.operator("object.vertex_group_remove", text="Remove Active Group")
1043 layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
1045 # ********** Weight paint menu **********
1048 class VIEW3D_MT_paint_weight(bpy.types.Menu):
1049 bl_label = "Weights"
1051 def draw(self, context):
1052 layout = self.layout
1054 layout.operator("ed.undo")
1055 layout.operator("ed.redo")
1056 layout.operator("ed.undo_history")
1060 layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
1061 layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
1065 layout.operator("object.vertex_group_normalize_all", text="Normalize All")
1066 layout.operator("object.vertex_group_normalize", text="Normalize")
1067 layout.operator("object.vertex_group_invert", text="Invert")
1068 layout.operator("object.vertex_group_clean", text="Clean")
1069 layout.operator("object.vertex_group_levels", text="Levels")
1071 layout.operator("object.vertex_group_fix", text="Fix Deforms")
1075 layout.operator("paint.weight_set")
1077 # ********** Sculpt menu **********
1080 class VIEW3D_MT_sculpt(bpy.types.Menu):
1083 def draw(self, context):
1084 layout = self.layout
1086 tool_settings = context.tool_settings
1087 sculpt = tool_settings.sculpt
1088 brush = tool_settings.sculpt.brush
1090 layout.operator("ed.undo")
1091 layout.operator("ed.redo")
1095 layout.prop(sculpt, "use_symmetry_x")
1096 layout.prop(sculpt, "use_symmetry_y")
1097 layout.prop(sculpt, "use_symmetry_z")
1099 layout.prop(sculpt, "lock_x")
1100 layout.prop(sculpt, "lock_y")
1101 layout.prop(sculpt, "lock_z")
1103 layout.operator_menu_enum("brush.curve_preset", "shape")
1106 if brush is not None: # unlikely but can happen
1107 sculpt_tool = brush.sculpt_tool
1109 if sculpt_tool != 'GRAB':
1110 layout.prop_menu_enum(brush, "stroke_method")
1112 if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
1113 layout.prop_menu_enum(brush, "direction")
1115 if sculpt_tool == 'LAYER':
1116 layout.prop(brush, "use_persistent")
1117 layout.operator("sculpt.set_persistent_base")
1120 layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
1121 layout.prop(sculpt, "show_brush")
1123 # TODO, make availabel from paint menu!
1124 layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Unify Size")
1125 layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Unify Strength")
1127 # ********** Particle menu **********
1130 class VIEW3D_MT_particle(bpy.types.Menu):
1131 bl_label = "Particle"
1133 def draw(self, context):
1134 layout = self.layout
1136 particle_edit = context.tool_settings.particle_edit
1138 layout.operator("ed.undo")
1139 layout.operator("ed.redo")
1140 layout.operator("ed.undo_history")
1144 layout.operator("particle.mirror")
1148 layout.operator("particle.remove_doubles")
1149 layout.operator("particle.delete")
1151 if particle_edit.select_mode == 'POINT':
1152 layout.operator("particle.subdivide")
1154 layout.operator("particle.rekey")
1155 layout.operator("particle.weight_set")
1159 layout.menu("VIEW3D_MT_particle_showhide")
1162 class VIEW3D_MT_particle_specials(bpy.types.Menu):
1163 bl_label = "Specials"
1165 def draw(self, context):
1166 layout = self.layout
1167 particle_edit = context.tool_settings.particle_edit
1169 layout.operator("particle.rekey")
1172 if particle_edit.select_mode == 'POINT':
1173 layout.operator("particle.subdivide")
1174 layout.operator("particle.select_roots")
1175 layout.operator("particle.select_tips")
1177 layout.operator("particle.remove_doubles")
1180 class VIEW3D_MT_particle_showhide(ShowHideMenu, bpy.types.Menu):
1181 _operator_name = "particle"
1183 # ********** Pose Menu **********
1186 class VIEW3D_MT_pose(bpy.types.Menu):
1189 def draw(self, context):
1190 layout = self.layout
1192 layout.operator("ed.undo")
1193 layout.operator("ed.redo")
1194 layout.operator("ed.undo_history")
1198 layout.menu("VIEW3D_MT_transform")
1200 layout.menu("VIEW3D_MT_pose_transform")
1201 layout.menu("VIEW3D_MT_pose_apply")
1203 layout.menu("VIEW3D_MT_snap")
1207 layout.menu("VIEW3D_MT_object_animation")
1211 layout.menu("VIEW3D_MT_pose_slide")
1212 layout.menu("VIEW3D_MT_pose_propagate")
1216 layout.operator("pose.copy")
1217 layout.operator("pose.paste")
1218 layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True
1222 layout.menu("VIEW3D_MT_pose_library")
1223 layout.menu("VIEW3D_MT_pose_motion")
1224 layout.menu("VIEW3D_MT_pose_group")
1228 layout.menu("VIEW3D_MT_object_parent")
1229 layout.menu("VIEW3D_MT_pose_ik")
1230 layout.menu("VIEW3D_MT_pose_constraints")
1234 layout.operator_context = 'EXEC_AREA'
1235 layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
1236 layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
1237 layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
1239 layout.operator("pose.flip_names")
1241 layout.operator("pose.quaternions_flip")
1245 layout.operator_context = 'INVOKE_AREA'
1246 layout.operator("pose.armature_layers", text="Change Armature Layers...")
1247 layout.operator("pose.bone_layers", text="Change Bone Layers...")
1251 layout.menu("VIEW3D_MT_pose_showhide")
1252 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
1255 class VIEW3D_MT_pose_transform(bpy.types.Menu):
1256 bl_label = "Clear Transform"
1258 def draw(self, context):
1259 layout = self.layout
1261 layout.operator("pose.transforms_clear", text="All")
1263 layout.operator("pose.loc_clear", text="Location")
1264 layout.operator("pose.rot_clear", text="Rotation")
1265 layout.operator("pose.scale_clear", text="Scale")
1267 layout.label(text="Origin")
1270 class VIEW3D_MT_pose_slide(bpy.types.Menu):
1271 bl_label = "In-Betweens"
1273 def draw(self, context):
1274 layout = self.layout
1276 layout.operator("pose.push")
1277 layout.operator("pose.relax")
1278 layout.operator("pose.breakdown")
1281 class VIEW3D_MT_pose_propagate(bpy.types.Menu):
1282 bl_label = "Propagate"
1284 def draw(self, context):
1285 layout = self.layout
1287 layout.operator("pose.propagate")
1291 layout.operator("pose.propagate", text="To Next Keyframe").mode = 'NEXT_KEY'
1292 layout.operator("pose.propagate", text="To Last Keyframe (Make Cyclic)").mode = 'LAST_KEY'
1296 layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
1299 class VIEW3D_MT_pose_library(bpy.types.Menu):
1300 bl_label = "Pose Library"
1302 def draw(self, context):
1303 layout = self.layout
1305 layout.operator("poselib.browse_interactive", text="Browse Poses...")
1309 layout.operator("poselib.pose_add", text="Add Pose...")
1310 layout.operator("poselib.pose_rename", text="Rename Pose...")
1311 layout.operator("poselib.pose_remove", text="Remove Pose...")
1314 class VIEW3D_MT_pose_motion(bpy.types.Menu):
1315 bl_label = "Motion Paths"
1317 def draw(self, context):
1318 layout = self.layout
1320 layout.operator("pose.paths_calculate", text="Calculate")
1321 layout.operator("pose.paths_clear", text="Clear")
1324 class VIEW3D_MT_pose_group(bpy.types.Menu):
1325 bl_label = "Bone Groups"
1327 def draw(self, context):
1328 layout = self.layout
1329 layout.operator("pose.group_add")
1330 layout.operator("pose.group_remove")
1334 layout.operator("pose.group_assign")
1335 layout.operator("pose.group_unassign")
1338 class VIEW3D_MT_pose_ik(bpy.types.Menu):
1339 bl_label = "Inverse Kinematics"
1341 def draw(self, context):
1342 layout = self.layout
1344 layout.operator("pose.ik_add")
1345 layout.operator("pose.ik_clear")
1348 class VIEW3D_MT_pose_constraints(bpy.types.Menu):
1349 bl_label = "Constraints"
1351 def draw(self, context):
1352 layout = self.layout
1354 layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
1355 layout.operator("pose.constraints_copy")
1356 layout.operator("pose.constraints_clear")
1359 class VIEW3D_MT_pose_showhide(ShowHideMenu, bpy.types.Menu):
1360 _operator_name = "pose"
1363 class VIEW3D_MT_pose_apply(bpy.types.Menu):
1366 def draw(self, context):
1367 layout = self.layout
1369 layout.operator("pose.armature_apply")
1370 layout.operator("pose.visual_transform_apply")
1374 def draw(self, context):
1375 layout = self.layout
1380 "use_envelope_multiply",
1381 "use_inherit_rotation",
1382 "use_inherit_scale",
1385 if context.mode == 'EDIT_ARMATURE':
1386 bone_props = bpy.types.EditBone.bl_rna.properties
1387 data_path_iter = "selected_bones"
1389 options.append("lock")
1391 bone_props = bpy.types.Bone.bl_rna.properties
1392 data_path_iter = "selected_pose_bones"
1393 opt_suffix = "bone."
1396 props = layout.operator("wm.context_collection_boolean_set", text=bone_props[opt].name)
1397 props.data_path_iter = data_path_iter
1398 props.data_path_item = opt_suffix + opt
1399 props.type = self.type
1402 class VIEW3D_MT_bone_options_toggle(bpy.types.Menu, BoneOptions):
1403 bl_label = "Toggle Bone Options"
1407 class VIEW3D_MT_bone_options_enable(bpy.types.Menu, BoneOptions):
1408 bl_label = "Enable Bone Options"
1412 class VIEW3D_MT_bone_options_disable(bpy.types.Menu, BoneOptions):
1413 bl_label = "Disable Bone Options"
1416 # ********** Edit Menus, suffix from ob.type **********
1419 class VIEW3D_MT_edit_mesh(bpy.types.Menu):
1422 def draw(self, context):
1423 layout = self.layout
1425 settings = context.tool_settings
1427 layout.operator("ed.undo")
1428 layout.operator("ed.redo")
1429 layout.operator("ed.undo_history")
1433 layout.menu("VIEW3D_MT_transform")
1434 layout.menu("VIEW3D_MT_mirror")
1435 layout.menu("VIEW3D_MT_snap")
1439 layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...")
1443 layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
1444 layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
1445 layout.operator("mesh.duplicate_move")
1446 layout.operator("mesh.delete", text="Delete...")
1450 layout.menu("VIEW3D_MT_edit_mesh_vertices")
1451 layout.menu("VIEW3D_MT_edit_mesh_edges")
1452 layout.menu("VIEW3D_MT_edit_mesh_faces")
1453 layout.menu("VIEW3D_MT_edit_mesh_normals")
1457 layout.prop(settings, "use_mesh_automerge")
1458 layout.prop_menu_enum(settings, "proportional_edit")
1459 layout.prop_menu_enum(settings, "proportional_edit_falloff")
1463 layout.menu("VIEW3D_MT_edit_mesh_showhide")
1466 class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
1467 bl_label = "Specials"
1469 def draw(self, context):
1470 layout = self.layout
1472 layout.operator_context = 'INVOKE_REGION_WIN'
1474 layout.operator("mesh.subdivide", text="Subdivide")
1475 layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
1476 layout.operator("mesh.merge", text="Merge...")
1477 layout.operator("mesh.remove_doubles")
1478 layout.operator("mesh.hide", text="Hide")
1479 layout.operator("mesh.reveal", text="Reveal")
1480 layout.operator("mesh.select_inverse")
1481 layout.operator("mesh.flip_normals")
1482 layout.operator("mesh.vertices_smooth", text="Smooth")
1483 # layout.operator("mesh.bevel", text="Bevel")
1484 layout.operator("mesh.faces_shade_smooth")
1485 layout.operator("mesh.faces_shade_flat")
1486 layout.operator("mesh.blend_from_shape")
1487 layout.operator("mesh.shape_propagate_to_all")
1488 layout.operator("mesh.select_vertex_path")
1491 class VIEW3D_MT_edit_mesh_select_mode(bpy.types.Menu):
1492 bl_label = "Mesh Select Mode"
1494 def draw(self, context):
1495 layout = self.layout
1497 layout.operator_context = 'INVOKE_REGION_WIN'
1499 prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
1500 prop.value = "(True, False, False)"
1501 prop.data_path = "tool_settings.mesh_select_mode"
1503 prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
1504 prop.value = "(False, True, False)"
1505 prop.data_path = "tool_settings.mesh_select_mode"
1507 prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
1508 prop.value = "(False, False, True)"
1509 prop.data_path = "tool_settings.mesh_select_mode"
1512 class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu):
1513 bl_label = "Extrude"
1515 _extrude_funcs = { \
1516 "VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"),
1517 "EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"),
1518 "FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"),
1519 "REGION": lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"),
1523 def extrude_options(context):
1524 mesh = context.object.data
1525 select_mode = context.tool_settings.mesh_select_mode
1528 if mesh.total_face_sel:
1529 menu += ["REGION", "FACE"]
1530 if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
1532 if mesh.total_vert_sel and select_mode[0]:
1535 # should never get here
1538 def draw(self, context):
1539 layout = self.layout
1540 layout.operator_context = 'INVOKE_REGION_WIN'
1542 for menu_id in self.extrude_options(context):
1543 self._extrude_funcs[menu_id](layout)
1546 class VIEW3D_OT_edit_mesh_extrude_individual_move(bpy.types.Operator):
1547 "Extrude individual elements and move"
1548 bl_label = "Extrude Individual and Move"
1549 bl_idname = "view3d.edit_mesh_extrude_individual_move"
1551 def execute(self, context):
1552 mesh = context.object.data
1553 select_mode = context.tool_settings.mesh_select_mode
1555 totface = mesh.total_face_sel
1556 totedge = mesh.total_edge_sel
1557 # totvert = mesh.total_vert_sel
1559 if select_mode[2] and totface == 1:
1560 bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
1561 elif select_mode[2] and totface > 1:
1562 bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN')
1563 elif select_mode[1] and totedge >= 1:
1564 bpy.ops.mesh.extrude_edges_move('INVOKE_REGION_WIN')
1566 bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN')
1568 # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
1571 def invoke(self, context, event):
1572 return self.execute(context)
1575 class VIEW3D_OT_edit_mesh_extrude_move(bpy.types.Operator):
1576 "Extrude and move along normals"
1577 bl_label = "Extrude and Move on Normals"
1578 bl_idname = "view3d.edit_mesh_extrude_move_normal"
1580 def execute(self, context):
1581 mesh = context.object.data
1583 totface = mesh.total_face_sel
1584 totedge = mesh.total_edge_sel
1585 # totvert = mesh.total_vert_sel
1588 bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
1590 bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (True, True, False)})
1592 bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
1594 # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
1597 def invoke(self, context, event):
1598 return self.execute(context)
1601 class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
1602 bl_label = "Vertices"
1604 def draw(self, context):
1605 layout = self.layout
1606 layout.operator_context = 'INVOKE_REGION_WIN'
1608 layout.operator("mesh.merge")
1609 layout.operator("mesh.rip_move")
1610 layout.operator("mesh.split")
1611 layout.operator("mesh.separate")
1615 layout.operator("mesh.vertices_smooth")
1616 layout.operator("mesh.remove_doubles")
1617 layout.operator("mesh.vertices_sort")
1618 layout.operator("mesh.vertices_randomize")
1620 layout.operator("mesh.select_vertex_path")
1622 layout.operator("mesh.blend_from_shape")
1624 layout.operator("object.vertex_group_blend")
1625 layout.operator("mesh.shape_propagate_to_all")
1629 layout.menu("VIEW3D_MT_vertex_group")
1630 layout.menu("VIEW3D_MT_hook")
1633 class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
1636 def draw(self, context):
1637 layout = self.layout
1638 layout.operator_context = 'INVOKE_REGION_WIN'
1640 layout.operator("mesh.edge_face_add")
1641 layout.operator("mesh.subdivide")
1645 layout.operator("mesh.mark_seam")
1646 layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
1650 layout.operator("mesh.mark_sharp")
1651 layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
1655 layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
1656 layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
1660 layout.operator("TRANSFORM_OT_edge_slide")
1661 layout.operator("TRANSFORM_OT_edge_crease")
1662 layout.operator("mesh.loop_multi_select", text="Edge Loop")
1664 # uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
1665 # uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0);
1667 layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
1669 layout.operator("mesh.loop_to_region")
1670 layout.operator("mesh.region_to_loop")
1673 class VIEW3D_MT_edit_mesh_faces(bpy.types.Menu):
1675 bl_idname = "VIEW3D_MT_edit_mesh_faces"
1677 def draw(self, context):
1678 layout = self.layout
1679 layout.operator_context = 'INVOKE_REGION_WIN'
1681 layout.operator("mesh.flip_normals")
1682 # layout.operator("mesh.bevel")
1683 # layout.operator("mesh.bevel")
1684 layout.operator("mesh.edge_face_add")
1685 layout.operator("mesh.fill")
1686 layout.operator("mesh.beautify_fill")
1687 layout.operator("mesh.solidify")
1688 layout.operator("mesh.sort_faces")
1692 layout.operator("mesh.fgon_make")
1693 layout.operator("mesh.fgon_clear")
1697 layout.operator("mesh.quads_convert_to_tris")
1698 layout.operator("mesh.tris_convert_to_quads")
1699 layout.operator("mesh.edge_flip")
1703 layout.operator("mesh.faces_shade_smooth")
1704 layout.operator("mesh.faces_shade_flat")
1708 # uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1);
1709 # uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
1711 layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
1715 layout.operator_menu_enum("mesh.uvs_rotate", "direction")
1716 layout.operator_menu_enum("mesh.uvs_mirror", "axis")
1717 layout.operator_menu_enum("mesh.colors_rotate", "direction")
1718 layout.operator_menu_enum("mesh.colors_mirror", "axis")
1721 class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
1722 bl_label = "Normals"
1724 def draw(self, context):
1725 layout = self.layout
1727 layout.operator("mesh.normals_make_consistent", text="Recalculate Outside")
1728 layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True
1732 layout.operator("mesh.flip_normals")
1735 class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, bpy.types.Menu):
1736 _operator_name = "mesh"
1739 # draw_curve is used by VIEW3D_MT_edit_curve and VIEW3D_MT_edit_surface
1742 def draw_curve(self, context):
1743 layout = self.layout
1745 settings = context.tool_settings
1747 layout.menu("VIEW3D_MT_transform")
1748 layout.menu("VIEW3D_MT_mirror")
1749 layout.menu("VIEW3D_MT_snap")
1753 layout.operator("curve.extrude")
1754 layout.operator("curve.duplicate")
1755 layout.operator("curve.separate")
1756 layout.operator("curve.make_segment")
1757 layout.operator("curve.cyclic_toggle")
1758 layout.operator("curve.delete", text="Delete...")
1762 layout.menu("VIEW3D_MT_edit_curve_ctrlpoints")
1763 layout.menu("VIEW3D_MT_edit_curve_segments")
1767 layout.prop_menu_enum(settings, "proportional_edit")
1768 layout.prop_menu_enum(settings, "proportional_edit_falloff")
1772 layout.menu("VIEW3D_MT_edit_curve_showhide")
1775 class VIEW3D_MT_edit_curve(bpy.types.Menu):
1781 class VIEW3D_MT_edit_curve_ctrlpoints(bpy.types.Menu):
1782 bl_label = "Control Points"
1784 def draw(self, context):
1785 layout = self.layout
1787 edit_object = context.edit_object
1789 if edit_object.type == 'CURVE':
1790 layout.operator("transform.transform", text="Tilt").mode = 'TILT'
1791 layout.operator("curve.tilt_clear")
1792 layout.operator("curve.separate")
1796 layout.operator_menu_enum("curve.handle_type_set", "type")
1800 layout.menu("VIEW3D_MT_hook")
1803 class VIEW3D_MT_edit_curve_segments(bpy.types.Menu):
1804 bl_label = "Segments"
1806 def draw(self, context):
1807 layout = self.layout
1809 layout.operator("curve.subdivide")
1810 layout.operator("curve.switch_direction")
1813 class VIEW3D_MT_edit_curve_specials(bpy.types.Menu):
1814 bl_label = "Specials"
1816 def draw(self, context):
1817 layout = self.layout
1819 layout.operator("curve.subdivide")
1820 layout.operator("curve.switch_direction")
1821 layout.operator("curve.spline_weight_set")
1822 layout.operator("curve.radius_set")
1823 layout.operator("curve.smooth")
1824 layout.operator("curve.smooth_radius")
1827 class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, bpy.types.Menu):
1828 _operator_name = "curve"
1831 class VIEW3D_MT_edit_surface(bpy.types.Menu):
1832 bl_label = "Surface"
1837 class VIEW3D_MT_edit_font(bpy.types.Menu):
1840 def draw(self, context):
1841 layout = self.layout
1843 layout.operator("font.file_paste")
1847 layout.menu("VIEW3D_MT_edit_text_chars")
1851 layout.operator("font.style_toggle", text="Toggle Bold").style = 'BOLD'
1852 layout.operator("font.style_toggle", text="Toggle Italic").style = 'ITALIC'
1853 layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE'
1854 layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS'
1857 class VIEW3D_MT_edit_text_chars(bpy.types.Menu):
1858 bl_label = "Special Characters"
1860 def draw(self, context):
1861 layout = self.layout
1863 layout.operator("font.text_insert", text="Copyright|Alt C").text = b'\xC2\xA9'.decode()
1864 layout.operator("font.text_insert", text="Registered Trademark|Alt R").text = b'\xC2\xAE'.decode()
1868 layout.operator("font.text_insert", text="Degree Sign|Alt G").text = b'\xC2\xB0'.decode()
1869 layout.operator("font.text_insert", text="Multiplication Sign|Alt x").text = b'\xC3\x97'.decode()
1870 layout.operator("font.text_insert", text="Circle|Alt .").text = b'\xC2\x8A'.decode()
1871 layout.operator("font.text_insert", text="Superscript 1|Alt 1").text = b'\xC2\xB9'.decode()
1872 layout.operator("font.text_insert", text="Superscript 2|Alt 2").text = b'\xC2\xB2'.decode()
1873 layout.operator("font.text_insert", text="Superscript 3|Alt 3").text = b'\xC2\xB3'.decode()
1874 layout.operator("font.text_insert", text="Double >>|Alt >").text = b'\xC2\xBB'.decode()
1875 layout.operator("font.text_insert", text="Double <<|Alt <").text = b'\xC2\xAB'.decode()
1876 layout.operator("font.text_insert", text="Promillage|Alt %").text = b'\xE2\x80\xB0'.decode()
1880 layout.operator("font.text_insert", text="Dutch Florin|Alt F").text = b'\xC2\xA4'.decode()
1881 layout.operator("font.text_insert", text="British Pound|Alt L").text = b'\xC2\xA3'.decode()
1882 layout.operator("font.text_insert", text="Japanese Yen|Alt Y").text = b'\xC2\xA5'.decode()
1886 layout.operator("font.text_insert", text="German S|Alt S").text = b'\xC3\x9F'.decode()
1887 layout.operator("font.text_insert", text="Spanish Question Mark|Alt ?").text = b'\xC2\xBF'.decode()
1888 layout.operator("font.text_insert", text="Spanish Exclamation Mark|Alt !").text = b'\xC2\xA1'.decode()
1891 class VIEW3D_MT_edit_meta(bpy.types.Menu):
1892 bl_label = "Metaball"
1894 def draw(self, context):
1895 layout = self.layout
1897 settings = context.tool_settings
1899 layout.operator("ed.undo")
1900 layout.operator("ed.redo")
1901 layout.operator("ed.undo_history")
1905 layout.menu("VIEW3D_MT_transform")
1906 layout.menu("VIEW3D_MT_mirror")
1907 layout.menu("VIEW3D_MT_snap")
1911 layout.operator("mball.delete_metaelems", text="Delete...")
1912 layout.operator("mball.duplicate_metaelems")
1916 layout.prop_menu_enum(settings, "proportional_edit")
1917 layout.prop_menu_enum(settings, "proportional_edit_falloff")
1921 layout.menu("VIEW3D_MT_edit_meta_showhide")
1924 class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu):
1925 bl_label = "Show/Hide"
1927 def draw(self, context):
1928 layout = self.layout
1930 layout.operator("mball.reveal_metaelems", text="Show Hidden")
1931 layout.operator("mball.hide_metaelems", text="Hide Selected")
1932 layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
1935 class VIEW3D_MT_edit_lattice(bpy.types.Menu):
1936 bl_label = "Lattice"
1938 def draw(self, context):
1939 layout = self.layout
1941 settings = context.tool_settings
1943 layout.menu("VIEW3D_MT_transform")
1944 layout.menu("VIEW3D_MT_mirror")
1945 layout.menu("VIEW3D_MT_snap")
1949 layout.operator("lattice.make_regular")
1953 layout.prop_menu_enum(settings, "proportional_edit")
1954 layout.prop_menu_enum(settings, "proportional_edit_falloff")
1957 class VIEW3D_MT_edit_armature(bpy.types.Menu):
1958 bl_label = "Armature"
1960 def draw(self, context):
1961 layout = self.layout
1963 edit_object = context.edit_object
1964 arm = edit_object.data
1966 layout.menu("VIEW3D_MT_transform")
1967 layout.menu("VIEW3D_MT_mirror")
1968 layout.menu("VIEW3D_MT_snap")
1969 layout.menu("VIEW3D_MT_edit_armature_roll")
1973 layout.operator("armature.extrude_move")
1975 if arm.use_mirror_x:
1976 layout.operator("armature.extrude_forked")
1978 layout.operator("armature.duplicate_move")
1979 layout.operator("armature.merge")
1980 layout.operator("armature.fill")
1981 layout.operator("armature.delete")
1982 layout.operator("armature.separate")
1986 layout.operator("armature.subdivide", text="Subdivide")
1987 layout.operator("armature.switch_direction", text="Switch Direction")
1991 layout.operator_context = 'EXEC_AREA'
1992 layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
1993 layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
1994 layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
1995 layout.operator("armature.flip_names")
1999 layout.operator_context = 'INVOKE_DEFAULT'
2000 layout.operator("armature.armature_layers")
2001 layout.operator("armature.bone_layers")
2005 layout.menu("VIEW3D_MT_edit_armature_parent")
2009 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
2012 class VIEW3D_MT_armature_specials(bpy.types.Menu):
2013 bl_label = "Specials"
2015 def draw(self, context):
2016 layout = self.layout
2018 layout.operator_context = 'INVOKE_REGION_WIN'
2020 layout.operator("armature.subdivide", text="Subdivide")
2021 layout.operator("armature.switch_direction", text="Switch Direction")
2025 layout.operator_context = 'EXEC_REGION_WIN'
2026 layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
2027 layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
2028 layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
2029 layout.operator("armature.flip_names", text="Flip Names")
2032 class VIEW3D_MT_edit_armature_parent(bpy.types.Menu):
2035 def draw(self, context):
2036 layout = self.layout
2038 layout.operator("armature.parent_set", text="Make")
2039 layout.operator("armature.parent_clear", text="Clear")
2042 class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
2043 bl_label = "Bone Roll"
2045 def draw(self, context):
2046 layout = self.layout
2048 layout.operator_menu_enum("armature.calculate_roll", "type")
2052 layout.operator("transform.transform", text="Set Roll").mode = 'BONE_ROLL'
2054 # ********** Panel **********
2057 class VIEW3D_PT_view3d_properties(bpy.types.Panel):
2058 bl_space_type = 'VIEW_3D'
2059 bl_region_type = 'UI'
2063 def poll(cls, context):
2064 view = context.space_data
2067 def draw(self, context):
2068 layout = self.layout
2070 view = context.space_data
2072 col = layout.column()
2073 col.active = view.region_3d.view_perspective != 'CAMERA'
2074 col.prop(view, "lens")
2075 col.label(text="Lock to Object:")
2076 col.prop(view, "lock_object", text="")
2077 if view.lock_object and view.lock_object.type == 'ARMATURE':
2078 col.prop_search(view, "lock_bone", view.lock_object.data, "bones", text="")
2079 elif not view.lock_object:
2080 col.prop(view, "lock_cursor", text="Lock to Cursor")
2082 col = layout.column()
2083 col.prop(view, "lock_camera")
2085 col = layout.column(align=True)
2086 col.label(text="Clip:")
2087 col.prop(view, "clip_start", text="Start")
2088 col.prop(view, "clip_end", text="End")
2090 subcol = col.column()
2091 subcol.enabled = not view.lock_camera_and_layers
2092 subcol.label(text="Local Camera:")
2093 subcol.prop(view, "camera", text="")
2095 layout.column().prop(view, "cursor_location")
2098 class VIEW3D_PT_view3d_name(bpy.types.Panel):
2099 bl_space_type = 'VIEW_3D'
2100 bl_region_type = 'UI'
2104 def poll(cls, context):
2105 return (context.space_data and context.active_object)
2107 def draw(self, context):
2108 layout = self.layout
2110 ob = context.active_object
2112 row.label(text="", icon='OBJECT_DATA')
2113 row.prop(ob, "name", text="")
2115 if ob.type == 'ARMATURE' and ob.mode in {'EDIT', 'POSE'}:
2116 bone = context.active_bone
2119 row.label(text="", icon='BONE_DATA')
2120 row.prop(bone, "name", text="")
2123 class VIEW3D_PT_view3d_display(bpy.types.Panel):
2124 bl_space_type = 'VIEW_3D'
2125 bl_region_type = 'UI'
2126 bl_label = "Display"
2127 bl_options = {'DEFAULT_CLOSED'}
2130 def poll(cls, context):
2131 view = context.space_data
2134 def draw(self, context):
2135 layout = self.layout
2137 view = context.space_data
2138 scene = context.scene
2139 gs = scene.game_settings
2142 col = layout.column()
2143 col.prop(view, "show_only_render")
2145 col = layout.column()
2146 display_all = not view.show_only_render
2147 col.active = display_all
2148 col.prop(view, "show_outline_selected")
2149 col.prop(view, "show_all_objects_origin")
2150 col.prop(view, "show_relationship_lines")
2151 if ob and ob.type == 'MESH':
2153 col.prop(mesh, "show_all_edges")
2155 col = layout.column()
2156 col.active = display_all
2157 split = col.split(percentage=0.55)
2158 split.prop(view, "show_floor", text="Grid Floor")
2160 row = split.row(align=True)
2161 row.prop(view, "show_axis_x", text="X", toggle=True)
2162 row.prop(view, "show_axis_y", text="Y", toggle=True)
2163 row.prop(view, "show_axis_z", text="Z", toggle=True)
2165 sub = col.column(align=True)
2166 sub.active = (display_all and view.show_floor)
2167 sub.prop(view, "grid_lines", text="Lines")
2168 sub.prop(view, "grid_scale", text="Scale")
2169 subsub = sub.column(align=True)
2170 subsub.active = scene.unit_settings.system == 'NONE'
2171 subsub.prop(view, "grid_subdivisions", text="Subdivisions")
2173 col = layout.column()
2174 col.label(text="Shading:")
2175 col.prop(gs, "material_mode", text="")
2176 col.prop(view, "show_textured_solid")
2180 region = view.region_quadview
2182 layout.operator("screen.region_quadview", text="Toggle Quad View")
2185 col = layout.column()
2186 col.prop(region, "lock_rotation")
2188 row.enabled = region.lock_rotation
2189 row.prop(region, "show_sync_view")
2191 row.enabled = region.lock_rotation and region.show_sync_view
2192 row.prop(region, "use_box_clip")
2195 class VIEW3D_PT_view3d_meshdisplay(bpy.types.Panel):
2196 bl_space_type = 'VIEW_3D'
2197 bl_region_type = 'UI'
2198 bl_label = "Mesh Display"
2201 def poll(cls, context):
2202 # The active object check is needed because of localmode
2203 return (context.active_object and (context.mode == 'EDIT_MESH'))
2205 def draw(self, context):
2206 layout = self.layout
2208 mesh = context.active_object.data
2210 col = layout.column()
2211 col.label(text="Overlays:")
2212 col.prop(mesh, "show_edges", text="Edges")
2213 col.prop(mesh, "show_faces", text="Faces")
2214 col.prop(mesh, "show_edge_crease", text="Creases")
2215 col.prop(mesh, "show_edge_bevel_weight", text="Bevel Weights")
2216 col.prop(mesh, "show_edge_seams", text="Seams")
2217 col.prop(mesh, "show_edge_sharp", text="Sharp")
2220 col.label(text="Normals:")
2221 col.prop(mesh, "show_normal_face", text="Face")
2222 col.prop(mesh, "show_normal_vertex", text="Vertex")
2223 col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
2226 col.label(text="Numerics:")
2227 col.prop(mesh, "show_extra_edge_length")
2228 col.prop(mesh, "show_extra_face_angle")
2229 col.prop(mesh, "show_extra_face_area")
2232 class VIEW3D_PT_view3d_curvedisplay(bpy.types.Panel):
2233 bl_space_type = 'VIEW_3D'
2234 bl_region_type = 'UI'
2235 bl_label = "Curve Display"
2238 def poll(cls, context):
2239 editmesh = context.mode == 'EDIT_CURVE'
2242 def draw(self, context):
2243 layout = self.layout
2245 curve = context.active_object.data
2247 col = layout.column()
2248 col.label(text="Overlays:")
2249 col.prop(curve, "show_handles", text="Handles")
2250 col.prop(curve, "show_normal_face", text="Normals")
2251 col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
2254 class VIEW3D_PT_background_image(bpy.types.Panel):
2255 bl_space_type = 'VIEW_3D'
2256 bl_region_type = 'UI'
2257 bl_label = "Background Images"
2258 bl_options = {'DEFAULT_CLOSED'}
2261 def poll(cls, context):
2262 view = context.space_data
2263 # bg = context.space_data.background_image
2266 def draw_header(self, context):
2267 layout = self.layout
2268 view = context.space_data
2270 layout.prop(view, "show_background_images", text="")
2272 def draw(self, context):
2273 layout = self.layout
2275 view = context.space_data
2277 col = layout.column()
2278 col.operator("view3d.background_image_add", text="Add Image")
2280 for i, bg in enumerate(view.background_images):
2281 layout.active = view.show_background_images
2283 row = box.row(align=True)
2284 row.prop(bg, "show_expanded", text="", emboss=False)
2286 row.prop(bg.image, "name", text="", emboss=False)
2288 row.label(text="Not Set")
2289 row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
2291 box.prop(bg, "view_axis", text="Axis")
2293 if bg.show_expanded:
2295 row.template_ID(bg, "image", open="image.open")
2297 box.template_image(bg, "image", bg.image_user, compact=True)
2299 box.prop(bg, "opacity", slider=True)
2300 if bg.view_axis != 'CAMERA':
2301 box.prop(bg, "size")
2302 row = box.row(align=True)
2303 row.prop(bg, "offset_x", text="X")
2304 row.prop(bg, "offset_y", text="Y")
2307 class VIEW3D_PT_transform_orientations(bpy.types.Panel):
2308 bl_space_type = 'VIEW_3D'
2309 bl_region_type = 'UI'
2310 bl_label = "Transform Orientations"
2311 bl_options = {'DEFAULT_CLOSED'}
2314 def poll(cls, context):
2315 view = context.space_data
2318 def draw(self, context):
2319 layout = self.layout
2321 view = context.space_data
2323 col = layout.column()
2325 col.prop(view, "transform_orientation")
2326 col.operator("transform.create_orientation", text="Create")
2328 orientation = view.current_orientation
2331 col.prop(orientation, "name")
2332 col.operator("transform.delete_orientation", text="Delete")
2335 class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
2336 bl_space_type = 'VIEW_3D'
2337 bl_region_type = 'UI'
2338 bl_label = "Skeleton Sketching"
2339 bl_options = {'DEFAULT_CLOSED'}
2342 def poll(cls, context):
2343 scene = context.space_data
2344 ob = context.active_object
2345 return scene and ob and ob.type == 'ARMATURE' and ob.mode == 'EDIT'
2347 def draw_header(self, context):
2348 layout = self.layout
2349 toolsettings = context.scene.tool_settings
2351 layout.prop(toolsettings, "use_bone_sketching", text="")
2353 def draw(self, context):
2354 layout = self.layout
2355 toolsettings = context.scene.tool_settings
2357 col = layout.column()
2359 col.prop(toolsettings, "use_etch_quick")
2360 col.prop(toolsettings, "use_etch_overdraw")
2362 col.prop(toolsettings, "etch_convert_mode")
2364 if toolsettings.etch_convert_mode == 'LENGTH':
2365 col.prop(toolsettings, "etch_length_limit")
2366 elif toolsettings.etch_convert_mode == 'ADAPTIVE':
2367 col.prop(toolsettings, "etch_adaptive_limit")
2368 elif toolsettings.etch_convert_mode == 'FIXED':
2369 col.prop(toolsettings, "etch_subdivision_number")
2370 elif toolsettings.etch_convert_mode == 'RETARGET':
2371 col.prop(toolsettings, "etch_template")
2372 col.prop(toolsettings, "etch_roll_mode")
2373 col.prop(toolsettings, "use_etch_autoname")
2374 col.prop(toolsettings, "etch_number")
2375 col.prop(toolsettings, "etch_side")
2377 col.operator("sketch.convert", text="Convert")
2380 class VIEW3D_PT_context_properties(bpy.types.Panel):
2381 bl_space_type = 'VIEW_3D'
2382 bl_region_type = 'UI'
2383 bl_label = "Properties"
2384 bl_options = {'DEFAULT_CLOSED'}
2386 def _active_context_member(context):
2387 obj = context.object
2391 return "active_pose_bone"
2392 elif mode == 'EDIT' and obj.type == 'ARMATURE':
2393 return "active_bone"
2400 def poll(cls, context):
2401 member = cls._active_context_member(context)
2403 context_member = getattr(context, member)
2404 return context_member and context_member.keys()
2408 def draw(self, context):
2410 member = VIEW3D_PT_context_properties._active_context_member(context)
2413 # Draw with no edit button
2414 rna_prop_ui.draw(self.layout, context, member, object, False)
2418 bpy.utils.register_module(__name__)
2422 bpy.utils.unregister_module(__name__)
2424 if __name__ == "__main__":
2427 if __name__ == "__main__": # only for live edit.
2428 bpy.utils.register_module(__name__)