diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-13 08:15:40 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-13 08:15:40 +0300 |
commit | ade37d8380728a8f40f05c971585f91325c8ad69 (patch) | |
tree | 510b73a6039441a75ae6d5c830dd2cfef9bec06e /source/blender/modifiers/intern/MOD_mask.cc | |
parent | 2edb69f8a600847f195b88deceea5e980ecb61a7 (diff) |
Convert many more uses of MVert
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mask.cc')
-rw-r--r-- | source/blender/modifiers/intern/MOD_mask.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index 37f26911665..ae76eeb4ec2 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -49,6 +49,7 @@ #include "BLI_vector.hh" using blender::Array; +using blender::float3; using blender::IndexRange; using blender::ListBaseWrapper; using blender::MutableSpan; @@ -338,8 +339,8 @@ static void copy_masked_verts_to_new_mesh(const Mesh &src_mesh, Span<int> vertex_map) { BLI_assert(src_mesh.totvert == vertex_map.size()); - const Span<MVert> src_verts = src_mesh.positions(); - MutableSpan<MVert> dst_verts = dst_mesh.positions_for_write(); + const Span<float3> src_positions = src_mesh.positions(); + MutableSpan<float3> dst_positions = dst_mesh.positions_for_write(); for (const int i_src : vertex_map.index_range()) { const int i_dst = vertex_map[i_src]; @@ -347,10 +348,6 @@ static void copy_masked_verts_to_new_mesh(const Mesh &src_mesh, continue; } - const MVert &v_src = src_verts[i_src]; - MVert &v_dst = dst_verts[i_dst]; - - v_dst = v_src; CustomData_copy_data(&src_mesh.vdata, &dst_mesh.vdata, i_src, i_dst, 1); } } @@ -376,11 +373,10 @@ static void add_interp_verts_copy_edges_to_new_mesh(const Mesh &src_mesh, uint verts_add_num, MutableSpan<int> r_edge_map) { + using namespace blender; BLI_assert(src_mesh.totvert == vertex_mask.size()); BLI_assert(src_mesh.totedge == r_edge_map.size()); - const Span<MVert> src_verts = src_mesh.positions(); const Span<MEdge> src_edges = src_mesh.edges(); - MutableSpan<MVert> dst_verts = dst_mesh.positions_for_write(); MutableSpan<MEdge> dst_edges = dst_mesh.edges_for_write(); uint vert_index = dst_mesh.totvert - verts_add_num; @@ -420,11 +416,6 @@ static void add_interp_verts_copy_edges_to_new_mesh(const Mesh &src_mesh, float weights[2] = {1.0f - fac, fac}; CustomData_interp( &src_mesh.vdata, &dst_mesh.vdata, (int *)&e_src.v1, weights, nullptr, 2, vert_index); - MVert &v = dst_verts[vert_index]; - const MVert &v1 = src_verts[e_src.v1]; - const MVert &v2 = src_verts[e_src.v2]; - - interp_v3_v3v3(v.co, v1.co, v2.co, fac); vert_index++; } } |