Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-10-20 21:15:37 +0300
committerHans Goudey <h.goudey@me.com>2021-10-20 21:15:37 +0300
commit704d077d8fa35178af97ec5d946c470dbe25dab6 (patch)
treec2ba07ebb8d23bd3b365e93742a2c759a596f084
parent010e675b1b436a824a3149dd478a1c8f4191fe42 (diff)
Fix: Crash when retrieving output "id" attribute
The attribute provider needs to handle the case where the data is stored with just a data type, and the case where it is stored with a name.
-rw-r--r--source/blender/blenkernel/intern/attribute_access.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index 930cabafb00..3386d346364 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -371,7 +371,14 @@ GVMutableArrayPtr BuiltinCustomDataLayerProvider::try_get_for_write(
return {};
}
const int domain_size = component.attribute_domain_size(domain_);
- void *data = CustomData_get_layer(custom_data, stored_type_);
+
+ void *data;
+ if (stored_as_named_attribute_) {
+ data = CustomData_get_layer_named(custom_data, stored_type_, name_.c_str());
+ }
+ else {
+ data = CustomData_get_layer(custom_data, stored_type_);
+ }
if (data == nullptr) {
return {};
}