From a1c7cab06cc5473273a711200b6b5d0a96fb1c21 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 2 Feb 2021 09:20:54 -0600 Subject: Fix T85155: Vertex groups from object don't transfer to next nodes modifier Because the the vertex group name-to-index map is stored in the object rather than object data, the object info node has to replace the map when it replaces the mesh component on the geometry set with mesh data from another object. This normally works fine as a way to use the vertex groups from the input mesh, but when passing this mesh to the next modifier, the entire mesh component was replaced, removing the vertex group name map. This commit adds a function to replace only the mesh data in mesh component, uses it in the modifier code, and updates the relevant comments. Note that the fact that vertex group names are stored in object data is a legacy design decision that should be reevaluated at some point. Differential Revision: https://developer.blender.org/D10256 --- source/blender/blenkernel/BKE_geometry_set.hh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenkernel/BKE_geometry_set.hh') diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 3b093ae730a..31739465afd 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -349,6 +349,8 @@ class MeshComponent : public GeometryComponent { void clear(); bool has_mesh() const; void replace(Mesh *mesh, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); + void replace_mesh_but_keep_vertex_group_names( + Mesh *mesh, GeometryOwnershipType ownership = GeometryOwnershipType::Owned); Mesh *release(); void copy_vertex_group_names_from_object(const struct Object &object); -- cgit v1.2.3