Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-06-16 17:44:58 +0300
committerJacques Lucke <jacques@blender.org>2022-06-16 17:45:31 +0300
commitdc11e1164a07bedd477020a43dcf35fabdb1ad49 (patch)
tree69a0c8a9bd52c382fd97829ea9186f9e0902be21
parent947ece8d395a61bdae52da0d2a760873d43d2305 (diff)
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.
-rw-r--r--source/blender/blenkernel/intern/geometry_set_instances.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc
index d3c3f41779a..2d6e0e05a97 100644
--- a/source/blender/blenkernel/intern/geometry_set_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_set_instances.cc
@@ -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);
}
}