[Bf-blender-cvs] [82808e18e65] blender-v3.0-release: Fix T93362: crash when capturing attribute after fillet curve node

Jacques Lucke noreply at git.blender.org
Thu Nov 25 10:35:58 CET 2021


Commit: 82808e18e6562e9c06626a4e938cb2ad4fa34a0f
Author: Jacques Lucke
Date:   Thu Nov 25 10:33:05 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB82808e18e6562e9c06626a4e938cb2ad4fa34a0f

Fix T93362: crash when capturing attribute after fillet curve node

The issue was that the attribute propagation in the Fillet Curve node seems
pretty broken. I couldn't really make sense of the old code. It changed the
size of the point attribute domains on splines to 1 for some reason which
led to a crash in the next node.

Differential Revision: https://developer.blender.org/D13362

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

M	source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
index 27d7d22b106..cee26232eb2 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc
@@ -332,14 +332,17 @@ static void copy_common_attributes_by_mapping(const Spline &src,
   copy_attribute_by_mapping(src.radii(), dst.radii(), mapping);
   copy_attribute_by_mapping(src.tilts(), dst.tilts(), mapping);
 
-  dst.attributes.reallocate(1);
   src.attributes.foreach_attribute(
       [&](const AttributeIDRef &attribute_id, const AttributeMetaData &meta_data) {
         std::optional<GSpan> src_attribute = src.attributes.get_for_read(attribute_id);
         if (dst.attributes.create(attribute_id, meta_data.data_type)) {
           std::optional<GMutableSpan> dst_attribute = dst.attributes.get_for_write(attribute_id);
           if (dst_attribute) {
-            src_attribute->type().copy_assign(src_attribute->data(), dst_attribute->data());
+            attribute_math::convert_to_static_type(dst_attribute->type(), [&](auto dummy) {
+              using T = decltype(dummy);
+              copy_attribute_by_mapping(
+                  src_attribute->typed<T>(), dst_attribute->typed<T>(), mapping);
+            });
             return true;
           }
         }



More information about the Bf-blender-cvs mailing list