Cleanup: Move anonymous attribute removal to geometry component
Implementing removal of anonymous attributes with `GeometryComponent` instead of `Mesh` makes it more reusable for other types like curves.
This commit is contained in:
@@ -926,6 +926,21 @@ bool GeometryComponent::attribute_try_delete(const AttributeIDRef &attribute_id)
|
||||
return success;
|
||||
}
|
||||
|
||||
void GeometryComponent::attributes_remove_anonymous()
|
||||
{
|
||||
using namespace blender;
|
||||
Vector<const AnonymousAttributeID *> anonymous_ids;
|
||||
for (const AttributeIDRef &id : this->attribute_ids()) {
|
||||
if (id.is_anonymous()) {
|
||||
anonymous_ids.append(&id.anonymous_id());
|
||||
}
|
||||
}
|
||||
|
||||
while (!anonymous_ids.is_empty()) {
|
||||
this->attribute_try_delete(anonymous_ids.pop_last());
|
||||
}
|
||||
}
|
||||
|
||||
bool GeometryComponent::attribute_try_create(const AttributeIDRef &attribute_id,
|
||||
const AttributeDomain domain,
|
||||
const CustomDataType data_type,
|
||||
|
||||
Reference in New Issue
Block a user