[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47386] branches/meshdata_transfer/source/ blender/editors/object/object_vgroup.c: Reverting to binary tree because related optimization with type 10 tree were bugged .

Ove Murberg Henriksen sorayasilvermoon at hotmail.com
Sun Jun 3 22:23:54 CEST 2012


Revision: 47386
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47386
Author:   cyborgmuppet
Date:     2012-06-03 20:23:41 +0000 (Sun, 03 Jun 2012)
Log Message:
-----------
Reverting to binary tree because related optimization with type 10 tree were bugged. 
Now  feature completes in ~5 sec for a mesh with 300k vertices. but it works as intended. 

Modified Paths:
--------------
    branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c

Modified: branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c	2012-06-03 19:39:19 UTC (rev 47385)
+++ branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c	2012-06-03 20:23:41 UTC (rev 47386)
@@ -503,13 +503,14 @@
 
 		case BY_NEAREST_VERTEX:
 			/* make node tree */
-			bvhtree_from_mesh_verts(&tree_mesh_vertices_src, dmesh_src, FLT_EPSILON, 10, 6);
+			bvhtree_from_mesh_verts(&tree_mesh_vertices_src, dmesh_src, FLT_EPSILON, 2, 6);
 
 			/* loop trough vertices */
 			for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++, mv_dst++){
 
 				/* reset nearest */
 				nearest.dist = FLT_MAX;
+				/* nearest.index = -1; when this is commented out, the next search is initiated by the index of the previous. */
 
 				/* transform into target space */
 				mul_v3_m4v3(tmp_co, tmp_mat, mv_dst->co);
@@ -534,13 +535,14 @@
 			mface_src = dmesh_src->getTessFaceArray(dmesh_src);
 
 			/* make node tree */
-			bvhtree_from_mesh_faces(&tree_mesh_faces_src, dmesh_src, FLT_EPSILON, 10, 6);
+			bvhtree_from_mesh_faces(&tree_mesh_faces_src, dmesh_src, FLT_EPSILON, 2, 6);
 
 			/* loop through the vertices */
 			for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++, mv_dst++) {
 
 				/* reset nearest */
 				nearest.dist = FLT_MAX;
+				/* nearest.index = -1; when this is commented out, the next search is initiated by the index of the previous. */
 
 				/* transform into target space */
 				mul_v3_m4v3(tmp_co, tmp_mat, mv_dst->co);
@@ -586,13 +588,14 @@
 			mface_src = dmesh_src->getTessFaceArray(dmesh_src);
 
 			/* make node tree */
-			bvhtree_from_mesh_faces(&tree_mesh_faces_src, dmesh_src, FLT_EPSILON, 10, 6);
+			bvhtree_from_mesh_faces(&tree_mesh_faces_src, dmesh_src, FLT_EPSILON, 2, 6);
 
 			/* loop through the vertices */
 			for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++, mv_dst++){
 
 				/* reset nearest */
 				nearest.dist = FLT_MAX;
+				/* nearest.index = -1; when this is commented out, the next search is initiated by the index of the previous. */
 
 				/* transform into target space */
 				mul_v3_m4v3(tmp_co, tmp_mat, mv_dst->co);




More information about the Bf-blender-cvs mailing list