diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 20 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 5 |
2 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 2f49433d5bb..f6b706ba067 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -706,7 +706,7 @@ static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush, { /* color means that primary brush texture is colured and secondary is used for alpha/mask control */ bool col = ELEM3(mode, PAINT_TEXTURE_PROJECTIVE, PAINT_TEXTURE_2D, PAINT_VERTEX) ? true: false; - + OverlayControlFlags flags = BKE_paint_get_overlay_flags(); /* save lots of GL state * TODO: check on whether all of these are needed? */ glPushAttrib(GL_COLOR_BUFFER_BIT | @@ -723,12 +723,17 @@ static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush, /* coloured overlay should be drawn separately */ if (col) { - paint_draw_tex_overlay(ups, brush, vc, x, y, zoom, true, true); - paint_draw_tex_overlay(ups, brush, vc, x, y, zoom, false, false); - paint_draw_cursor_overlay(ups, brush, vc, x, y, zoom); + if (!(flags & PAINT_OVERLAY_OVERRIDE_PRIMARY)) + paint_draw_tex_overlay(ups, brush, vc, x, y, zoom, true, true); + if (!(flags & PAINT_OVERLAY_OVERRIDE_SECONDARY)) + paint_draw_tex_overlay(ups, brush, vc, x, y, zoom, false, false); + if (!(flags & PAINT_OVERLAY_OVERRIDE_CURSOR)) + paint_draw_cursor_overlay(ups, brush, vc, x, y, zoom); } else { - paint_draw_tex_overlay(ups, brush, vc, x, y, zoom, false, true); - paint_draw_cursor_overlay(ups, brush, vc, x, y, zoom); + if (!(flags & PAINT_OVERLAY_OVERRIDE_PRIMARY)) + paint_draw_tex_overlay(ups, brush, vc, x, y, zoom, false, true); + if (!(flags & PAINT_OVERLAY_OVERRIDE_CURSOR)) + paint_draw_cursor_overlay(ups, brush, vc, x, y, zoom); } glPopAttrib(); @@ -805,8 +810,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) ups->brush_rotation = 0.0; /* draw overlay */ - if (!BKE_paint_get_overlay_override()) - paint_draw_alpha_overlay(ups, brush, &vc, x, y, zoomx, mode); + paint_draw_alpha_overlay(ups, brush, &vc, x, y, zoomx, mode); /* TODO: as sculpt and other paint modes are unified, this * special mode of drawing will go away */ diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index d754567bd99..7133585f41d 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -434,15 +434,14 @@ PaintStroke *paint_stroke_new(bContext *C, stroke->done = done; stroke->event_type = event_type; /* for modal, return event */ - if (br->overlay_flags & BRUSH_OVERLAY_OVERRIDE_ON_STROKE) - BKE_paint_set_overlay_override(true); + BKE_paint_set_overlay_override(br->overlay_flags); return stroke; } void paint_stroke_data_free(struct wmOperator *op) { - BKE_paint_set_overlay_override(false); + BKE_paint_set_overlay_override(0); MEM_freeN(op->customdata); op->customdata = NULL; } |