diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-04-11 03:29:37 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-04-11 03:29:59 +0400 |
commit | 69d2af764354f515816ec0d187b824c325d4788d (patch) | |
tree | 6c0d2c28272d9ace6aedfadd49f30d86570cce90 /source/blender/editors | |
parent | 45f336c3a10e17227a3a7a4cb599c019d9e761d2 (diff) |
Support logging of modified faces in dyntopo.
This is meant to support undo when hiding parts of the mesh.
Also avoid rebuilding the PBVH in that case as well (no nodes split)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 90e26f03b2e..673e4d90d99 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -280,7 +280,7 @@ static void sculpt_undo_bmesh_restore_generic(bContext *C, unode->applied = true; } - if (unode->type == SCULPT_UNDO_MASK) { + if (ELEM(unode->type, SCULPT_UNDO_MASK, SCULPT_UNDO_MASK)) { int i, totnode; PBVHNode **nodes; @@ -756,7 +756,6 @@ static SculptUndoNode *sculpt_undo_bmesh_push(Object *ob, if (node) { switch (type) { case SCULPT_UNDO_COORDS: - case SCULPT_UNDO_HIDDEN: case SCULPT_UNDO_MASK: /* Before any vertex values get modified, ensure their * original positions are logged */ @@ -766,6 +765,22 @@ static SculptUndoNode *sculpt_undo_bmesh_push(Object *ob, BKE_pbvh_vertex_iter_end; break; + case SCULPT_UNDO_HIDDEN: + { + GSetIterator gs_iter; + GSet *faces = BKE_pbvh_bmesh_node_faces(node); + BKE_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_ALL) { + BM_log_vert_before_modified(ss->bm_log, vd.bm_vert, vd.cd_vert_mask_offset); + } + BKE_pbvh_vertex_iter_end; + + GSET_ITER (gs_iter, faces) { + BMFace *f = BLI_gsetIterator_getKey(&gs_iter); + BM_log_face_modified(ss->bm_log, f); + } + break; + } + case SCULPT_UNDO_DYNTOPO_BEGIN: case SCULPT_UNDO_DYNTOPO_END: case SCULPT_UNDO_DYNTOPO_SYMMETRIZE: |