[Bf-blender-cvs] [a8fb08b19cf] master: UI: 3D View, minor menu reorganization
Campbell Barton
noreply at git.blender.org
Thu Oct 19 06:10:16 CEST 2017
Commit: a8fb08b19cf9ddbf3185754c41a9da533f8de65b
Author: Campbell Barton
Date: Thu Oct 19 15:10:41 2017 +1100
Branches: master
https://developer.blender.org/rBa8fb08b19cf9ddbf3185754c41a9da533f8de65b
UI: 3D View, minor menu reorganization
Changes from D2876 by @meta-androcto
- Move "Delete" to the first menu item in most toplevel menus.
- Add separators.
- Consistent order of Undo/Redo
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 08b9b3554b2..a0051688a8e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -311,17 +311,21 @@ class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
VIEW3D_MT_transform_base.draw(self, context)
# armature specific extensions follow...
- layout.separator()
-
obj = context.object
if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}:
if obj.data.draw_type == 'BBONE':
+ layout.separator()
+
layout.operator("transform.transform", text="Scale BBone").mode = 'BONE_SIZE'
elif obj.data.draw_type == 'ENVELOPE':
+ layout.separator()
+
layout.operator("transform.transform", text="Scale Envelope Distance").mode = 'BONE_SIZE'
layout.operator("transform.transform", text="Scale Radius").mode = 'BONE_ENVELOPE'
if context.edit_object and context.edit_object.type == 'ARMATURE':
+ layout.separator()
+
layout.operator("armature.align")
@@ -660,6 +664,9 @@ class VIEW3D_MT_select_object(Menu):
layout.operator("object.select_all").action = 'TOGGLE'
layout.operator("object.select_all", text="Inverse").action = 'INVERT'
+
+ layout.separator()
+
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")
@@ -718,6 +725,9 @@ class VIEW3D_MT_select_pose(Menu):
layout.operator("pose.select_all").action = 'TOGGLE'
layout.operator("pose.select_all", text="Inverse").action = 'INVERT'
layout.operator("pose.select_mirror", text="Flip Active")
+
+ layout.separator()
+
layout.operator("pose.select_constraint_target", text="Constraint Target")
layout.operator("pose.select_linked", text="Linked")
@@ -897,6 +907,9 @@ class VIEW3D_MT_select_edit_curve(Menu):
layout.operator("curve.select_all").action = 'TOGGLE'
layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
+
+ layout.separator()
+
layout.operator("curve.select_random")
layout.operator("curve.select_nth")
layout.operator("curve.select_linked", text="Select Linked")
@@ -928,6 +941,9 @@ class VIEW3D_MT_select_edit_surface(Menu):
layout.operator("curve.select_all").action = 'TOGGLE'
layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
+
+ layout.separator()
+
layout.operator("curve.select_random")
layout.operator("curve.select_nth")
layout.operator("curve.select_linked", text="Select Linked")
@@ -951,9 +967,9 @@ class VIEW3D_MT_select_edit_text(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("font.text_copy", text="Copy")
- layout.operator("font.text_cut", text="Cut")
layout.operator("font.text_paste", text="Paste")
+ layout.operator("font.text_cut", text="Cut")
+ layout.operator("font.text_copy", text="Copy")
layout.separator()
@@ -998,13 +1014,16 @@ class VIEW3D_MT_select_edit_lattice(Menu):
layout.separator()
- layout.operator("lattice.select_mirror")
- layout.operator("lattice.select_random")
layout.operator("lattice.select_all").action = 'TOGGLE'
layout.operator("lattice.select_all", text="Inverse").action = 'INVERT'
layout.separator()
+ layout.operator("lattice.select_mirror")
+ layout.operator("lattice.select_random")
+
+ layout.separator()
+
layout.operator("lattice.select_ungrouped", text="Ungrouped Verts")
@@ -1065,6 +1084,9 @@ class VIEW3D_MT_select_gpencil(Menu):
layout.operator("gpencil.select_all", text="(De)select All").action = 'TOGGLE'
layout.operator("gpencil.select_all", text="Inverse").action = 'INVERT'
+
+ layout.separator()
+
layout.operator("gpencil.select_linked", text="Linked")
layout.operator_menu_enum("gpencil.select_grouped", "type", text="Grouped")
@@ -1153,7 +1175,7 @@ class VIEW3D_MT_angle_control(Menu):
# ********** Add menu **********
-# XXX: INFO_MT_ names used to keep backwards compatibility (Addons etc that hook into the menu)
+# XXX: INFO_MT_ names used to keep backwards compatibility (Add-ons etc. that hook into the menu)
class INFO_MT_mesh_add(Menu):
@@ -1278,12 +1300,12 @@ class INFO_MT_add(Menu):
# "align_view" to work on first call (see [#32719]).
layout.operator_context = 'EXEC_REGION_WIN'
- #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
+ # layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
- #layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
+ # layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
- #layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
+ # layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
layout.menu("INFO_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
@@ -1419,6 +1441,9 @@ class VIEW3D_MT_object_clear(Menu):
layout.operator("object.location_clear", text="Location").clear_delta = False
layout.operator("object.rotation_clear", text="Rotation").clear_delta = False
layout.operator("object.scale_clear", text="Scale").clear_delta = False
+
+ layout.separator()
+
layout.operator("object.origin_clear", text="Origin")
@@ -1638,7 +1663,9 @@ class VIEW3D_MT_object_parent(Menu):
layout = self.layout
layout.operator_enum("object.parent_set", "type")
+
layout.separator()
+
layout.operator_enum("object.parent_clear", "type")
@@ -1649,7 +1676,9 @@ class VIEW3D_MT_object_track(Menu):
layout = self.layout
layout.operator_enum("object.track_set", "type")
+
layout.separator()
+
layout.operator_enum("object.track_clear", "type")
@@ -1678,6 +1707,9 @@ class VIEW3D_MT_object_constraints(Menu):
layout.operator("object.constraint_add_with_targets")
layout.operator("object.constraints_copy")
+
+ layout.separator()
+
layout.operator("object.constraints_clear")
@@ -1700,6 +1732,9 @@ class VIEW3D_MT_object_showhide(Menu):
layout = self.layout
layout.operator("object.hide_view_clear", text="Show Hidden")
+
+ layout.separator()
+
layout.operator("object.hide_view_set", text="Hide Selected").unselected = False
layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
@@ -1737,12 +1772,16 @@ class VIEW3D_MT_make_links(Menu):
def draw(self, context):
layout = self.layout
operator_context_default = layout.operator_context
+
if len(bpy.data.scenes) > 10:
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
else:
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene")
+
+ layout.separator()
+
layout.operator_context = operator_context_default
layout.operator_enum("object.make_links_data", "type") # inline
@@ -1842,16 +1881,14 @@ class VIEW3D_MT_brush_paint_modes(Menu):
# ********** Vertex paint menu **********
-
-
class VIEW3D_MT_paint_vertex(Menu):
bl_label = "Paint"
def draw(self, context):
layout = self.layout
- layout.operator("ed.undo")
layout.operator("ed.redo")
+ layout.operator("ed.undo")
layout.separator()
@@ -1880,9 +1917,12 @@ class VIEW3D_MT_hook(Menu):
if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
layout.separator()
+
layout.operator_menu_enum("object.hook_assign", "modifier")
layout.operator_menu_enum("object.hook_remove", "modifier")
+
layout.separator()
+
layout.operator_menu_enum("object.hook_select", "modifier")
layout.operator_menu_enum("object.hook_reset", "modifier")
layout.operator_menu_enum("object.hook_recenter", "modifier")
@@ -1901,15 +1941,17 @@ class VIEW3D_MT_vertex_group(Menu):
if ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex):
if ob.vertex_groups.active:
layout.separator()
+
layout.operator("object.vertex_group_assign", text="Assign to Active Group")
layout.operator(
"object.vertex_group_remove_from",
text="Remove from Active Group",
).use_all_groups = False
layout.operator("object.vertex_group_remove_from", text="Remove from All").use_all_groups = True
- layout.separator()
if ob.vertex_groups.active:
+ layout.separator()
+
layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
layout.operator("object.vertex_group_remove", text="Remove Active Group").all = False
layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
@@ -1917,7 +1959,6 @@ class VIEW3D_MT_vertex_group(Menu):
# ********** Weight paint menu **********
-
cla
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list