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
This commit is contained in:
Jacques Lucke 2022-04-25 15:52:29 +02:00
parent 0a86ab6639
commit 654bc35bc8
1 changed files with 6 additions and 4 deletions

View File

@ -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));