[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50466] trunk/blender/source/blender/ editors/mesh/editmesh_rip.c: minor fix for previous commit.

Campbell Barton ideasman42 at gmail.com
Fri Sep 7 08:46:26 CEST 2012


Revision: 50466
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50466
Author:   campbellbarton
Date:     2012-09-07 06:46:26 +0000 (Fri, 07 Sep 2012)
Log Message:
-----------
minor fix for previous commit. ripping a vert-edge connected to a face would always choose the face even if the mouse is closer to the edge, now check both edges and faces when ripping from a non wire vertex

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

Modified: trunk/blender/source/blender/editors/mesh/editmesh_rip.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_rip.c	2012-09-07 06:31:54 UTC (rev 50465)
+++ trunk/blender/source/blender/editors/mesh/editmesh_rip.c	2012-09-07 06:46:26 UTC (rev 50466)
@@ -464,25 +464,10 @@
 
 			dist = FLT_MAX;
 
-			if (is_wire) {
-				for (i = 0; i < vout_len; i++) {
-					BM_ITER_ELEM (e, &iter, vout[i], BM_EDGES_OF_VERT) {
-						if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
-							float e_mid_co[3];
-							mid_v3_v3v3(e_mid_co, e->v1->co, e->v2->co);
+			for (i = 0; i < vout_len; i++) {
 
-							d = edbm_rip_rip_edgedist(ar, projectMat, v->co, e_mid_co, fmval);
-
-							if (d < dist) {
-								dist = d;
-								vi_best = i;
-							}
-						}
-					}
-				}
-			}
-			else {
-				for (i = 0; i < vout_len; i++) {
+				if (BM_vert_is_wire(vout[i]) == FALSE) {
+					/* find the best face corner */
 					BM_ITER_ELEM (l, &iter, vout[i], BM_LOOPS_OF_VERT) {
 						if (!BM_elem_flag_test(l->f, BM_ELEM_HIDDEN)) {
 							float l_mid_co[3];
@@ -501,6 +486,22 @@
 						}
 					}
 				}
+				else {
+					/* a wire vert, find the best edge */
+					BM_ITER_ELEM (e, &iter, vout[i], BM_EDGES_OF_VERT) {
+						if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+							float e_mid_co[3];
+							mid_v3_v3v3(e_mid_co, e->v1->co, e->v2->co);
+
+							d = edbm_rip_rip_edgedist(ar, projectMat, v->co, e_mid_co, fmval);
+
+							if (d < dist) {
+								dist = d;
+								vi_best = i;
+							}
+						}
+					}
+				}
 			}
 
 			/* select the vert from the best region */




More information about the Bf-blender-cvs mailing list