diff options
author | Hans Goudey <h.goudey@me.com> | 2022-08-23 21:09:46 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-08-23 21:09:46 +0300 |
commit | a6056b870b1da9bf422920439897a5cf8616c925 (patch) | |
tree | 53da4e1a28cdac7510b324777b5c0a96a260abde | |
parent | e36ced1dce96f980fd844181946b3318fcc6233c (diff) |
Fix T100494: Broken sculpt hide status undo/redo
Caused by 2480b55f216c31 using the undo step indices instead of the
indices of vertices in the mesh, causing the hide values to be swapped
around randomly in the mesh.
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 9a445359c4e..58d62fb2165 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -373,10 +373,11 @@ static bool sculpt_undo_restore_hidden(bContext *C, SculptUndoNode *unode, bool if (unode->maxvert) { for (int i = 0; i < unode->totvert; i++) { - if ((BLI_BITMAP_TEST(unode->vert_hidden, i) != 0) != hide_vert[i]) { + const int vert_index = unode->index[i]; + if ((BLI_BITMAP_TEST(unode->vert_hidden, i) != 0) != hide_vert[vert_index]) { BLI_BITMAP_FLIP(unode->vert_hidden, i); - hide_vert[unode->index[i]] = !hide_vert[i]; - modified_vertices[unode->index[i]] = true; + hide_vert[vert_index] = !hide_vert[vert_index]; + modified_vertices[vert_index] = true; } } } @@ -902,7 +903,6 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase .modified_hidden_vertices = modified_hidden_vertices, .modified_mask_vertices = modified_mask_vertices, .modified_color_vertices = modified_color_vertices, - }; BKE_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb_partial, &data); BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateRedraw); |