diff --git a/source/blender/blenkernel/BKE_attribute_storage.hh b/source/blender/blenkernel/BKE_attribute_storage.hh index 273a43a7ff8..5be5f871d07 100644 --- a/source/blender/blenkernel/BKE_attribute_storage.hh +++ b/source/blender/blenkernel/BKE_attribute_storage.hh @@ -178,7 +178,7 @@ class AttributeStorage : public ::AttributeStorage { Attribute::DataVariant data); /** Return a possibly changed version of the input name that is unique within existing names. */ - std::string unique_name_calc(StringRef name); + std::string unique_name_calc(StringRef name) const; /** Change the name of a single existing attribute. */ void rename(StringRef old_name, std::string new_name); diff --git a/source/blender/blenkernel/intern/attribute_storage.cc b/source/blender/blenkernel/intern/attribute_storage.cc index 6ba20702798..81db4638646 100644 --- a/source/blender/blenkernel/intern/attribute_storage.cc +++ b/source/blender/blenkernel/intern/attribute_storage.cc @@ -301,7 +301,7 @@ bool AttributeStorage::remove(const StringRef name) return this->runtime->attributes.remove_as(name); } -std::string AttributeStorage::unique_name_calc(const StringRef name) +std::string AttributeStorage::unique_name_calc(const StringRef name) const { return BLI_uniquename_cb( [&](const StringRef check_name) { return this->lookup(check_name) != nullptr; }, '.', name);