[Bf-blender-cvs] [f76a2c0d189] master: Fix: Fix attribute writer debug warnings in terminal

Hans Goudey noreply at git.blender.org
Mon Jul 25 23:07:30 CEST 2022


Commit: f76a2c0d1895a43b932eb5e458732e54b6aa17c7
Author: Hans Goudey
Date:   Mon Jul 25 16:06:13 2022 -0500
Branches: master
https://developer.blender.org/rBf76a2c0d1895a43b932eb5e458732e54b6aa17c7

Fix: Fix attribute writer debug warnings in terminal

Use an imperfect solution, since this code will be replaced soon anyway.

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

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

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

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 {



More information about the Bf-blender-cvs mailing list