diff options
author | Hans Goudey <h.goudey@me.com> | 2021-01-15 20:04:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-15 20:04:53 +0300 |
commit | 3459f75f5b31e155bf549ec70dd2476dc810077e (patch) | |
tree | 528e2b713707176258630106953002252b397dde /source/blender/blenkernel/intern/attribute_access.cc | |
parent | 237e27e161c9ac3c6b9d74dae1cafb5ea55c0458 (diff) | |
parent | 0b0e45252b11bbc1c0d96a3e04a4087d02f765e3 (diff) |
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/blenkernel/intern/attribute_access.cc')
-rw-r--r-- | source/blender/blenkernel/intern/attribute_access.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index b9ccee0dd4a..95a6628b1ae 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -825,7 +825,8 @@ blender::bke::ReadAttributePtr GeometryComponent::attribute_get_constant_for_rea OutputAttributePtr GeometryComponent::attribute_try_get_for_output(const StringRef attribute_name, const AttributeDomain domain, - const CustomDataType data_type) + const CustomDataType data_type, + const void *default_value) { BLI_assert(this->attribute_domain_with_type_supported(domain, data_type)); @@ -838,6 +839,11 @@ OutputAttributePtr GeometryComponent::attribute_try_get_for_output(const StringR if (!attribute) { this->attribute_try_create(attribute_name, domain, data_type); attribute = this->attribute_try_get_for_write(attribute_name); + if (default_value != nullptr) { + void *data = attribute->get_span_for_write_only().data(); + cpp_type->fill_initialized(default_value, data, attribute->size()); + attribute->apply_span(); + } return OutputAttributePtr(std::move(attribute)); } |