diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2012-04-09 16:50:43 +0400 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2012-04-09 16:50:43 +0400 |
commit | 25492d1e4cadd63598581dd6b04c4aed47d501ca (patch) | |
tree | 36d4ebb182c266c83626e969f7d04a6e8ab94965 /source/blender/editors/mesh/editmesh_knife.c | |
parent | b0b64b2d80d05422234e5325043e53fa76ac60e3 (diff) |
Fix bug 30866: prevent 2-sided polygons from knife cuts.
Blender bmesh code assumes there aren't any of those, so crashed
when trying to delete a vertex involved in one.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_knife.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index bba1e870b1f..f33e1271e4e 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2397,7 +2397,12 @@ static void knife_make_chain_cut(knifetool_opdata *kcd, BMFace *f, ListBase *cha BLI_assert(i == nco); lnew = NULL; if (nco == 0) { - *newface = BM_face_split(bm, f, v1, v2, &lnew, NULL, TRUE); + /* Want to prevent creating two-sided polygons */ + if (BM_edge_exists(v1, v2)) { + *newface = NULL; + } else { + *newface = BM_face_split(bm, f, v1, v2, &lnew, NULL, TRUE); + } } else { fnew = BM_face_split_n(bm, f, v1, v2, cos, nco, &lnew, NULL); @@ -2430,7 +2435,6 @@ static void knife_make_face_cuts(knifetool_opdata *kcd, BMFace *f, ListBase *kfe while ((chain = find_chain(kcd, kfedges)) != NULL) { knife_make_chain_cut(kcd, f, chain, &fnew); if (!fnew) { - BLI_assert("!knife failed chain cut"); return; } |