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:
authorAntonio Vazquez <blendergit@gmail.com>2022-02-10 18:59:57 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-02-10 18:59:57 +0300
commita7ae33202fa94a52235fbe595873d81e482d5f58 (patch)
treec075afc26803edd25de9021d3190d2d9613f741d /source/blender/modifiers/intern/MOD_nodes.cc
parenta5cddaefd344a4ab8c1d5d1be39edf6e6dc456e0 (diff)
parentad77b52abcbd0daf0d1a3ad395983cb90beeb72a (diff)
Merge branch 'master' into greasepencil-objectgreasepencil-object
Conflicts: release/scripts/startup/bl_ui/space_userpref.py source/blender/blenkernel/BKE_gpencil.h source/blender/blenkernel/BKE_gpencil_update_cache.h source/blender/blenkernel/CMakeLists.txt source/blender/blenkernel/intern/gpencil.c source/blender/blenkernel/intern/gpencil_update_cache.c source/blender/blenlib/BLI_listbase.h source/blender/blenlib/intern/DLRB_tree.c source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_gpencil.cc source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_gpencil.h source/blender/makesdna/DNA_gpencil_types.h source/blender/makesrna/intern/rna_gpencil.c
Diffstat (limited to 'source/blender/modifiers/intern/MOD_nodes.cc')
-rw-r--r--source/blender/modifiers/intern/MOD_nodes.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index ca4bfbed5f5..f16fc8ff764 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -1031,7 +1031,11 @@ static void store_computed_output_attributes(
{
for (const OutputAttributeToStore &store : attributes_to_store) {
GeometryComponent &component = geometry.get_component_for_write(store.component_type);
- if (component.attribute_exists(store.name)) {
+ const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(store.data.type());
+ const std::optional<AttributeMetaData> meta_data = component.attribute_get_meta_data(
+ store.name);
+ if (meta_data.has_value() && meta_data->domain == store.domain &&
+ meta_data->data_type == data_type) {
/* Copy the data into an existing attribute. */
blender::bke::WriteAttributeLookup write_attribute = component.attribute_try_get_for_write(
store.name);
@@ -1045,6 +1049,10 @@ static void store_computed_output_attributes(
MEM_freeN(store.data.data());
}
else {
+ /* Replace the existing attribute with the new data. */
+ if (meta_data.has_value()) {
+ component.attribute_try_delete(store.name);
+ }
component.attribute_try_create(store.name,
store.domain,
blender::bke::cpp_type_to_custom_data_type(store.data.type()),