[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44671] trunk/blender/source/blender/ editors/mesh/knifetool.c: Fix to knifetool when intermediate point in space .

Howard Trickey howard.trickey at gmail.com
Tue Mar 6 13:16:56 CET 2012


Revision: 44671
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44671
Author:   howardt
Date:     2012-03-06 12:16:55 +0000 (Tue, 06 Mar 2012)
Log Message:
-----------
Fix to knifetool when intermediate point in space.

Before, if you cut the same edge multiple times
with an intermediate point in space, it wouldn't
get all of the edges.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/knifetool.c

Modified: trunk/blender/source/blender/editors/mesh/knifetool.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/knifetool.c	2012-03-06 12:09:35 UTC (rev 44670)
+++ trunk/blender/source/blender/editors/mesh/knifetool.c	2012-03-06 12:16:55 UTC (rev 44671)
@@ -697,12 +697,12 @@
 			if (len_v3v3(kcd->vertcage, lh->realhit) < FLT_EPSILON * 80)
 				continue;
 			
-			if (kcd->prev_is_space || kcd->is_space) {
-				kcd->prev_is_space = kcd->is_space = 0;
+			if (kcd->prev_is_space) {
+				kcd->prev_is_space = 0;
 				copy_v3_v3(kcd->prevco, lh->hit);
 				copy_v3_v3(kcd->prevcage, lh->cagehit);
 				kcd->prevedge = lh->kfe;
-				kcd->curbmface = lh->f;
+				kcd->prevbmface = lh->f;
 				continue;
 			}			
 			
@@ -716,15 +716,24 @@
 			knife_add_single_cut(kcd);
 		}
 		
-		kcd->curbmface = oldkcd.curbmface;
-		kcd->curvert = oldkcd.curvert;
-		kcd->curedge = oldkcd.curedge;
-		kcd->is_space = oldkcd.is_space;
-		copy_v3_v3(kcd->vertco, oldkcd.vertco);
-		copy_v3_v3(kcd->vertcage, oldkcd.vertcage);
+		if (oldkcd.is_space) {
+			kcd->prevbmface = oldkcd.curbmface;
+			kcd->prevvert = oldkcd.curvert;
+			kcd->prevedge = oldkcd.curedge;
+			copy_v3_v3(kcd->prevco, oldkcd.vertco);
+			copy_v3_v3(kcd->prevcage, oldkcd.vertcage);
+			kcd->prev_is_space = oldkcd.is_space;
+		} else {
+			kcd->curbmface = oldkcd.curbmface;
+			kcd->curvert = oldkcd.curvert;
+			kcd->curedge = oldkcd.curedge;
+			kcd->is_space = oldkcd.is_space;
+			copy_v3_v3(kcd->vertco, oldkcd.vertco);
+			copy_v3_v3(kcd->vertcage, oldkcd.vertcage);
+			
+			knife_add_single_cut(kcd);
+		}
 		
-		knife_add_single_cut(kcd);
-		
 		MEM_freeN(kcd->linehits);
 		kcd->linehits = NULL;
 		kcd->totlinehit = 0;




More information about the Bf-blender-cvs mailing list