Fix: Missing multires to faces visibility sync after box hide

The operator handled faces visibility change correctly but not
multires. Use the existing PBVH API function for that, also remove
a redundant call to the function that fetched the attribute pointers
again after the change.
This commit is contained in:
Hans Goudey
2023-08-23 22:04:13 -04:00
parent 4d82e1a7ee
commit 4a0581eca2
2 changed files with 2 additions and 5 deletions
@@ -382,9 +382,8 @@ static int hide_show_exec(bContext *C, wmOperator *op)
/* Ensure that edges and faces get hidden as well (not used by
* sculpt but it looks wrong when entering editmode otherwise). */
if (pbvh_type == PBVH_FACES) {
BKE_mesh_flush_hidden_from_verts(me);
BKE_pbvh_update_hide_attributes_from_mesh(pbvh);
if (ELEM(pbvh_type, PBVH_FACES, PBVH_GRIDS)) {
BKE_pbvh_sync_visibility_from_verts(pbvh, me);
}
RegionView3D *rv3d = CTX_wm_region_view3d(C);
@@ -1065,8 +1065,6 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
if (ELEM(BKE_pbvh_type(ss->pbvh), PBVH_FACES, PBVH_GRIDS)) {
Mesh *me = (Mesh *)ob->data;
BKE_pbvh_sync_visibility_from_verts(ss->pbvh, me);
BKE_pbvh_update_hide_attributes_from_mesh(ss->pbvh);
}
BKE_pbvh_update_visibility(ss->pbvh);