[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52580] trunk/blender/source/blender/ editors/mesh/editmesh_select.c: Fix #33316: mesh edge short path select was wrong on large/small objects.

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Nov 26 20:10:35 CET 2012


Revision: 52580
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52580
Author:   blendix
Date:     2012-11-26 19:10:34 +0000 (Mon, 26 Nov 2012)
Log Message:
-----------
Fix #33316: mesh edge short path select was wrong on large/small objects.

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-11-26 17:38:03 UTC (rev 52579)
+++ trunk/blender/source/blender/editors/mesh/editmesh_select.c	2012-11-26 19:10:34 UTC (rev 52580)
@@ -1267,12 +1267,12 @@
 	/* The cost is based on the simple sum of the length of the two edgees... */
 	sub_v3_v3v3(d1, v2, v1);
 	sub_v3_v3v3(d2, v3, v2);
-	cost = len_v3(d1) + len_v3(d2);
+	cost = normalize_v3(d1) + normalize_v3(d2);
 
 	/* but is biased to give higher values to sharp turns, so that it will take
 	 * paths with fewer "turns" when selecting between equal-weighted paths between
 	 * the two edges */
-	cost = cost + 0.5f * cost * (2.0f - sqrtf(fabsf(dot_v3v3(d1, d2))));
+	cost = cost * (1.0f + 0.5f * (2.0f - sqrtf(fabsf(dot_v3v3(d1, d2)))));
 
 	return cost;
 }




More information about the Bf-blender-cvs mailing list