diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-26 07:33:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-26 07:35:43 +0400 |
commit | a71a947c6af75114ead5f4c1fcc360699f275241 (patch) | |
tree | c8fa87aeb0788acfd223858cf03ad98a29be148a /source/blender/bmesh | |
parent | 74f1a3f42f94d80f8f0b8d61f38583ea74c73b72 (diff) |
Fix T41568: Dissolve & Tear Boundary Keeps Verts
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/operators/bmo_dissolve.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index 877cd16d9d2..8cd9ee14bcb 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -29,6 +29,7 @@ #include "MEM_guardedalloc.h" #include "BLI_array.h" +#include "BLI_stack.h" #include "BLI_math.h" #include "bmesh.h" @@ -88,13 +89,18 @@ static bool UNUSED_FUNCTION(check_hole_in_region) (BMesh *bm, BMFace *f) static void bm_face_split(BMesh *bm, const short oflag, bool use_edge_delete) { + BLI_Stack *edge_delete_verts; BMIter iter; BMVert *v; - BMIter liter; + if (use_edge_delete) { + edge_delete_verts = BLI_stack_new(sizeof(BMVert *), __func__); + } + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, oflag)) { if (BM_vert_is_edge_pair(v) == false) { + BMIter liter; BMLoop *l; BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) { if (l->f->len > 3) { @@ -105,15 +111,24 @@ static void bm_face_split(BMesh *bm, const short oflag, bool use_edge_delete) } } } - /* remove surrounding edges & faces */ + if (use_edge_delete) { - while (v->e) { - BM_edge_kill(bm, v->e); - } + BLI_stack_push(edge_delete_verts, &v); } } } } + + if (use_edge_delete) { + while (!BLI_stack_is_empty(edge_delete_verts)) { + /* remove surrounding edges & faces */ + BLI_stack_pop(edge_delete_verts, &v); + while (v->e) { + BM_edge_kill(bm, v->e); + } + } + BLI_stack_free(edge_delete_verts); + } } void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) |