[Bf-blender-cvs] [7d90de452bd] temp-lineart-contained: Cleanup: Use simpler method to retrieve attribute domain
Hans Goudey
noreply at git.blender.org
Sun Jul 4 07:28:05 CEST 2021
Commit: 7d90de452bd7524a077d0c1b3767ca48a582a2ec
Author: Hans Goudey
Date: Fri Jul 2 23:16:39 2021 -0500
Branches: temp-lineart-contained
https://developer.blender.org/rB7d90de452bd7524a077d0c1b3767ca48a582a2ec
Cleanup: Use simpler method to retrieve attribute domain
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc
M source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
===================================================================
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc
index 06a4327a6c5..3b951bda95e 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc
@@ -108,15 +108,14 @@ static AttributeDomain get_result_domain(const GeometryComponent &component,
StringRef result_name)
{
/* Use the domain of the result attribute if it already exists. */
- ReadAttributeLookup result_attribute = component.attribute_try_get_for_read(result_name);
- if (result_attribute) {
- return result_attribute.domain;
+ std::optional<AttributeMetaData> result_info = component.attribute_get_meta_data(result_name);
+ if (result_info) {
+ return result_info->domain;
}
-
/* Otherwise use the input attribute's domain if it exists. */
- ReadAttributeLookup input_attribute = component.attribute_try_get_for_read(input_name);
- if (input_attribute) {
- return input_attribute.domain;
+ std::optional<AttributeMetaData> input_info = component.attribute_get_meta_data(input_name);
+ if (input_info) {
+ return input_info->domain;
}
return ATTR_DOMAIN_POINT;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
index e2cf6e8b480..e017786ae89 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
@@ -389,9 +389,9 @@ static AttributeDomain get_result_domain(const GeometryComponent &component,
StringRef result_name)
{
/* Use the domain of the result attribute if it already exists. */
- ReadAttributeLookup result_attribute = component.attribute_try_get_for_read(result_name);
- if (result_attribute) {
- return result_attribute.domain;
+ std::optional<AttributeMetaData> result_info = component.attribute_get_meta_data(result_name);
+ if (result_info) {
+ return result_info->domain;
}
/* Otherwise use the highest priority domain from existing input attributes, or the default. */
More information about the Bf-blender-cvs
mailing list