[Bf-blender-cvs] [2ed0f08106a] master: UI: Add brush controls to contextual menus for Texture Paint, Vertex Paint, Sculpt Mode

William Reynish noreply at git.blender.org
Mon Mar 11 15:01:09 CET 2019


Commit: 2ed0f08106a67f28768ffb7085df8fd6c0673a57
Author: William Reynish
Date:   Mon Mar 11 15:01:07 2019 +0100
Branches: master
https://developer.blender.org/rB2ed0f08106a67f28768ffb7085df8fd6c0673a57

UI: Add brush controls to contextual menus for Texture Paint, Vertex Paint, Sculpt Mode

Maniphest task: T62130

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

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 292884b0ae5..a2484a39281 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -5694,19 +5694,22 @@ class VIEW3D_PT_paint_vertex_specials(Panel):
     bl_label = "Vertex Paint Context Menu"
 
     def draw(self, context):
+        brush = context.tool_settings.vertex_paint.brush
+        ups = context.tool_settings.unified_paint_settings
+
         layout = self.layout
-        # TODO: populate with useful items.
-        layout.operator("paint.vertex_color_set")
-        layout.operator("paint.vertex_color_smooth")
-        layout.operator("paint.vertex_color_dirt")
-        layout.operator("paint.vertex_color_from_weight")
 
-        layout.separator()
+        # Size
+        if ups.use_unified_size:
+            layout.prop(ups, "size", slider=True)
+        else:
+            layout.prop(brush, "size", slider=True)
 
-        layout.operator("paint.vertex_color_invert", text="Invert")
-        layout.operator("paint.vertex_color_levels", text="Levels")
-        layout.operator("paint.vertex_color_hsv", text="Hue Saturation Value")
-        layout.operator("paint.vertex_color_brightness_contrast", text="Bright/Contrast")
+        # Strength
+        if ups.use_unified_strength:
+            layout.prop(ups, "strength")
+        else:
+            layout.prop(brush, "strength")
 
 
 class VIEW3D_PT_paint_texture_specials(Panel):
@@ -5716,9 +5719,22 @@ class VIEW3D_PT_paint_texture_specials(Panel):
     bl_label = "Texture Paint Context Menu"
 
     def draw(self, context):
+        brush = context.tool_settings.image_paint.brush
+        ups = context.tool_settings.unified_paint_settings
+
         layout = self.layout
-        # TODO: populate with useful items.
-        layout.operator("image.save_dirty")
+
+        # Size
+        if ups.use_unified_size:
+            layout.prop(ups, "size", slider=True)
+        else:
+            layout.prop(brush, "size", slider=True)
+
+        # Strength
+        if ups.use_unified_strength:
+            layout.prop(ups, "strength")
+        else:
+            layout.prop(brush, "strength")
 
 
 class VIEW3D_PT_paint_weight_specials(Panel):
@@ -5732,12 +5748,23 @@ class VIEW3D_PT_paint_weight_specials(Panel):
         capabilities = brush.weight_paint_capabilities
         ups = context.tool_settings.unified_paint_settings
 
-
         layout = self.layout
+
+        # Weight
         if capabilities.has_weight or brush.use_gradient:
             layout.prop(ups, "weight")
-        layout.prop(ups, "size", slider=True)
-        layout.prop(ups, "strength")
+
+        # Size
+        if ups.use_unified_size:
+            layout.prop(ups, "size", slider=True)
+        else:
+            layout.prop(brush, "size", slider=True)
+
+        # Strength
+        if ups.use_unified_strength:
+            layout.prop(ups, "strength")
+        else:
+            layout.prop(brush, "strength")
 
 
 class VIEW3D_PT_sculpt_specials(Panel):
@@ -5747,10 +5774,25 @@ class VIEW3D_PT_sculpt_specials(Panel):
     bl_label = "Sculpt Context Menu"
 
     def draw(self, context):
+        brush = context.tool_settings.sculpt.brush
+        ups = context.tool_settings.unified_paint_settings
+
         layout = self.layout
-        # TODO: populate with useful items.
-        layout.operator("object.shade_smooth")
-        layout.operator("object.shade_flat")
+
+        # Direction
+        layout.prop(brush, "direction", expand=True)
+
+        # Size
+        if ups.use_unified_size:
+            layout.prop(ups, "size", slider=True)
+        else:
+            layout.prop(brush, "size", slider=True)
+
+        # Strength
+        if ups.use_unified_strength:
+            layout.prop(ups, "strength")
+        else:
+            layout.prop(brush, "strength")
 
 
 class TOPBAR_PT_gpencil_materials(GreasePencilMaterialsPanel, Panel):



More information about the Bf-blender-cvs mailing list