From 46b35c683688737c6ced48917e6fffb53bbdfe3f Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 15 Mar 2022 12:32:18 +0100 Subject: [PATCH] Cleanup: remove accidental shallow mesh copy --- .../intern/geometry_component_mesh.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index cbd7ec9155a..a07957e999c 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -260,7 +260,7 @@ static GVArray adapt_mesh_domain_point_to_corner(const Mesh &mesh, const GVArray attribute_math::convert_to_static_type(varray.type(), [&](auto dummy) { using T = decltype(dummy); new_varray = VArray::ForFunc(mesh.totloop, - [mesh, varray = varray.typed()](const int64_t loop_index) { + [&mesh, varray = varray.typed()](const int64_t loop_index) { const int vertex_index = mesh.mloop[loop_index].v; return varray[vertex_index]; }); @@ -276,7 +276,7 @@ static GVArray adapt_mesh_domain_corner_to_face(const Mesh &mesh, const GVArray if constexpr (!std::is_void_v>) { if constexpr (std::is_same_v) { new_varray = VArray::ForFunc( - mesh.totpoly, [mesh, varray = varray.typed()](const int face_index) { + mesh.totpoly, [&mesh, varray = varray.typed()](const int face_index) { /* A face is selected if all of its corners were selected. */ const MPoly &poly = mesh.mpoly[face_index]; for (const int loop_index : IndexRange(poly.loopstart, poly.totloop)) { @@ -289,7 +289,7 @@ static GVArray adapt_mesh_domain_corner_to_face(const Mesh &mesh, const GVArray } else { new_varray = VArray::ForFunc( - mesh.totpoly, [mesh, varray = varray.typed()](const int face_index) { + mesh.totpoly, [&mesh, varray = varray.typed()](const int face_index) { T return_value; attribute_math::DefaultMixer mixer({&return_value, 1}); const MPoly &poly = mesh.mpoly[face_index]; @@ -530,7 +530,7 @@ static GVArray adapt_mesh_domain_point_to_face(const Mesh &mesh, const GVArray & if constexpr (!std::is_void_v>) { if constexpr (std::is_same_v) { new_varray = VArray::ForFunc( - mesh.totpoly, [mesh, varray = varray.typed()](const int face_index) { + mesh.totpoly, [&mesh, varray = varray.typed()](const int face_index) { /* A face is selected if all of its vertices were selected. */ const MPoly &poly = mesh.mpoly[face_index]; for (const int loop_index : IndexRange(poly.loopstart, poly.totloop)) { @@ -544,7 +544,7 @@ static GVArray adapt_mesh_domain_point_to_face(const Mesh &mesh, const GVArray & } else { new_varray = VArray::ForFunc( - mesh.totpoly, [mesh, varray = varray.typed()](const int face_index) { + mesh.totpoly, [&mesh, varray = varray.typed()](const int face_index) { T return_value; attribute_math::DefaultMixer mixer({&return_value, 1}); const MPoly &poly = mesh.mpoly[face_index]; @@ -571,14 +571,14 @@ static GVArray adapt_mesh_domain_point_to_edge(const Mesh &mesh, const GVArray & if constexpr (std::is_same_v) { /* An edge is selected if both of its vertices were selected. */ new_varray = VArray::ForFunc( - mesh.totedge, [mesh, varray = varray.typed()](const int edge_index) { + mesh.totedge, [&mesh, varray = varray.typed()](const int edge_index) { const MEdge &edge = mesh.medge[edge_index]; return varray[edge.v1] && varray[edge.v2]; }); } else { new_varray = VArray::ForFunc( - mesh.totedge, [mesh, varray = varray.typed()](const int edge_index) { + mesh.totedge, [&mesh, varray = varray.typed()](const int edge_index) { T return_value; attribute_math::DefaultMixer mixer({&return_value, 1}); const MEdge &edge = mesh.medge[edge_index]; @@ -713,7 +713,7 @@ static GVArray adapt_mesh_domain_edge_to_face(const Mesh &mesh, const GVArray &v if constexpr (std::is_same_v) { /* A face is selected if all of its edges are selected. */ new_varray = VArray::ForFunc( - mesh.totpoly, [mesh, varray = varray.typed()](const int face_index) { + mesh.totpoly, [&mesh, varray = varray.typed()](const int face_index) { const MPoly &poly = mesh.mpoly[face_index]; for (const int loop_index : IndexRange(poly.loopstart, poly.totloop)) { const MLoop &loop = mesh.mloop[loop_index]; @@ -726,7 +726,7 @@ static GVArray adapt_mesh_domain_edge_to_face(const Mesh &mesh, const GVArray &v } else { new_varray = VArray::ForFunc( - mesh.totpoly, [mesh, varray = varray.typed()](const int face_index) { + mesh.totpoly, [&mesh, varray = varray.typed()](const int face_index) { T return_value; attribute_math::DefaultMixer mixer({&return_value, 1}); const MPoly &poly = mesh.mpoly[face_index];