From 0bc281a6dd12308f17b3d41bdc4cc1104a3e6f18 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sat, 13 Feb 2021 21:27:39 -0600 Subject: Cleanup: Simplify geometry nodes attribute API usage Getting an "ouput" attribute is equivalent to creating an attribute and then getting a write attribute. Replace the latter with the former for consistency with other code, and to decrease the used surface area of the attribute API to hopefully facilitate future cleanup. --- source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc index 4fec14ec9c9..ed99fc95018 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc @@ -201,8 +201,8 @@ static void join_attributes(Span src_components, AttributeDomain domain; determine_final_data_type_and_domain(src_components, attribute_name, &data_type, &domain); - result.attribute_try_create(attribute_name, domain, data_type); - WriteAttributePtr write_attribute = result.attribute_try_get_for_write(attribute_name); + OutputAttributePtr write_attribute = result.attribute_try_get_for_output( + attribute_name, domain, data_type); if (!write_attribute || &write_attribute->cpp_type() != bke::custom_data_type_to_cpp_type(data_type) || write_attribute->domain() != domain) { @@ -210,7 +210,7 @@ static void join_attributes(Span src_components, } fn::GMutableSpan dst_span = write_attribute->get_span_for_write_only(); fill_new_attribute(src_components, attribute_name, data_type, domain, dst_span); - write_attribute->apply_span(); + write_attribute.apply_span_and_save(); } } -- cgit v1.2.3