diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-13 19:10:34 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-13 19:10:34 +0300 |
commit | 3b6ee8cee7080af200e25e944fe30d310240e138 (patch) | |
tree | 724f298a53b12811e17425b84a909f2aaf2557a3 /source/blender/nodes/geometry | |
parent | 52b94049f2a71a74f52247f83657cf3a5c8712b4 (diff) |
Refactor: Move vertex group names to object data
This commit moves the storage of `bDeformGroup` and the active index
to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility
functions are added to allow easy access to the vertex groups given
an object or an ID.
As explained in T88951, the list of vertex group names is currently
stored separately per object, even though vertex group data is stored
on the geometry. This tends to complicate code and cause bugs,
especially as geometry is created procedurally and tied less closely
to an object.
The "Copy Vertex Groups to Linked" operator is removed, since they
are stored on the geometry anyway.
This patch leaves the object-level python API for vertex groups in
place. Creating a geometry-level RNA API can be a separate step;
the changes in this commit are invasive enough as it is.
Note that opening a file saved in 3.0 in an earlier version means
the vertex groups will not be available.
Differential Revision: https://developer.blender.org/D11689
Diffstat (limited to 'source/blender/nodes/geometry')
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc index b1da2dcd3c4..8c697275f88 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc @@ -627,7 +627,7 @@ static void delete_mesh_selection(MeshComponent &component, mesh_out = nullptr; break; } - component.replace_mesh_but_keep_vertex_group_names(mesh_out); + component.replace(mesh_out); } static void geo_node_delete_geometry_exec(GeoNodeExecParams params) diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_subdivide.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_subdivide.cc index 7492582c8cf..245d7800621 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_subdivide.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_subdivide.cc @@ -91,7 +91,7 @@ static void geo_node_mesh_subdivide_exec(GeoNodeExecParams params) BKE_mesh_calc_normals(mesh_out); MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); - mesh_component.replace_mesh_but_keep_vertex_group_names(mesh_out); + mesh_component.replace(mesh_out); BKE_subdiv_free(subdiv); diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc index 20ffcdb516d..f0f032ed8f4 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc @@ -96,7 +96,7 @@ static void geo_node_subdivision_surface_exec(GeoNodeExecParams params) BKE_mesh_calc_normals(mesh_out); MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>(); - mesh_component.replace_mesh_but_keep_vertex_group_names(mesh_out); + mesh_component.replace(mesh_out); // BKE_subdiv_stats_print(&subdiv->stats); BKE_subdiv_free(subdiv); |