Animation: Weight Paint select more/less for vertices #105633

Merged
Christoph Lendenfeld merged 14 commits from ChrisLend/blender:weight_paint_grow_sel_vert into main 2023-03-31 14:48:09 +02:00
1 changed files with 3 additions and 10 deletions
Showing only changes of commit d0b5a6a754 - Show all commits

View File

@ -680,16 +680,9 @@ void paintvert_select_more(bContext *C, Object *ob, const bool face_step)
const Span<MLoop> loops = mesh->loops();
const Span<MEdge> edges = mesh->edges();
MeshElemMap *edge_poly_map;
int *edge_poly_mem;
Array<Vector<int, 2>> edge_to_face_map;
if (face_step) {
BKE_mesh_edge_poly_map_create(&edge_poly_map,
&edge_poly_mem,
edges.size(),
polys.data(),
polys.size(),
loops.data(),
loops.size());
edge_to_face_map = bke::mesh_topology::build_edge_to_poly_map(polys, loops, mesh->totedge);

You set every value of the bit vector, so there's no need to explicitly initialize it to false here.

You set every value of the bit vector, so there's no need to explicitly initialize it to false here.
}

The functionality is the same, but mesh_topology::build_edge_to_poly_map(..) has an interface that's a bit more friendly in C++. Performance might be slightly worse currently, but there are plans to improve those functions in the near future.

The functionality is the same, but `mesh_topology::build_edge_to_poly_map(..)` has an interface that's a bit more friendly in C++. Performance might be slightly worse currently, but there are plans to improve those functions in the near future.
/* Need a copy of the selected verts that we can read from and is not modified. */
@ -710,7 +703,7 @@ void paintvert_select_more(bContext *C, Object *ob, const bool face_step)
if (!face_step) {
continue;
}
const Span<int> neighbor_polys(edge_poly_map[i].indices, edge_poly_map[i].count);
const Span<int> neighbor_polys = edge_to_face_map[i];
for (const int poly_i : neighbor_polys) {
if (hide_poly[poly_i]) {
continue;