From 04ddd6f717d51fc40ef6436c33f60d206b0c70b2 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Thu, 26 Dec 2019 23:52:59 +0100 Subject: 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 --- source/blender/editors/sculpt_paint/sculpt_undo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/sculpt_paint') 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); } -- cgit v1.2.3