[Bf-blender-cvs] [dc8bc59e2a9] soc-2021-porting-modifiers-to-nodes-merge-by-distance: Fixed problems with target_attribute was null

Fabian Schempp noreply at git.blender.org
Mon Oct 4 23:47:11 CEST 2021


Commit: dc8bc59e2a96eb95798c39e300f43308e142ba12
Author: Fabian Schempp
Date:   Mon Oct 4 23:47:05 2021 +0200
Branches: soc-2021-porting-modifiers-to-nodes-merge-by-distance
https://developer.blender.org/rBdc8bc59e2a96eb95798c39e300f43308e142ba12

Fixed problems with target_attribute was null

===================================================================

M	source/blender/geometry/intern/pointcloud_merge_by_distance.cc

===================================================================

diff --git a/source/blender/geometry/intern/pointcloud_merge_by_distance.cc b/source/blender/geometry/intern/pointcloud_merge_by_distance.cc
index 4fd8403b8e4..6e5e18980fb 100644
--- a/source/blender/geometry/intern/pointcloud_merge_by_distance.cc
+++ b/source/blender/geometry/intern/pointcloud_merge_by_distance.cc
@@ -141,9 +141,15 @@ PointCloud *pointcloud_merge_by_distance(PointCloudComponent &pointcloud_compone
           bke::OutputAttribute target_attribute = dst_component.attribute_try_get_for_output_only(
               attribute_id, meta_data.domain, meta_data.data_type);
 
+          if (target_attribute->is_empty()) {
+            target_attribute.save();
+            return true;
+          }
+
           blender::attribute_math::convert_to_static_type(meta_data.data_type, [&](auto dummy) {
             using T = decltype(dummy);
             const fn::GVArray_Typed<T> src_span = read_attribute->typed<T>();
+
             attribute_math::DefaultMixer<T> mixer(target_attribute.as_span<T>());
 
             index_new = 0;



More information about the Bf-blender-cvs mailing list