diff options
author | Jacques Lucke <jacques@blender.org> | 2022-04-25 16:52:29 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-04-25 16:52:38 +0300 |
commit | 654bc35bc8057d03e4f04057a71079e9365f3832 (patch) | |
tree | e7c879b647e519cd1678a219ec7524941aa2c7f4 /source/blender/nodes/geometry | |
parent | 0a86ab6639e8ec535808e74b66d6b2ec6b1307bd (diff) |
Geometry Nodes: improve ui when trying to remove built-in attributes
* If removing an attribute failed (even though it exists), don't log it as being used.
* Make warning message a bit more informative.
Differential Revision: https://developer.blender.org/D14750
Diffstat (limited to 'source/blender/nodes/geometry')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc | 10 |
1 files changed, 6 insertions, 4 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 f46b70c91a9..c2633468e9b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc @@ -32,8 +32,6 @@ static void node_geo_exec(GeoNodeExecParams params) return; } - params.used_named_attribute(name, NamedAttributeUsage::Remove); - std::atomic<bool> attribute_exists = false; std::atomic<bool> cannot_delete = false; @@ -61,13 +59,17 @@ static void node_geo_exec(GeoNodeExecParams params) } }); + if (attribute_exists && !cannot_delete) { + params.used_named_attribute(name, NamedAttributeUsage::Remove); + } + if (!attribute_exists) { params.error_message_add(NodeWarningType::Info, TIP_("Attribute does not exist: \"") + name + "\""); } if (cannot_delete) { - params.error_message_add(NodeWarningType::Info, - TIP_("Cannot delete attribute with name \"") + name + "\""); + params.error_message_add(NodeWarningType::Warning, + TIP_("Cannot delete built-in attribute with name \"") + name + "\""); } params.set_output("Geometry", std::move(geometry_set)); |