diff options
author | Hans Goudey <h.goudey@me.com> | 2021-02-02 18:20:54 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-02-02 18:20:54 +0300 |
commit | a1c7cab06cc5473273a711200b6b5d0a96fb1c21 (patch) | |
tree | f913ba0b428cdb743f6f0647c23e0233e3b75385 /source/blender/blenkernel/BKE_geometry_set.hh | |
parent | 9e0c876aadd9641fa9e8d6d8717c757b8b528d8b (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_geometry_set.hh | 2 |
1 files changed, 2 insertions, 0 deletions
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); |