diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-26 00:44:30 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-26 00:44:30 +0300 |
commit | 96834a7bacffc97d87af6b8b89aa2a091b5b094a (patch) | |
tree | 338bf66cb32a14b48531ddfacbb61986db760c4b /source/blender | |
parent | 3b4b2bcb1326fdd15011aade65d55079abd89f38 (diff) |
Fix T97595: Modifier attribute output broken for vertex groups
`attribute_try_create` didn't understand that the vertex group
attribute already existed because it only looks for names in custom
data layers when the domain matches. Using `attribute_exists`
unfortunately requires another loop through all attribute names,
but that should be optimized separately in the future anyway.
Differential Revision: https://developer.blender.org/D14756
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/attribute_access.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index 77c7857a528..98db5013a00 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -939,6 +939,9 @@ bool GeometryComponent::attribute_try_create(const AttributeIDRef &attribute_id, if (providers == nullptr) { return false; } + if (this->attribute_exists(attribute_id)) { + return false; + } if (attribute_id.is_named()) { const BuiltinAttributeProvider *builtin_provider = providers->builtin_attribute_providers().lookup_default_as(attribute_id.name(), nullptr); |