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
path: root/source
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-02-04 15:10:02 +0300
committerJacques Lucke <jacques@blender.org>2022-02-04 15:10:02 +0300
commitb8a634cb1dff736f5c4b2109e759cfb8ac848c41 (patch)
tree3b906acfde406de5777826002cc2ee97534af1d3 /source
parent5088d907e558daf5399cd8ee620380cb59522912 (diff)
Fix T95489: support writing to vertex groups with geometry nodes again
Technically, this can't be relied upon in the long term. It worked more or less accidentally before. It was broken by a previous fix accidentally. I mainly bring it back because rBa985f558a6eb16cd6f0 was not expected to have this side effect. Note, this change can result in slower performance. Writing to a vertex groups is less efficient than using a generic attribute.
Diffstat (limited to 'source')
-rw-r--r--source/blender/modifiers/intern/MOD_nodes.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index a7c29efbebd..7e65774b86e 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -996,21 +996,18 @@ static void store_computed_output_attributes(
{
for (const OutputAttributeToStore &store : attributes_to_store) {
GeometryComponent &component = geometry.get_component_for_write(store.component_type);
- /* Try deleting an existing attribute, so that we can just use `attribute_try_create` to pass
- * in the data directly. */
- component.attribute_try_delete(store.name);
if (component.attribute_exists(store.name)) {
/* Copy the data into an existing attribute. */
blender::bke::WriteAttributeLookup write_attribute = component.attribute_try_get_for_write(
store.name);
if (write_attribute) {
write_attribute.varray.set_all(store.data.data());
- store.data.type().destruct_n(store.data.data(), store.data.size());
- MEM_freeN(store.data.data());
if (write_attribute.tag_modified_fn) {
write_attribute.tag_modified_fn();
}
}
+ store.data.type().destruct_n(store.data.data(), store.data.size());
+ MEM_freeN(store.data.data());
}
else {
component.attribute_try_create(store.name,