diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-21 20:19:04 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-21 21:10:03 +0300 |
commit | 600c069e0ef5334575164e5c4d758efe7324b0c7 (patch) | |
tree | a01f0f656b67b01dc46278394a7df61a0b95498f /source/blender/blenkernel | |
parent | a82e52102b0f7ddfe3741fccdaa9de5f480c59fe (diff) |
Attributes: Correct implementation of typed "write_only" method
The typed "lookup_or_add_for_write_only" function is meant to do the
same thing as the non-typed version of the function. Instead, it still
initialized values of new attribute arrays, which isn't meant to happen.
Missed in 4c91c24bc7cbe2c4f97be373.
I also had to correct one place that used the "write_only"
function but didn't intialize all values.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_attribute.hh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_attribute.hh b/source/blender/blenkernel/BKE_attribute.hh index b1f4039f788..97a8a91d0e4 100644 --- a/source/blender/blenkernel/BKE_attribute.hh +++ b/source/blender/blenkernel/BKE_attribute.hh @@ -706,7 +706,9 @@ class MutableAttributeAccessor : public AttributeAccessor { SpanAttributeWriter<T> lookup_or_add_for_write_only_span(const AttributeIDRef &attribute_id, const eAttrDomain domain) { - AttributeWriter<T> attribute = this->lookup_or_add_for_write<T>(attribute_id, domain); + AttributeWriter<T> attribute = this->lookup_or_add_for_write<T>( + attribute_id, domain, AttributeInitConstruct()); + if (attribute) { return SpanAttributeWriter<T>{std::move(attribute), false}; } |