Cleanup: Sculpt: Use utility functions for setting face visibility

This commit is contained in:
Hans Goudey
2023-08-01 21:15:29 -04:00
parent 620a5ebe4a
commit 7114d2efa6

View File

@@ -434,15 +434,10 @@ void SCULPT_face_set_visibility_set(SculptSession *ss, int face_set, bool visibl
void SCULPT_face_visibility_all_invert(SculptSession *ss)
{
SCULPT_topology_islands_invalidate(ss);
BLI_assert(ss->face_sets != nullptr);
BLI_assert(ss->hide_poly != nullptr);
switch (BKE_pbvh_type(ss->pbvh)) {
case PBVH_FACES:
case PBVH_GRIDS:
for (int i = 0; i < ss->totfaces; i++) {
ss->hide_poly[i] = !ss->hide_poly[i];
}
blender::array_utils::invert_booleans({ss->hide_poly, ss->totfaces});
break;
case PBVH_BMESH: {
BMIter iter;
@@ -463,8 +458,7 @@ void SCULPT_face_visibility_all_set(SculptSession *ss, bool visible)
switch (BKE_pbvh_type(ss->pbvh)) {
case PBVH_FACES:
case PBVH_GRIDS:
BLI_assert(ss->hide_poly != nullptr);
memset(ss->hide_poly, !visible, sizeof(bool) * ss->totfaces);
blender::MutableSpan(ss->hide_poly, ss->totfaces).fill(!visible);
break;
case PBVH_BMESH: {
BMIter iter;