Fix T84382: Geometry Nodes: Vertex group attributes are removed

In the report, the geometry is copied because it has two users and the
final join node needs to write to it. The join node also happens to
remove attributes apparently, because it exposed a mistake in the "copy"
method of the `MeshComponent` class. The copy is supposed to be
a deep copy, but the vertex group name map was not duplicated.

Differential Revision: https://developer.blender.org/D9991
This commit is contained in:
Hans Goudey 2021-01-04 17:07:10 -06:00
parent ec90dda318
commit 102eff0bd4
Notes: blender-bot 2023-02-14 06:00:50 +01:00
Referenced by issue #84382, Geometry Nodes: Vertex group attributes removed by second node
1 changed files with 1 additions and 0 deletions

View File

@ -283,6 +283,7 @@ GeometryComponent *MeshComponent::copy() const
if (mesh_ != nullptr) {
new_component->mesh_ = BKE_mesh_copy_for_eval(mesh_, false);
new_component->ownership_ = GeometryOwnershipType::Owned;
new_component->vertex_group_names_ = blender::Map(vertex_group_names_);
}
return new_component;
}