From fbd49adfc4b312eb512bb02bcc64c4afa6e0f96f Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 1 Nov 2023 18:27:05 +0100 Subject: [PATCH] Sculpt: Dyntopo: Consider all vertices in face set brush 4e87b3004bae4cf158da made the logic to require all vertices in the face to be covered by the brush. However, the behavior is closer to the non- BMesh version if only one of the face's vertices needs to be in "inside". Pair-reviewed in person with Sergey --- .../editors/sculpt_paint/sculpt_face_set.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc index 9466cb690a1..6b4072049a4 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc @@ -268,16 +268,13 @@ static void do_draw_face_sets_brush_bmesh(Object *ob, const Brush *brush, PBVHNo continue; } - bool is_face_fully_covered = true; - float3 face_center; BM_face_calc_center_median(f, face_center); const BMLoop *l_iter = f->l_first = BM_FACE_FIRST_LOOP(f); do { if (!sculpt_brush_test_sq_fn(&test, l_iter->v->co)) { - is_face_fully_covered = false; - break; + continue; } BMVert *vert = l_iter->v; @@ -304,17 +301,15 @@ static void do_draw_face_sets_brush_bmesh(Object *ob, const Brush *brush, PBVHNo &automask_data); if (fade <= FACE_SET_BRUSH_MIN_FADE) { - is_face_fully_covered = false; - break; + continue; } - } while ((l_iter = l_iter->next) != f->l_first); - - if (is_face_fully_covered) { int &fset = *static_cast(POINTER_OFFSET(f->head.data, cd_offset)); fset = ss->cache->paint_face_set; changed = true; - } + break; + + } while ((l_iter = l_iter->next) != f->l_first); } if (changed) {