Fix #112285: Sculpt Mode: Mask brush smoothing is broken #112292

Merged
Philipp Oeser merged 3 commits from lichtwerk/blender:112285 into main 2023-09-13 11:05:01 +02:00
1 changed files with 15 additions and 10 deletions

View File

@ -4299,12 +4299,14 @@ static void smooth_brush_toggle_on(const bContext *C, Paint *paint, StrokeCache
if (cur_brush->sculpt_tool == SCULPT_TOOL_MASK) {
cache->saved_mask_brush_tool = cur_brush->mask_tool;
cur_brush->mask_tool = BRUSH_MASK_SMOOTH;
return;
}
else if (ELEM(cur_brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
lichtwerk marked this conversation as resolved Outdated

Looks like there's an else after return that can be cleaned up here

Looks like there's an else after return that can be cleaned up here

Thx spotting this!

Thx spotting this!
if (ELEM(cur_brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
{
/* Do nothing, this tool has its own smooth mode. */
return;
@ -4335,14 +4337,17 @@ static void smooth_brush_toggle_off(const bContext *C, Paint *paint, StrokeCache
if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
brush->mask_tool = cache->saved_mask_brush_tool;
return;
}
else if (ELEM(brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
if (ELEM(brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
{
/* Do nothing. */
return;
}
/* If saved_active_brush_name is not set, brush was not switched/affected in