Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-02-14 06:27:39 +0300
committerHans Goudey <h.goudey@me.com>2021-02-14 06:27:39 +0300
commit0bc281a6dd12308f17b3d41bdc4cc1104a3e6f18 (patch)
tree202b4b7b4269e2739432926e91fb2fc8f15a0f37
parent237175e7470c7a7bda7a5bd128bcbcb059c84073 (diff)
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.
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc6
1 files changed, 3 insertions, 3 deletions
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<const GeometryComponent *> 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<const GeometryComponent *> 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();
}
}