Sculpt: Dyntopo: Consider all vertices in face set brush

4e87b3004b 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
This commit is contained in:
Hans Goudey 2023-11-01 18:27:05 +01:00
parent 756dea7ca1
commit fbd49adfc4
1 changed files with 5 additions and 10 deletions

View File

@ -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<int *>(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) {