From e525a0680034da16ca085f41f70b9723c8721cc7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 11 May 2016 01:14:46 +1000 Subject: [PATCH] BMesh: only remove loose geometry when joining faces Joining faces could remove faces that happened to share an edge that would normally be removed. --- source/blender/bmesh/intern/bmesh_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index f7e709ce9cc..70d2e72f80d 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -1399,11 +1399,15 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del) /* delete old geometry */ if (do_del) { for (i = 0; i < BLI_array_count(deledges); i++) { - BM_edge_kill(bm, deledges[i]); + if (deledges[i]->l == NULL) { + BM_edge_kill(bm, deledges[i]); + } } for (i = 0; i < BLI_array_count(delverts); i++) { - BM_vert_kill(bm, delverts[i]); + if (delverts[i]->e == NULL) { + BM_vert_kill(bm, delverts[i]); + } } } else {