Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-06-26 22:57:19 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-06-29 18:25:27 +0300
commitbf87df34855acb394d8c966f055b96bd2d78ea79 (patch)
tree2a2a8f090b5cfc6141e213fe388b87af8c6987fa /source/blender/editors/sculpt_paint/sculpt_paint_color.c
parent3118636f81a45d39e79e7a9a287056de1e8123cd (diff)
Fix T78323: Enable Unified and Secondary colors for Scultp Vertex Colors
The report does not include any file, but probably that file is using the settings for unified colors, which are currently not available in the UI, so it always paints black. This enables unified colors and secondary colors for sculpt vertex colors, so it should solve that issue. Unified color does not make much sense now as the Paint tool is the only one that has paint capabilities, but it will do in the future when sculpt and paint at the same time is enabled and the paint capability is added to more tools. Reviewed By: sergey Maniphest Tasks: T78323 Differential Revision: https://developer.blender.org/D8136
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_paint_color.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_paint_color.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.c b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
index 1ae40837998..3b6343a0920 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_color.c
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
@@ -130,6 +130,9 @@ static void do_paint_brush_task_cb_ex(void *__restrict userdata,
ss, &test, data->brush->falloff_shape);
const int thread_id = BLI_task_parallel_thread_id(tls);
+ float brush_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
+ copy_v3_v3(brush_color, BKE_brush_color_get(ss->scene, brush));
+
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
{
SCULPT_orig_vert_data_update(&orig_data, &vd);
@@ -168,11 +171,11 @@ static void do_paint_brush_task_cb_ex(void *__restrict userdata,
}
/* Brush paint color, brush test falloff and flow. */
- float paint_color[4] = {brush->rgb[0], brush->rgb[1], brush->rgb[2], 1.0f};
+ float paint_color[4];
float wet_mix_color[4];
float buffer_color[4];
- mul_v4_fl(paint_color, fade * brush->flow);
+ mul_v4_v4fl(paint_color, brush_color, fade * brush->flow);
mul_v4_v4fl(wet_mix_color, data->wet_mix_sampled_color, fade * brush->flow);
/* Interpolate with the wet_mix color for wet paint mixing. */