Fix T54526: Data Transfer modifier's Max Distance field working strangely.
Based on investigation by Philipp Oeser (@lichtwerk) and solution by Alexander Gavrilov (@angavrilov) in D5206, thanks!
This commit is contained in:
parent
14f490b932
commit
3b84dce969
Notes:
blender-bot
2023-02-14 06:32:27 +01:00
Referenced by issue #54526, Data Transfer modifier's Max Distance field working strangely
|
@ -61,7 +61,12 @@ static bool mesh_remap_bvhtree_query_nearest(BVHTreeFromMesh *treedata,
|
|||
{
|
||||
/* Use local proximity heuristics (to reduce the nearest search). */
|
||||
if (nearest->index != -1) {
|
||||
nearest->dist_sq = min_ff(len_squared_v3v3(co, nearest->co), max_dist_sq);
|
||||
nearest->dist_sq = len_squared_v3v3(co, nearest->co);
|
||||
if (nearest->dist_sq > max_dist_sq) {
|
||||
/* The previous valid index is too far away and not valid for this check. */
|
||||
nearest->dist_sq = max_dist_sq;
|
||||
nearest->index = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
nearest->dist_sq = max_dist_sq;
|
||||
|
|
Loading…
Reference in New Issue