diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-26 00:06:13 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-07-26 15:25:31 +0300 |
commit | 931cbbc7bd9b1d29f53c67749c4176ab4a966abf (patch) | |
tree | ee324aaf75d16fc7706a45d340a07d4927c799b4 | |
parent | c6eef1c3d3669aa3038d0399d80159969b7eb7b5 (diff) |
Fix: Fix attribute writer debug warnings in terminal
Use an imperfect solution, since this code will be replaced soon anyway.
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc index fd75855bddb..0ddf06dc8c7 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc @@ -126,18 +126,22 @@ static GMutableSpan ensure_point_attribute(PointCloudComponent &points, const AttributeIDRef &attribute_id, const eCustomDataType data_type) { - return points.attributes_for_write() - ->lookup_or_add_for_write(attribute_id, ATTR_DOMAIN_POINT, data_type) - .varray.get_internal_span(); + GAttributeWriter attribute = points.attributes_for_write()->lookup_or_add_for_write( + attribute_id, ATTR_DOMAIN_POINT, data_type); + GMutableSpan span = attribute.varray.get_internal_span(); + attribute.finish(); + return span; } template<typename T> static MutableSpan<T> ensure_point_attribute(PointCloudComponent &points, const AttributeIDRef &attribute_id) { - return points.attributes_for_write() - ->lookup_or_add_for_write<T>(attribute_id, ATTR_DOMAIN_POINT) - .varray.get_internal_span(); + AttributeWriter<T> attribute = points.attributes_for_write()->lookup_or_add_for_write<T>( + attribute_id, ATTR_DOMAIN_POINT); + MutableSpan<T> span = attribute.varray.get_internal_span(); + attribute.finish(); + return span; } namespace { |