From 990b912fd76cd9a2bf0278e7a5bc4a2029e024d2 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 20 Oct 2021 09:57:54 -0500 Subject: Cleanup: Add check whether to remove an anonymous atttribute Add a higher level check that can be used instead of checking whether the attribute ID is anonymous and checking whether it has any strong references. --- source/blender/blenkernel/intern/geometry_set.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/geometry_set.cc') diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc index e439cc838e3..4753a9e0768 100644 --- a/source/blender/blenkernel/intern/geometry_set.cc +++ b/source/blender/blenkernel/intern/geometry_set.cc @@ -507,12 +507,11 @@ void GeometrySet::gather_attributes_for_propagation( return; } } - if (attribute_id.is_anonymous()) { - if (!BKE_anonymous_attribute_id_has_strong_references(&attribute_id.anonymous_id())) { - /* Don't propagate anonymous attributes that are not used anymore. */ - return; - } + + if (!attribute_id.should_be_kept()) { + return; } + auto add_info = [&](AttributeKind *attribute_kind) { attribute_kind->domain = meta_data.domain; attribute_kind->data_type = meta_data.data_type; -- cgit v1.2.3