Fix T72700: Missing flush vert visibility on sculpt undo
This was caused by a missing call to BKE_mesh_flush_hidden_from_verts() when a SCULP_UNDO_HIDDEN undo step is processed. Reviewed By: jbakker Maniphest Tasks: T72700 Differential Revision: https://developer.blender.org/D6488
This commit is contained in:
parent
55fbb0fd69
commit
04ddd6f717
Notes:
blender-bot
2023-02-14 11:21:43 +01:00
Referenced by issue #72700, Sculpt-mode's "Box Hide + Undo" not syncing in edit mode but instead causes edges to disappear
|
@ -498,7 +498,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
|
|||
SculptSession *ss = ob->sculpt;
|
||||
SubdivCCG *subdiv_ccg = ss->subdiv_ccg;
|
||||
SculptUndoNode *unode;
|
||||
bool update = false, rebuild = false, update_mask = false;
|
||||
bool update = false, rebuild = false, update_mask = false, update_visibility = false;
|
||||
bool need_mask = false;
|
||||
|
||||
for (unode = lb->first; unode; unode = unode->next) {
|
||||
|
@ -575,6 +575,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
|
|||
case SCULPT_UNDO_HIDDEN:
|
||||
if (sculpt_undo_restore_hidden(C, unode)) {
|
||||
rebuild = true;
|
||||
update_visibility = true;
|
||||
}
|
||||
break;
|
||||
case SCULPT_UNDO_MASK:
|
||||
|
@ -641,6 +642,11 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
|
|||
tag_update |= true;
|
||||
}
|
||||
|
||||
if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES && update_visibility) {
|
||||
Mesh *mesh = ob->data;
|
||||
BKE_mesh_flush_hidden_from_verts(mesh);
|
||||
}
|
||||
|
||||
if (tag_update) {
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue