From bf87df34855acb394d8c966f055b96bd2d78ea79 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Fri, 26 Jun 2020 21:57:19 +0200 Subject: 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 --- source/blender/editors/sculpt_paint/sculpt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/sculpt_paint/sculpt.c') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index e2d69c7b0be..c45f01ae7cd 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -8108,6 +8108,7 @@ static int sculpt_sample_color_invoke(bContext *C, const wmEvent *UNUSED(e)) { Sculpt *sd = CTX_data_tool_settings(C)->sculpt; + Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); Brush *brush = BKE_paint_brush(&sd->paint); SculptSession *ss = ob->sculpt; @@ -8116,10 +8117,9 @@ static int sculpt_sample_color_invoke(bContext *C, if (!active_vertex_color) { return OPERATOR_CANCELLED; } - brush->rgb[0] = active_vertex_color[0]; - brush->rgb[1] = active_vertex_color[1]; - brush->rgb[2] = active_vertex_color[2]; - brush->alpha = active_vertex_color[3]; + + BKE_brush_color_set(scene, brush, active_vertex_color); + BKE_brush_alpha_set(scene, brush, active_vertex_color[3]); WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush); -- cgit v1.2.3