diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index fec3bd88f0b..2e77c7cceeb 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -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); } |