From e7874b3ff0d5cb562cafac60295eec5a108e06ff Mon Sep 17 00:00:00 2001 From: Geoffrey Bantle Date: Tue, 19 Sep 2006 00:08:09 +0000 Subject: [PATCH] ->Knife Midpoint and Vertex Cutting Cutting through vertices and vertex snap was only supported in 'knife exact' mode. Now works for 'Knife Midpoint' as well. (Multicut and vertex cutting would require N-Gons) --- source/blender/src/editmesh_loop.c | 8 ++++---- source/blender/src/editmesh_tools.c | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/blender/src/editmesh_loop.c b/source/blender/src/editmesh_loop.c index 06da8711028..0bf40a89296 100644 --- a/source/blender/src/editmesh_loop.c +++ b/source/blender/src/editmesh_loop.c @@ -506,7 +506,7 @@ static CutCurve *get_mouse_trail(int *len, char mode, char cutmode, struct GHash mywinset(curarea->win); - if(cutmode == KNIFE_EXACT){ + if(cutmode != KNIFE_MULTICUT){ /*redraw backbuffer if in zbuffered selection mode but not vertex selection*/ if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) { oldmode = G.scene->selectmode; @@ -554,7 +554,7 @@ static CutCurve *get_mouse_trail(int *len, char mode, char cutmode, struct GHash /*handle vsnap*/ vsnap = 0; - if(cutmode == KNIFE_EXACT){ + if(cutmode != KNIFE_MULTICUT){ qual = get_qual(); if(qual & LR_CTRLKEY) vsnap = 1; } @@ -810,7 +810,7 @@ static float seg_intersect(EditEdge *e, CutCurve *c, int len, char mode, struct } /*check for *exact* vertex intersection first*/ - if(mode==KNIFE_EXACT){ + if(mode!=KNIFE_MULTICUT){ for (i=0; i0){ x11=x12; @@ -901,7 +901,7 @@ static float seg_intersect(EditEdge *e, CutCurve *c, int len, char mode, struct /* Intersect inside bounding box of edge?*/ if ((xi>=x2min)&&(xi<=x2max)&&(yi<=y2max)&&(yi>=y2min)){ /*test for vertex intersect that may be 'close enough'*/ - if(mode==KNIFE_EXACT){ + if(mode!=KNIFE_MULTICUT){ if(xi <= (x21 + threshold) && xi >= (x21 - threshold)){ if(yi <= (y21 + threshold) && yi >= (y21 - threshold)){ e->v1->f1 = 1; diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index f8e3f9aafa6..090323fff83 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -2768,7 +2768,7 @@ void esubdivideflag(int flag, float rad, int beauty, int numcuts, int seltype) if(facetype == 4) { switch(edgecount) { case 0: - if(beauty & B_KNIFE && beauty & B_PERCENTSUBD){ + if(beauty & B_KNIFE && numcuts == 1){ /*Test for when knifing through two opposite verts but no edges*/ touchcount = 0; if(ef->v1->f1) touchcount++; @@ -2789,8 +2789,7 @@ void esubdivideflag(int flag, float rad, int beauty, int numcuts, int seltype) break; case 1: - /*this whole damn thing is nasty. Rewrite it*/ - if(beauty & B_KNIFE && beauty & B_PERCENTSUBD){ + if(beauty & B_KNIFE && numcuts == 1){ /*Test for when knifing through an edge and one vert*/ touchcount = 0; if(ef->v1->f1) touchcount++;