From 6375b1003946c2e3089c79dd9c41a1a534aa1db6 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Fri, 26 Sep 2025 12:24:30 +0200 Subject: [PATCH] Cleanup: Remove unnecessary conditional when restoring the mesh The `SCULPT_BRUSH_TYPE_GRAB` and `SCULPT_BRUSH_TYPE_ELASTIC_DEFORM` types are already handled above the removed lines, generically, without checking for size pressure. This check of the if statement was effectively always false as it would never be encountered. Pull Request: https://projects.blender.org/blender/blender/pulls/146826 --- source/blender/editors/sculpt_paint/sculpt.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index a1eb9e0dcd1..501c8b5d31d 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -5030,11 +5030,7 @@ static void restore_from_undo_step_if_necessary(const Depsgraph &depsgraph, } /* Restore the mesh before continuing with anchored stroke. */ - if ((brush->flag & BRUSH_ANCHORED) || - (ELEM(brush->sculpt_brush_type, SCULPT_BRUSH_TYPE_GRAB, SCULPT_BRUSH_TYPE_ELASTIC_DEFORM) && - BKE_brush_use_size_pressure(brush)) || - (brush->flag & BRUSH_DRAG_DOT)) - { + if (brush->flag & BRUSH_ANCHORED || brush->flag & BRUSH_DRAG_DOT) { undo::restore_from_undo_step(depsgraph, sd, ob);