diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-09 09:20:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-05-09 09:21:00 +0300 |
commit | e0e7d94f79a512dd33d2f8cdf1685112a8327674 (patch) | |
tree | a55b32f0d9f99fc7892b2db0b3f56dec620c3e84 /source/blender | |
parent | 69be8d7cbd3b4fea45ffb5db6d1cbd83e8d8e4d0 (diff) |
Fix error introduced by removing faces before executing bridge
Commit 86abddc9, caused an error when the face-region included boundary edges.
Since removing the faces first, caused the edges along the boundaries to be removed.
Add support for deleting faces and internal edges, that keeps boundaries.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_delete.c | 10 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api.h | 3 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_delete.c b/source/blender/bmesh/intern/bmesh_delete.c index c5c9403884b..882d78ce6b3 100644 --- a/source/blender/bmesh/intern/bmesh_delete.c +++ b/source/blender/bmesh/intern/bmesh_delete.c @@ -161,6 +161,7 @@ void BMO_mesh_delete_oflag_context(BMesh *bm, const short oflag, const int type) break; } case DEL_FACES: + case DEL_FACES_KEEP_BOUNDARY: { /* go through and mark all edges and all verts of all faces for delete */ BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { @@ -190,11 +191,20 @@ void BMO_mesh_delete_oflag_context(BMesh *bm, const short oflag, const int type) } /* also mark all the vertices of remaining edges for keeping */ BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { + + /* Only exception to normal 'DEL_FACES' logic. */ + if (type == DEL_FACES_KEEP_BOUNDARY) { + if (BM_edge_is_boundary(e)) { + BMO_elem_flag_disable(bm, e, oflag); + } + } + if (!BMO_elem_flag_test(bm, e, oflag)) { BMO_elem_flag_disable(bm, e->v1, oflag); BMO_elem_flag_disable(bm, e->v2, oflag); } } + /* now delete marked face */ bmo_remove_tagged_faces(bm, oflag); /* delete marked edge */ diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index 14e9bf81be7..cf93fe0935e 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -285,6 +285,9 @@ enum { DEL_ONLYFACES, DEL_EDGESFACES, DEL_FACES, + /* A version of 'DEL_FACES' that keeps edges on face boundaries, + * allowing the surrounding edge-loop to be kept from removed face regions. */ + DEL_FACES_KEEP_BOUNDARY, DEL_ONLYTAGGED }; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index cd840494ad9..ba17684dd39 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5133,7 +5133,7 @@ static int edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op) } BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS, "delete geom=%hf context=%i", - BM_ELEM_TAG, DEL_FACES); + BM_ELEM_TAG, DEL_FACES_KEEP_BOUNDARY); } BMO_op_exec(em->bm, &bmop); |