[Bf-blender-cvs] [04ddd6f717d] master: Fix T72700: Missing flush vert visibility on sculpt undo

Pablo Dobarro noreply at git.blender.org
Mon Jan 6 16:54:45 CET 2020


Commit: 04ddd6f717d51fc40ef6436c33f60d206b0c70b2
Author: Pablo Dobarro
Date:   Thu Dec 26 23:52:59 2019 +0100
Branches: master
https://developer.blender.org/rB04ddd6f717d51fc40ef6436c33f60d206b0c70b2

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

===================================================================

M	source/blender/editors/sculpt_paint/sculpt_undo.c

===================================================================

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);
     }



More information about the Bf-blender-cvs mailing list