diff options
Diffstat (limited to 'release/scripts/ui/space_view3d.py')
-rw-r--r-- | release/scripts/ui/space_view3d.py | 240 |
1 files changed, 174 insertions, 66 deletions
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 865e132745b..bab3695a0b6 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -32,13 +32,12 @@ class VIEW3D_HT_header(bpy.types.Header): obj = context.active_object toolsettings = context.tool_settings - row = layout.row() + row = layout.row(align=True) row.template_header() - sub = row.row(align=True) - # Menus if context.area.show_menus: + sub = row.row(align=True) sub.menu("VIEW3D_MT_view") @@ -54,6 +53,7 @@ class VIEW3D_HT_header(bpy.types.Header): else: sub.menu("VIEW3D_MT_object") + row = layout.row() row.template_header_3D() # do in C for now since these buttons cant be both toggle AND exclusive. @@ -81,10 +81,6 @@ class VIEW3D_HT_header(bpy.types.Header): if toolsettings.proportional_editing != 'DISABLED': row.prop(toolsettings, "proportional_editing_falloff", text="", icon_only=True) - # paint save - if mode_string == 'PAINT_TEXTURE': - row.operator("image.save_dirty", text="Save Edited") - # Snap row = layout.row(align=True) row.prop(toolsettings, "snap", text="") @@ -100,8 +96,8 @@ class VIEW3D_HT_header(bpy.types.Header): # OpenGL render row = layout.row(align=True) - row.operator("screen.opengl_render", text="", icon='RENDER_STILL') - props = row.operator("screen.opengl_render", text="", icon='RENDER_ANIMATION') + row.operator("render.opengl", text="", icon='RENDER_STILL') + props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION') props.animation = True # Pose @@ -149,7 +145,7 @@ class VIEW3D_MT_transform(bpy.types.Menu): layout.operator("transform.tosphere", text="To Sphere") layout.operator("transform.shear", text="Shear") layout.operator("transform.warp", text="Warp") - layout.operator("transform.transform", text="Push/Pull").mode = 'PUSHPULL' + layout.operator("transform.push_pull", text="Push/Pull") if context.edit_object and context.edit_object.type == 'ARMATURE': layout.operator("armature.align") else: @@ -211,7 +207,6 @@ class VIEW3D_MT_snap(bpy.types.Menu): layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid") layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor") - layout.operator("view3d.snap_selected_to_center", text="Selection to Origin") layout.separator() @@ -254,8 +249,11 @@ class VIEW3D_MT_view(bpy.types.Menu): layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA' layout.operator("view3d.viewnumpad", text="Top").type = 'TOP' + layout.operator("view3d.viewnumpad", text="Bottom").type = 'BOTTOM' layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT' + layout.operator("view3d.viewnumpad", text="Back").type = 'BACK' layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT' + layout.operator("view3d.viewnumpad", text="Left").type = 'LEFT' layout.menu("VIEW3D_MT_view_cameras", text="Cameras") @@ -388,7 +386,7 @@ class VIEW3D_MT_select_object(bpy.types.Menu): layout.operator("object.select_random", text="Random") layout.operator("object.select_mirror", text="Mirror") layout.operator("object.select_by_layer", text="Select All by Layer") - layout.operator_menu_enum("object.select_by_type", "type", "", text="Select All by Type...") + layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...") layout.operator("object.select_camera", text="Select Camera") layout.separator() @@ -455,8 +453,8 @@ class VIEW3D_MT_select_particle(bpy.types.Menu): layout.separator() - layout.operator("particle.select_first", text="Roots") - layout.operator("particle.select_last", text="Tips") + layout.operator("particle.select_roots", text="Roots") + layout.operator("particle.select_tips", text="Tips") class VIEW3D_MT_select_edit_mesh(bpy.types.Menu): @@ -475,8 +473,8 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu): layout.separator() - layout.operator("mesh.select_random", text="Random...") - layout.operator("mesh.select_nth", text="Select Nth...") + layout.operator("mesh.select_random", text="Random") + layout.operator("mesh.select_nth", text="Every N Number of Verts") layout.operator("mesh.edges_select_sharp", text="Sharp Edges") layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces") layout.operator("mesh.faces_select_interior", text="Interior Faces") @@ -486,8 +484,10 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu): layout.operator("mesh.select_by_number_vertices", text="Triangles").type = 'TRIANGLES' layout.operator("mesh.select_by_number_vertices", text="Quads").type = 'QUADS' + if context.scene.tool_settings.mesh_selection_mode[2] == False: + layout.operator("mesh.select_non_manifold", text="Non Manifold") layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER' - layout.operator("mesh.select_similar", text="Similar...") + layout.operator("mesh.select_similar", text="Similar") layout.separator() @@ -523,7 +523,7 @@ class VIEW3D_MT_select_edit_curve(bpy.types.Menu): layout.operator("curve.select_all", text="Select/Deselect All") layout.operator("curve.select_inverse") layout.operator("curve.select_random") - layout.operator("curve.select_every_nth") + layout.operator("curve.select_nth", text="Every Nth Number of Points") layout.separator() @@ -552,7 +552,7 @@ class VIEW3D_MT_select_edit_surface(bpy.types.Menu): layout.operator("curve.select_all", text="Select/Deselect All") layout.operator("curve.select_inverse") layout.operator("curve.select_random") - layout.operator("curve.select_every_nth") + layout.operator("curve.select_nth", text="Every Nth Number of Points") layout.separator() @@ -656,6 +656,7 @@ class VIEW3D_MT_object(bpy.types.Menu): layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...") layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...") + layout.operator("anim.keying_set_active_set", text="Change Keying Set...") layout.separator() @@ -677,6 +678,11 @@ class VIEW3D_MT_object(bpy.types.Menu): layout.separator() + layout.menu("VIEW3D_MT_object_game_properties") + layout.menu("VIEW3D_MT_object_game_logicbricks") + + layout.separator() + layout.operator("object.join_uvs") layout.operator("object.join") @@ -705,35 +711,86 @@ class VIEW3D_MT_object_specials(bpy.types.Menu): def poll(self, context): # add more special types - obj = context.object - return bool(obj and obj.type == 'LAMP') + return context.object def draw(self, context): layout = self.layout obj = context.object - if obj and obj.type == 'LAMP': + if obj.type == 'CAMERA': layout.operator_context = 'INVOKE_REGION_WIN' - props = layout.operator("wm.context_modal_mouse", text="Spot Size") - props.path_iter = "selected_editable_objects" - props.path_item = "data.spot_size" + props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.lens" + props.input_scale = 0.1 + + if not obj.data.dof_object: + #layout.label(text="Test Has DOF obj"); + props = layout.operator("wm.context_modal_mouse", text="DOF Distance") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.dof_distance" + props.input_scale = 0.02 + + if obj.type in ('CURVE','TEXT'): + layout.operator_context = 'INVOKE_REGION_WIN' + + props = layout.operator("wm.context_modal_mouse", text="Extrude Size") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.extrude" props.input_scale = 0.01 - props = layout.operator("wm.context_modal_mouse", text="Distance") - props.path_iter = "selected_editable_objects" - props.path_item = "data.distance" - props.input_scale = 0.1 + props = layout.operator("wm.context_modal_mouse", text="Width Size") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.width" + props.input_scale = 0.01 + + if obj.type == 'EMPTY': + layout.operator_context = 'INVOKE_REGION_WIN' + + props = layout.operator("wm.context_modal_mouse", text="Empty Draw Size") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "empty_draw_size" + props.input_scale = 0.01 + + if obj.type == 'LAMP': + layout.operator_context = 'INVOKE_REGION_WIN' + + props = layout.operator("wm.context_modal_mouse", text="Energy") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.energy" + + if obj.data.type in ('SPOT', 'AREA', 'POINT'): + props = layout.operator("wm.context_modal_mouse", text="Falloff Distance") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.distance" + props.input_scale = 0.1 + + if obj.data.type == 'SPOT': + layout.separator() + props = layout.operator("wm.context_modal_mouse", text="Spot Size") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.spot_size" + props.input_scale = 0.01 + + props = layout.operator("wm.context_modal_mouse", text="Spot Blend") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.spot_blend" + props.input_scale = -0.01 - props = layout.operator("wm.context_modal_mouse", text="Clip Start") - props.path_iter = "selected_editable_objects" - props.path_item = "data.shadow_buffer_clip_start" - props.input_scale = 0.05 + props = layout.operator("wm.context_modal_mouse", text="Clip Start") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.shadow_buffer_clip_start" + props.input_scale = 0.05 - props = layout.operator("wm.context_modal_mouse", text="Clip End") - props.path_iter = "selected_editable_objects" - props.path_item = "data.shadow_buffer_clip_end" - props.input_scale = 0.05 + props = layout.operator("wm.context_modal_mouse", text="Clip End") + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.shadow_buffer_clip_end" + props.input_scale = 0.05 + + layout.separator() + + props = layout.operator("object.isolate_type_render") class VIEW3D_MT_object_apply(bpy.types.Menu): @@ -792,6 +849,7 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu): layout = self.layout layout.operator("object.constraint_add_with_targets") + layout.operator("object.constraints_copy") layout.operator("object.constraints_clear") @@ -834,10 +892,31 @@ class VIEW3D_MT_make_links(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.operator_menu_enum("object.make_links_scene", "type", text="Objects to Scene...") - layout.operator_menu_enum("marker.make_links_scene", "type", text="Markers to Scene...") - layout.operator_enums("object.make_links_data", property="type") # inline + layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...") + layout.operator_menu_enum("marker.make_links_scene", "scene", text="Markers to Scene...") + layout.operator_enums("object.make_links_data", "type") # inline + + +class VIEW3D_MT_object_game_properties(bpy.types.Menu): + bl_label = "Game Properties" + + def draw(self, context): + layout = self.layout + + layout.operator("object.game_property_copy", text="Replace").operation = 'REPLACE' + layout.operator("object.game_property_copy", text="Merge").operation = 'MERGE' + layout.operator_menu_enum("object.game_property_copy", "property", text="Copy...") + layout.separator() + layout.operator("object.game_property_clear") + +class VIEW3D_MT_object_game_logicbricks(bpy.types.Menu): + bl_label = "Logic Bricks" + + def draw(self, context): + layout = self.layout + + layout.operator("object.logic_bricks_copy", text="Copy") # ********** Vertex paint menu ********** @@ -849,6 +928,7 @@ class VIEW3D_MT_paint_vertex(bpy.types.Menu): layout = self.layout layout.operator("paint.vertex_color_set") + layout.operator("paint.vertex_color_dirt") class VIEW3D_MT_hook(bpy.types.Menu): @@ -932,7 +1012,7 @@ class VIEW3D_MT_sculpt(bpy.types.Menu): layout.prop(sculpt, "lock_y") layout.prop(sculpt, "lock_z") layout.separator() - layout.operator_menu_enum("brush.curve_preset", property="shape") + layout.operator_menu_enum("brush.curve_preset", "shape") layout.separator() sculpt_tool = brush.sculpt_tool @@ -991,8 +1071,8 @@ class VIEW3D_MT_particle_specials(bpy.types.Menu): layout.separator() if particle_edit.selection_mode == 'POINT': layout.operator("particle.subdivide") - layout.operator("particle.select_first") - layout.operator("particle.select_last") + layout.operator("particle.select_roots") + layout.operator("particle.select_tips") layout.operator("particle.remove_doubles") @@ -1022,6 +1102,7 @@ class VIEW3D_MT_pose(bpy.types.Menu): layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...") layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...") + layout.operator("anim.keying_set_active_set", text="Change Keying Set...") layout.separator() @@ -1142,6 +1223,7 @@ class VIEW3D_MT_pose_constraints(bpy.types.Menu): layout = self.layout layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...") + layout.operator("pose.constraints_copy") layout.operator("pose.constraints_clear") @@ -1243,15 +1325,15 @@ class VIEW3D_MT_edit_mesh_selection_mode(bpy.types.Menu): prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') prop.value = "(True, False, False)" - prop.path = "tool_settings.mesh_selection_mode" + prop.data_path = "tool_settings.mesh_selection_mode" prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') prop.value = "(False, True, False)" - prop.path = "tool_settings.mesh_selection_mode" + prop.data_path = "tool_settings.mesh_selection_mode" prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') prop.value = "(False, False, True)" - prop.path = "tool_settings.mesh_selection_mode" + prop.data_path = "tool_settings.mesh_selection_mode" class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): @@ -1373,7 +1455,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(bpy.types.Operator): totedge = mesh.total_edge_sel totvert = mesh.total_vert_sel - if totface >= 1 or totvert == 1: + if totface >= 1: return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [False, False, True]}) elif totedge == 1: return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [True, True, False]}) @@ -1462,12 +1544,14 @@ class VIEW3D_MT_edit_mesh_faces(bpy.types.Menu): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' + layout.operator("mesh.flip_normals") # layout.operator("mesh.bevel") # layout.operator("mesh.bevel") layout.operator("mesh.edge_face_add") layout.operator("mesh.fill") layout.operator("mesh.beautify_fill") layout.operator("mesh.solidify") + layout.operator("mesh.sort_faces") layout.separator() @@ -1623,6 +1707,13 @@ class VIEW3D_MT_edit_text(bpy.types.Menu): layout.menu("VIEW3D_MT_edit_text_chars") + layout.separator() + + layout.operator("font.style_toggle", text="Toggle Bold").style = 'BOLD' + layout.operator("font.style_toggle", text="Toggle Italic").style = 'ITALIC' + layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE' + layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS' + class VIEW3D_MT_edit_text_chars(bpy.types.Menu): bl_label = "Special Characters" @@ -1829,7 +1920,7 @@ class VIEW3D_MT_edit_armature_roll(bpy.types.Menu): # ********** Panel ********** -class VIEW3D_PT_3dview_properties(bpy.types.Panel): +class VIEW3D_PT_view3d_properties(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_label = "View" @@ -1845,8 +1936,7 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel): scene = context.scene col = layout.column() - col.label(text="Camera:") - col.prop(view, "camera", text="") + col.active = view.region_3d.view_perspective != 'CAMERA' col.prop(view, "lens") col.label(text="Lock to Object:") col.prop(view, "lock_object", text="") @@ -1858,10 +1948,15 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel): col.prop(view, "clip_start", text="Start") col.prop(view, "clip_end", text="End") - layout.column().prop(scene, "cursor_location", text="3D Cursor:") + subcol = col.column() + subcol.enabled = not view.lock_camera_and_layers + subcol.label(text="Local Camera:") + subcol.prop(view, "camera", text="") + + layout.column().prop(view, "cursor_location") -class VIEW3D_PT_3dview_name(bpy.types.Panel): +class VIEW3D_PT_view3d_name(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_label = "Item" @@ -1885,7 +1980,7 @@ class VIEW3D_PT_3dview_name(bpy.types.Panel): row.prop(bone, "name", text="") -class VIEW3D_PT_3dview_display(bpy.types.Panel): +class VIEW3D_PT_view3d_display(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_label = "Display" @@ -1903,9 +1998,11 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): ob = context.object col = layout.column() - col.prop(view, "display_x_axis", text="X Axis") - col.prop(view, "display_y_axis", text="Y Axis") - col.prop(view, "display_z_axis", text="Z Axis") + col.prop(view, "display_render_override") + + col = layout.column() + display_all = not view.display_render_override + col.active = display_all col.prop(view, "outline_selected") col.prop(view, "all_object_origins") col.prop(view, "relationship_lines") @@ -1914,9 +2011,17 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): col.prop(mesh, "all_edges") col = layout.column() - col.prop(view, "display_floor", text="Grid Floor") + col.active = display_all + split = col.split(percentage=0.55) + split.prop(view, "display_floor", text="Grid Floor") + + row = split.row(align=True) + row.prop(view, "display_x_axis", text="X", toggle=True) + row.prop(view, "display_y_axis", text="Y", toggle=True) + row.prop(view, "display_z_axis", text="Z", toggle=True) + sub = col.column(align=True) - sub.active = view.display_floor + sub.active = (display_all and view.display_floor) sub.prop(view, "grid_lines", text="Lines") sub.prop(view, "grid_spacing", text="Spacing") sub.prop(view, "grid_subdivisions", text="Subdivisions") @@ -1943,7 +2048,7 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): row.prop(region, "box_clip") -class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel): +class VIEW3D_PT_view3d_meshdisplay(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_label = "Mesh Display" @@ -1979,7 +2084,7 @@ class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel): col.prop(mesh, "draw_face_area") -class VIEW3D_PT_3dview_curvedisplay(bpy.types.Panel): +class VIEW3D_PT_view3d_curvedisplay(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_label = "Curve Display" @@ -2029,7 +2134,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel): layout.active = view.display_background_images box = layout.box() row = box.row(align=True) - row.prop(bg, "show_expanded", text="", no_bg=True) + row.prop(bg, "show_expanded", text="", emboss=False) row.label(text=getattr(bg.image, "name", "Not Set")) row.operator("view3d.remove_background_image", text="", icon='X').index = i @@ -2115,6 +2220,7 @@ class VIEW3D_PT_etch_a_ton(bpy.types.Panel): col.prop(toolsettings, "etch_autoname") col.prop(toolsettings, "etch_number") col.prop(toolsettings, "etch_side") + col.operator("sketch.convert", text="Convert") class VIEW3D_PT_context_properties(bpy.types.Panel): @@ -2192,6 +2298,8 @@ classes = [ VIEW3D_MT_object_showhide, VIEW3D_MT_make_single_user, VIEW3D_MT_make_links, + VIEW3D_MT_object_game_properties, + VIEW3D_MT_object_game_logicbricks, VIEW3D_MT_hook, VIEW3D_MT_vertex_group, @@ -2247,11 +2355,11 @@ classes = [ VIEW3D_MT_armature_specials, # Only as a menu for keybindings # Panels - VIEW3D_PT_3dview_properties, - VIEW3D_PT_3dview_display, - VIEW3D_PT_3dview_name, - VIEW3D_PT_3dview_meshdisplay, - VIEW3D_PT_3dview_curvedisplay, + VIEW3D_PT_view3d_properties, + VIEW3D_PT_view3d_display, + VIEW3D_PT_view3d_name, + VIEW3D_PT_view3d_meshdisplay, + VIEW3D_PT_view3d_curvedisplay, VIEW3D_PT_background_image, VIEW3D_PT_transform_orientations, VIEW3D_PT_etch_a_ton, |