From 0652945dbda76e5ba329a7e5aee45afc0d3a83d3 Mon Sep 17 00:00:00 2001 From: illua1 Date: Mon, 1 May 2023 22:15:19 +0200 Subject: [PATCH] Fix #107306: Merge by distance node is not deterministic In some cases the node didn't reproduce the same results given the same input. Based on the test results (just 2 very detailed cubes and a transformation), it doesn't seem to affect performance that much. Credit to @MMMM who pointed out this option. Pull Request: https://projects.blender.org/blender/blender/pulls/107312 --- source/blender/geometry/intern/mesh_merge_by_distance.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/geometry/intern/mesh_merge_by_distance.cc b/source/blender/geometry/intern/mesh_merge_by_distance.cc index ba869b10e9b..46ed855a7dc 100644 --- a/source/blender/geometry/intern/mesh_merge_by_distance.cc +++ b/source/blender/geometry/intern/mesh_merge_by_distance.cc @@ -1737,7 +1737,7 @@ std::optional mesh_merge_by_distance_all(const Mesh &mesh, BLI_kdtree_3d_balance(tree); const int vert_kill_len = BLI_kdtree_3d_calc_duplicates_fast( - tree, merge_distance, false, vert_dest_map.data()); + tree, merge_distance, true, vert_dest_map.data()); BLI_kdtree_3d_free(tree); if (vert_kill_len == 0) {