Page MenuHome
Paste P968

T54526_snippet_2
ActivePublic

Authored by Philipp Oeser (lichtwerk) on May 7 2019, 7:48 PM.
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index db158ca8fb2..fb4ce68fed3 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -67,6 +67,7 @@ static bool mesh_remap_bvhtree_query_nearest(BVHTreeFromMesh *treedata,
nearest->dist_sq = max_dist_sq;
}
/* Compute and store result. If invalid (-1 index), keep FLT_MAX dist. */
+ nearest->index = -1;
BLI_bvhtree_find_nearest(treedata->tree, co, nearest, treedata->nearest_callback, treedata);
if ((nearest->index != -1) && (nearest->dist_sq <= max_dist_sq)) {