[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50585] trunk/blender/source/blender/ editors/mesh/editmesh_select.c: fix for sharp edge selection being inverted , change default angle from 1 to 30deg.

Campbell Barton ideasman42 at gmail.com
Fri Sep 14 13:10:04 CEST 2012


Revision: 50585
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50585
Author:   campbellbarton
Date:     2012-09-14 11:10:03 +0000 (Fri, 14 Sep 2012)
Log Message:
-----------
fix for sharp edge selection being inverted, change default angle from 1 to 30deg.

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

Modified: trunk/blender/source/blender/editors/mesh/editmesh_select.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_select.c	2012-09-14 06:17:14 UTC (rev 50584)
+++ trunk/blender/source/blender/editors/mesh/editmesh_select.c	2012-09-14 11:10:03 UTC (rev 50585)
@@ -2324,25 +2324,19 @@
 	BMIter iter;
 	BMEdge *e;
 	BMLoop *l1, *l2;
-	float sharp = RNA_float_get(op->ptr, "sharpness"), angle;
+	const float sharp = RNA_float_get(op->ptr, "sharpness");
 
 	BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
-		if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) || !e->l)
-			continue;
+		if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == FALSE &&
+		    BM_edge_loop_pair(e, &l1, &l2))
+		{
+			/* edge has exactly two neighboring faces, check angle */
+			const float angle = angle_normalized_v3v3(l1->f->no, l2->f->no);
 
-		l1 = e->l;
-		l2 = l1->radial_next;
-
-		if (l1 == l2)
-			continue;
-
-		/* edge has exactly two neighboring faces, check angle */
-		angle = angle_normalized_v3v3(l1->f->no, l2->f->no);
-
-		if (fabsf(angle) < sharp) {
-			BM_edge_select_set(em->bm, e, TRUE);
+			if (fabsf(angle) > sharp) {
+				BM_edge_select_set(em->bm, e, TRUE);
+			}
 		}
-
 	}
 
 	WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
@@ -2369,7 +2363,7 @@
 	/* props */
 	prop = RNA_def_float_rotation(ot->srna, "sharpness", 0, NULL, DEG2RADF(0.01f), DEG2RADF(180.0f),
 	                              "Sharpness", "", DEG2RADF(1.0f), DEG2RADF(180.0f));
-	RNA_def_property_float_default(prop, DEG2RADF(1.0f));
+	RNA_def_property_float_default(prop, DEG2RADF(30.0f));
 }
 
 static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)




More information about the Bf-blender-cvs mailing list