[Bf-blender-cvs] [33586f16fcb] sculpt-dev: Sculpt-dev: split automasking into its own panel

Joseph Eagar noreply at git.blender.org
Tue Dec 14 20:23:52 CET 2021


Commit: 33586f16fcb0640983ceff2f1dc492c1b9d4fcdd
Author: Joseph Eagar
Date:   Tue Dec 14 11:23:27 2021 -0800
Branches: sculpt-dev
https://developer.blender.org/rB33586f16fcb0640983ceff2f1dc492c1b9d4fcdd

Sculpt-dev: split automasking into its own panel

Also replaced texture dropdown in sculpt header
with automasking.

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index bd2feb78ea7..9c9cb5b8f44 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -86,16 +86,16 @@ class VIEW3D_HT_tool_header(Header):
 
             layout.popover("VIEW3D_PT_tools_brush_stroke")
 
+            if tool_mode == 'SCULPT':
+                layout.popover("VIEW3D_PT_sculpt_automasking")
+
             sub = layout.row()
             sub.ui_units_x = 5
             sub.popover("VIEW3D_PT_tools_brush_falloff_popover")
 
-            # why show this in the header? it takes up space - joeedh
+            # why show this in the header? it takes up too much space - joeedh
             #layout.popover("VIEW3D_PT_tools_brush_display")
 
-            if tool_mode == 'SCULPT':
-                layout.popover("VIEW3D_PT_tools_brush_texture")
-
         # Note: general mode options should be added to 'draw_mode_settings'.
         if tool_mode == 'SCULPT':
             if is_valid_context:
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 6d5199ec3c0..3ff22affe5f 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1300,32 +1300,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
                 smoothbrush,
                 "dyntopo_disabled", ui_editing=False, text="Disable Dyntopo For Smooth")
         """
-
-        col.separator()
-
-        UnifiedPaintPanel.channel_unified(layout.column(),
-            context,
-            brush,
-            "automasking", toolsettings_only=True, expand=True, ui_editing=False)
-        UnifiedPaintPanel.channel_unified(layout.column(),
-            context,
-            brush,
-            "automasking_boundary_edges_propagation_steps",
-            ui_editing=False)
-        UnifiedPaintPanel.channel_unified(layout.column(),
-            context,
-            brush,
-            "concave_mask_factor",
-            ui_editing=False, slider=True, show_mappings=True)
-
-        """
-        col = layout.column(heading="Auto-Masking", align=True)
-        col.prop(sculpt, "use_automasking_topology", text="Topology")
-        col.prop(sculpt, "use_automasking_face_sets", text="Face Sets")
-        col.prop(sculpt, "use_automasking_boundary_edges", text="Mesh Boundary")
-        col.prop(sculpt, "use_automasking_boundary_face_sets", text="Face Sets Boundary")
-        """
-
+        
         col.separator()
 
         UnifiedPaintPanel.channel_unified(layout.column(),
@@ -1345,6 +1320,43 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
         col.operator("sculpt.set_limit_surface")
 
 
+# TODO, move to space_view3d.py
+class VIEW3D_PT_sculpt_automasking(Panel, View3DPaintPanel):
+    bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
+    bl_label = "Automasking"
+    bl_options = {'DEFAULT_CLOSED'}
+    bl_ui_units_x = 12
+
+    @classmethod
+    def poll(cls, context):
+        return (context.sculpt_object and context.tool_settings.sculpt)
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False
+
+        tool_settings = context.tool_settings
+        sculpt = tool_settings.sculpt
+        brush = sculpt.brush
+        
+        UnifiedPaintPanel.channel_unified(layout.column(),
+            context,
+            brush,
+            "automasking", toolsettings_only=True, expand=True,
+            ui_editing=False, text="Automasking (global)")
+        UnifiedPaintPanel.channel_unified(layout.column(),
+            context,
+            brush,
+            "automasking_boundary_edges_propagation_steps",
+            ui_editing=False)
+        UnifiedPaintPanel.channel_unified(layout.column(),
+            context,
+            brush,
+            "concave_mask_factor",
+            ui_editing=False, slider=True, show_mappings=True)
+
+
 class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel):
     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
     bl_parent_id = "VIEW3D_PT_sculpt_options"
@@ -2699,6 +2711,7 @@ classes = (VIEW3D_MT_brush_context_menu,
     VIEW3D_PT_sculpt_symmetry_for_topbar,
     VIEW3D_PT_sculpt_options,
     VIEW3D_PT_sculpt_options_gravity,
+    VIEW3D_PT_sculpt_automasking,
 
     VIEW3D_PT_tools_weightpaint_symmetry,
     VIEW3D_PT_tools_weightpaint_symmetry_for_topbar,



More information about the Bf-blender-cvs mailing list