Fix T98796: avoid unnecessary mesh copy

The call to `get_component_for_write` would sometimes copy the mesh
even when the mesh is replaced with itself. The `replace_mesh` method
handles that case already, so just use that instead.
This commit is contained in:
Jacques Lucke 2022-06-16 16:44:58 +02:00
parent 947ece8d39
commit dc11e1164a
Notes: blender-bot 2023-02-14 05:53:38 +01:00
Referenced by issue #98796, Regression: Drop in performance when manipulating instances in geometry nodes Blender 3.2
Referenced by issue #98661, 3.2: Potential candidates for corrective releases
1 changed files with 1 additions and 3 deletions

View File

@ -32,9 +32,7 @@ static void add_final_mesh_as_geometry_component(const Object &object, GeometryS
if (mesh != nullptr) {
BKE_mesh_wrapper_ensure_mdata(mesh);
MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>();
mesh_component.replace(mesh, GeometryOwnershipType::ReadOnly);
geometry_set.replace_mesh(mesh, GeometryOwnershipType::ReadOnly);
}
}