Commit: eb3f74a0fe0abe1c591f12ac17f31455340e3866
Author: Pablo Dobarro
Date:   Fri Jul 10 19:43:01 2020 +0200
Branches: master
https://developer.blender.org/rBeb3f74a0fe0abe1c591f12ac17f31455340e3866

Sculpt: Enable color palettes for sculpt vertex colors

Enables the color palette subpanel for brushes that have color
capabilities (only the paint brush for now)

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8268

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

M       release/scripts/startup/bl_ui/properties_paint_common.py
M       source/blender/editors/sculpt_paint/paint_ops.c

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

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 209231cacb0..58f188d0999 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -192,6 +192,10 @@ class ColorPalettePanel(BrushPanel):
         elif context.vertex_paint_object:
             capabilities = brush.vertex_paint_capabilities
             return capabilities.has_color
+
+        elif context.sculpt_object:
+            capabilities = brush.sculpt_capabilities
+            return capabilities.has_color
         return False
 
     def draw(self, context):
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c 
b/source/blender/editors/sculpt_paint/paint_ops.c
index be545600e6e..d65f158174f 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -246,7 +246,11 @@ static int palette_color_add_exec(bContext *C, wmOperator 
*UNUSED(op))
   color = BKE_palette_color_add(palette);
   palette->active_color = BLI_listbase_count(&palette->colors) - 1;
 
-  if (ELEM(mode, PAINT_MODE_TEXTURE_3D, PAINT_MODE_TEXTURE_2D, 
PAINT_MODE_VERTEX)) {
+  if (ELEM(mode,
+           PAINT_MODE_TEXTURE_3D,
+           PAINT_MODE_TEXTURE_2D,
+           PAINT_MODE_VERTEX,
+           PAINT_MODE_SCULPT)) {
     copy_v3_v3(color->rgb, BKE_brush_color_get(scene, brush));
     color->value = 0.0;
   }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to