Cleanup: Attributes: Implement get_builtin_default for PointCloud

This is currently only used for curves, but it may be used elsewhere
in the future, so it's best to make sure it's implemented consistently.
This commit is contained in:
Hans Goudey
2025-06-24 22:00:37 -04:00
committed by Hans Goudey
parent b915da45d8
commit 4e7ee26cb3

View File

@@ -183,6 +183,10 @@ static constexpr AttributeAccessorFunctions get_pointcloud_accessor_functions()
BLI_assert(cd_type.has_value());
return AttributeDomainAndType{info->domain, *cd_type};
};
fn.get_builtin_default = [](const void * /*owner*/, StringRef name) -> GPointer {
const BuiltinInfo &info = builtin_attributes().lookup(name);
return info.default_value;
};
fn.lookup = [](const void *owner, const StringRef name) -> GAttributeReader {
const PointCloud &pointcloud = *static_cast<const PointCloud *>(owner);
const AttributeStorage &storage = pointcloud.attribute_storage.wrap();