From 7d5fb2e103e03046194d69640aadf7e76a700620 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Sat, 6 Oct 2018 14:56:49 +0200 Subject: Vertex Paint: support switching to secondary color temporarily holding Ctrl while it is possible to permanently flip the colors using the 'X' button, this makes it consistent with Texture Paint. fixes T56994 Reviewers: campbellbarton, brecht Reviewed By: brecht Subscribers: JulienKaspar Tags: #sculpting_and_painting Maniphest Tasks: T56994 Differential Revision: https://developer.blender.org/D3753 --- source/blender/editors/sculpt_paint/paint_vertex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 4821fd4fef4..139986fa1c1 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -283,11 +283,11 @@ static VPaint *new_vpaint(void) return vp; } -uint vpaint_get_current_col(Scene *scene, VPaint *vp) +uint vpaint_get_current_col(Scene *scene, VPaint *vp, bool secondary) { Brush *brush = BKE_paint_brush(&vp->paint); uchar col[4]; - rgb_float_to_uchar(col, BKE_brush_color_get(scene, brush)); + rgb_float_to_uchar(col, secondary ? BKE_brush_secondary_color_get(scene, brush) : BKE_brush_color_get(scene, brush)); col[3] = 255; /* alpha isn't used, could even be removed to speedup paint a little */ return *(uint *)col; } @@ -2521,7 +2521,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f &vpd->normal_angle_precalc, vp->paint.brush->falloff_angle, (vp->paint.brush->flag & BRUSH_FRONTFACE_FALLOFF) != 0); - vpd->paintcol = vpaint_get_current_col(scene, vp); + vpd->paintcol = vpaint_get_current_col(scene, vp, (RNA_enum_get(op->ptr, "mode") == BRUSH_STROKE_INVERT)); vpd->is_texbrush = !(brush->vertexpaint_tool == PAINT_BLEND_BLUR) && brush->mtex.tex; -- cgit v1.2.3