UI: Split sculpt mask operators into own menu
authorWilliam Reynish <billrey@me.com>
Sat, 5 Oct 2019 20:17:22 +0000 (22:17 +0200)
committerWilliam Reynish <billrey@me.com>
Sat, 5 Oct 2019 20:17:22 +0000 (22:17 +0200)
Differential Revision: https://developer.blender.org/D5997

Reviewers: Brecht van Lommel, Pablo Dobarro

release/scripts/startup/bl_ui/space_view3d.py

index aca8ea701ce82da5951e9bf23f3e4271603aff1a..ffb0096d2f3f000aa06b078d2fdf6ee6803a14d0 100644 (file)
@@ -794,6 +794,8 @@ class VIEW3D_MT_editor_menus(Menu):
         elif obj:
             if mode_string != 'PAINT_TEXTURE':
                 layout.menu("VIEW3D_MT_%s" % mode_string.lower())
+            if mode_string == 'SCULPT':
+                layout.menu("VIEW3D_MT_mask")
 
         else:
             layout.menu("VIEW3D_MT_object")
@@ -2822,20 +2824,29 @@ class VIEW3D_MT_sculpt(Menu):
         props.action = 'SHOW'
         props.area = 'ALL'
 
-        props = layout.operator("paint.hide_show", text="Hide Bounding Box")
-        props.action = 'HIDE'
-        props.area = 'INSIDE'
-
         props = layout.operator("paint.hide_show", text="Show Bounding Box")
         props.action = 'SHOW'
         props.area = 'INSIDE'
 
+        props = layout.operator("paint.hide_show", text="Hide Bounding Box")
+        props.action = 'HIDE'
+        props.area = 'INSIDE'
+
         props = layout.operator("paint.hide_show", text="Hide Masked")
         props.action = 'HIDE'
         props.area = 'MASKED'
 
         layout.separator()
 
+        layout.menu("VIEW3D_MT_sculpt_set_pivot", text="Set Pivot")
+
+
+class VIEW3D_MT_mask(Menu):
+    bl_label = "Mask"
+
+    def draw(self, _context):
+        layout = self.layout
+
         props = layout.operator("paint.mask_flood_fill", text="Invert Mask")
         props.mode = 'INVERT'
 
@@ -2898,9 +2909,6 @@ class VIEW3D_MT_sculpt(Menu):
 
         props = layout.operator("sculpt.dirty_mask", text='Dirty Mask')
 
-        layout.separator()
-        layout.menu("VIEW3D_MT_sculpt_set_pivot", text="Set Pivot")
-
 
 class VIEW3D_MT_sculpt_set_pivot(Menu):
     bl_label = "Sculpt Set Pivot"
@@ -6808,6 +6816,7 @@ classes = (
     VIEW3D_MT_paint_weight,
     VIEW3D_MT_sculpt,
     VIEW3D_MT_sculpt_set_pivot,
+    VIEW3D_MT_mask,
     VIEW3D_MT_particle,
     VIEW3D_MT_particle_context_menu,
     VIEW3D_MT_particle_showhide,