diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 32b89f5676f..fa70eb8f4dd 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2010,7 +2010,9 @@ static void do_wpaint_brush_draw_task_cb_ex(void *__restrict userdata, continue; } } - + if ((eBrushWeightPaintTool)brush->weightpaint_tool == WPAINT_TOOL_ERASER) { + data->vp->paint.brush->blend |= IMB_BLEND_SUB; + } do_weight_paint_vertex(data->vp, data->ob, data->wpi, v_index, final_alpha, paintweight); } } @@ -2144,6 +2146,9 @@ static void wpaint_paint_leaves(bContext *C, case WPAINT_TOOL_DRAW: BLI_task_parallel_range(0, totnode, &data, do_wpaint_brush_draw_task_cb_ex, &settings); break; + case WPAINT_TOOL_ERASER: + BLI_task_parallel_range(0, totnode, &data, do_wpaint_brush_draw_task_cb_ex, &settings); + break; } } diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 93ce3d9769b..f5d6f980110 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -519,6 +519,7 @@ typedef enum eBrushWeightPaintTool { WPAINT_TOOL_BLUR = 1, WPAINT_TOOL_AVERAGE = 2, WPAINT_TOOL_SMEAR = 3, + WPAINT_TOOL_ERASER = 4, } eBrushWeightPaintTool; /* BrushGpencilSettings->brush type */ diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 2484e432795..35bce423673 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -114,6 +114,7 @@ const EnumPropertyItem rna_enum_brush_weight_tool_items[] = { {WPAINT_TOOL_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", ""}, {WPAINT_TOOL_AVERAGE, "AVERAGE", ICON_BRUSH_BLUR, "Average", ""}, {WPAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_BLUR, "Smear", ""}, + {WPAINT_TOOL_ERASER, "ERASER", ICON_BRUSH_MIX, "Eraser", ""}, {0, NULL, 0, NULL, NULL}, };