[Bf-blender-cvs] [5cdeae21051] blender2.8: UI: show basic sculpt options in topbar

Campbell Barton noreply at git.blender.org
Sun Apr 29 17:33:20 CEST 2018


Commit: 5cdeae2105184b9e3794b9247d718c4c48958ae8
Author: Campbell Barton
Date:   Sun Apr 29 17:33:08 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5cdeae2105184b9e3794b9247d718c4c48958ae8

UI: show basic sculpt options in topbar

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

M	release/scripts/startup/bl_ui/space_topbar.py

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

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 365dbf3a9a8..4cf302e1c93 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -140,9 +140,12 @@ class TOPBAR_HT_lower_bar(Header):
 
         # TODO(campbell): editing options should be after active tool options
         # (obviously separated for from the users POV)
+        draw_fn = getattr(_draw_left_context_mode, mode, None)
+        if draw_fn is not None:
+            draw_fn(context, layout)
 
         if mode == 'SCULPT':
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context="", category="")
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".dummy", category="")
         elif mode == 'PAINT_VERTEX':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context="", category="")
         elif mode == 'PAINT_WEIGHT':
@@ -175,6 +178,19 @@ class TOPBAR_HT_lower_bar(Header):
         )
 
 
+class _draw_left_context_mode:
+    @staticmethod
+    def SCULPT(context, layout):
+        brush = context.tool_settings.sculpt.brush
+        if brush is None:
+            return
+
+        from .properties_paint_common import UnifiedPaintPanel
+
+        UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", icon='LOCKED', slider=True, text="Radius")
+        UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", icon='LOCKED', slider=True, text="Strength")
+        layout.prop(brush, "direction", expand=True)
+
 class TOPBAR_PT_redo(Panel):
     bl_label = "Redo"
     bl_space_type = 'TOPBAR'



More information about the Bf-blender-cvs mailing list