diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-10-30 17:48:31 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-10-31 16:34:41 +0300 |
commit | 90fd75c869c01df27b68e0e2836aa3e4fdfcb429 (patch) | |
tree | 7dc3a779d0f8f6f0ac4151321cd0b009375f5927 /source/blender/editors/sculpt_paint/sculpt_undo.c | |
parent | c6180c2249e1864aefa244cecefb47a2f4fd508f (diff) |
Fix T70866: Missing PBVH updates after mask undo
With the latest changes, the PBVH needs extra flags each time the mask is
modified to keep the internal fully_masked and fully_unmasked node flags
updated.
Reviewed By: jbakker
Maniphest Tasks: T70866
Differential Revision: https://developer.blender.org/D6088
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 5d95cc80280..fc990c01bfb 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -77,6 +77,7 @@ static UndoSculpt *sculpt_undo_get_nodes(void); static void update_cb(PBVHNode *node, void *rebuild) { BKE_pbvh_node_mark_update(node); + BKE_pbvh_node_mark_update_mask(node); if (*((bool *)rebuild)) { BKE_pbvh_node_mark_rebuild_draw(node); } @@ -497,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; + bool update = false, rebuild = false, update_mask = false; bool need_mask = false; for (unode = lb->first; unode; unode = unode->next) { @@ -579,6 +580,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase case SCULPT_UNDO_MASK: if (sculpt_undo_restore_mask(C, unode)) { update = true; + update_mask = true; } break; @@ -616,6 +618,9 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase }; BKE_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb_partial, &data); BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateRedraw); + if (update_mask) { + BKE_pbvh_update_vertex_data(ss->pbvh, PBVH_UpdateMask); + } if (BKE_sculpt_multires_active(scene, ob)) { if (rebuild) { |