Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2012-04-09 16:50:43 +0400
committerHoward Trickey <howard.trickey@gmail.com>2012-04-09 16:50:43 +0400
commit25492d1e4cadd63598581dd6b04c4aed47d501ca (patch)
tree36d4ebb182c266c83626e969f7d04a6e8ab94965 /source/blender/editors/mesh/editmesh_knife.c
parentb0b64b2d80d05422234e5325043e53fa76ac60e3 (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.c8
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;
}