diff options
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc index effeac5a37f..ee279ba58f9 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc @@ -21,6 +21,11 @@ static void node_geo_exec(GeoNodeExecParams params) params.set_output("Geometry", std::move(geometry_set)); return; } + if (!bke::allow_procedural_attribute_access(name)) { + params.error_message_add(NodeWarningType::Info, TIP_(bke::no_procedural_access_message)); + params.set_output("Geometry", std::move(geometry_set)); + return; + } std::atomic<bool> attribute_exists = false; std::atomic<bool> cannot_delete = false; @@ -34,7 +39,7 @@ static void node_geo_exec(GeoNodeExecParams params) /* First check if the attribute exists before getting write access, * to avoid potentially expensive unnecessary copies. */ const GeometryComponent &read_only_component = *geometry_set.get_component_for_read(type); - if (read_only_component.attribute_exists(name)) { + if (read_only_component.attributes()->contains(name)) { attribute_exists = true; } else { @@ -42,7 +47,7 @@ static void node_geo_exec(GeoNodeExecParams params) } GeometryComponent &component = geometry_set.get_component_for_write(type); - if (!component.attribute_try_delete(name)) { + if (!component.attributes_for_write()->remove(name)) { cannot_delete = true; } } @@ -50,7 +55,7 @@ static void node_geo_exec(GeoNodeExecParams params) }); if (attribute_exists && !cannot_delete) { - params.used_named_attribute(name, NamedAttributeUsage::Remove); + params.used_named_attribute(name, eNamedAttrUsage::Remove); } if (!attribute_exists) { |