[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52836] trunk/blender/source/blender/ editors/mesh/editmesh_knife.c: knife tool was incorrectly moving points into worldspace, then checking clipping against the object space bounds.

Campbell Barton ideasman42 at gmail.com
Mon Dec 10 08:21:00 CET 2012


Revision: 52836
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52836
Author:   campbellbarton
Date:     2012-12-10 07:20:52 +0000 (Mon, 10 Dec 2012)
Log Message:
-----------
knife tool was incorrectly moving points into worldspace, then checking clipping against the object space bounds.
more fixes needed here but at least correct whats there.

also ensure clipping is initialized from the object before handling modal operator events.

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

Modified: trunk/blender/source/blender/editors/mesh/editmesh_knife.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_knife.c	2012-12-10 06:14:43 UTC (rev 52835)
+++ trunk/blender/source/blender/editors/mesh/editmesh_knife.c	2012-12-10 07:20:52 UTC (rev 52836)
@@ -1523,12 +1523,7 @@
 				dis = len_v2v2(kfv->sco, sco);
 				if (dis < radius) {
 					if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
-						float vec[3];
-
-						copy_v3_v3(vec, kfv->cageco);
-						mul_m4_v3(kcd->vc.obedit->obmat, vec);
-
-						if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
+						if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
 							c++;
 						}
 					}
@@ -1599,7 +1594,6 @@
 					float vec[3];
 
 					interp_v3_v3v3(vec, kfe->v1->cageco, kfe->v2->cageco, labda);
-					mul_m4_v3(kcd->vc.obedit->obmat, vec);
 
 					if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
 						cure = kfe;
@@ -1691,12 +1685,7 @@
 				dis = len_v2v2(kfv->sco, sco);
 				if (dis < curdis && dis < maxdist) {
 					if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
-						float vec[3];
-
-						copy_v3_v3(vec, kfv->cageco);
-						mul_m4_v3(kcd->vc.obedit->obmat, vec);
-
-						if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
+						if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
 							curv = kfv;
 							curdis = dis;
 						}
@@ -3121,6 +3110,7 @@
 	}
 
 	view3d_operator_needs_opengl(C);
+	ED_view3d_init_mats_rv3d(obedit, kcd->vc.rv3d);  /* needed to initialize clipping */
 
 	if (kcd->mode == MODE_PANNING)
 		kcd->mode = kcd->prevmode;




More information about the Bf-blender-cvs mailing list