From 4e7ee26cb351b80c1a76e3d64e2d733fe12c2796 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 24 Jun 2025 22:00:37 -0400 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/pointcloud_attributes.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/blenkernel/intern/pointcloud_attributes.cc b/source/blender/blenkernel/intern/pointcloud_attributes.cc index 79d8dfae207..a466937d54b 100644 --- a/source/blender/blenkernel/intern/pointcloud_attributes.cc +++ b/source/blender/blenkernel/intern/pointcloud_attributes.cc @@ -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(owner); const AttributeStorage &storage = pointcloud.attribute_storage.wrap();