Geometry Nodes: forbid creating attribute with empty name

Empty attribute names are just a recipe for problems.
This commit is contained in:
2021-02-19 18:08:40 +01:00
parent a346a7dd10
commit a23c7fd570

View File

@@ -1641,9 +1641,12 @@ bool GeometryComponent::attribute_try_create(const StringRef attribute_name,
const CustomDataType data_type)
{
using namespace blender::bke;
if (attribute_name.is_empty()) {
return false;
}
const ComponentAttributeProviders *providers = this->get_attribute_providers();
if (providers == nullptr) {
return {};
return false;
}
const BuiltinAttributeProvider *builtin_provider =
providers->builtin_attribute_providers().lookup_default_as(attribute_name, nullptr);