UI: Add color and blending to paint mode context menus
authorWilliam Reynish <billrey@me.com>
Sat, 4 May 2019 13:03:42 +0000 (15:03 +0200)
committerWilliam Reynish <billrey@me.com>
Sat, 4 May 2019 13:03:42 +0000 (15:03 +0200)
release/scripts/startup/bl_ui/space_view3d.py

index 8c9a1f8..c6f104b 100644 (file)
@@ -6235,8 +6235,15 @@ class VIEW3D_PT_paint_vertex_context_menu(Panel):
 
     def draw(self, context):
         layout = self.layout
-
         brush = context.tool_settings.vertex_paint.brush
+        capabilities = brush.vertex_paint_capabilities
+
+        if capabilities.has_color:
+            split = layout.split(factor=0.1)
+            UnifiedPaintPanel.prop_unified_color(split, context, brush, "color", text="")
+            UnifiedPaintPanel.prop_unified_color_picker(split, context, brush, "color", value_slider=True)
+            layout.prop(brush, "blend", text="")
+
         UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True)
         UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength")
 
@@ -6252,6 +6259,12 @@ class VIEW3D_PT_paint_texture_context_menu(Panel):
         brush = context.tool_settings.image_paint.brush
         capabilities = brush.image_paint_capabilities
 
+        if capabilities.has_color:
+            split = layout.split(factor=0.1)
+            UnifiedPaintPanel.prop_unified_color(split, context, brush, "color", text="")
+            UnifiedPaintPanel.prop_unified_color_picker(split, context, brush, "color", value_slider=True)
+            layout.prop(brush, "blend", text="")
+
         if capabilities.has_radius:
             UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True)
         UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength")