Animation: Weight Paint select more/less for faces #105607
|
@ -350,12 +350,12 @@ void paintface_select_linked(bContext *C, Object *ob, const int mval[2], const b
|
|||
paintface_flush_flags(C, ob, true, false);
|
||||
}
|
||||
|
||||
static bool poly_has_selected_neighbor(blender::Span<int> edge_indices,
|
||||
static bool poly_has_selected_neighbor(blender::Span<int> poly_edges,
|
||||
|
||||
blender::Span<MEdge> edges,
|
||||
blender::Span<bool> select_vert,
|
||||
const bool face_step)
|
||||
{
|
||||
for (const int edge_index : edge_indices) {
|
||||
for (const int edge_index : poly_edges) {
|
||||
const MEdge &edge = edges[edge_index];
|
||||
/* If a poly is selected, all of its verts are selected too, meaning that neighboring faces
|
||||
* will have some vertices selected. */
|
||||
|
@ -408,12 +408,12 @@ void paintface_select_more(Mesh *mesh, const bool face_step)
|
|||
select_vert.finish();
|
||||
}
|
||||
|
||||
static bool poly_has_unselected_neighbor(blender::Span<int> edge_indices,
|
||||
static bool poly_has_unselected_neighbor(blender::Span<int> poly_edges,
|
||||
blender::Span<MEdge> edges,
|
||||
Hans Goudey
commented
It's not a big deal, but the function could be a bit simpler without the It's not a big deal, but the function could be a bit simpler without the `unselected_neighbor` variable. It's nice to assign a variable a meaningful value in the same expression you initialize it, and that's not really the case here. Given the function name, returning early reads as "poly has an unselected neighbor" anyway.
|
||||
blender::BitSpan verts_of_unselected_faces,
|
||||
const bool face_step)
|
||||
ChrisLend marked this conversation as resolved
Outdated
Hans Goudey
commented
What do you think about removing the What do you think about removing the `.test()` and using `BitRef`'s implicit bool conversion?
|
||||
{
|
||||
for (const int edge_index : edge_indices) {
|
||||
for (const int edge_index : poly_edges) {
|
||||
const MEdge &edge = edges[edge_index];
|
||||
if (face_step) {
|
||||
if (verts_of_unselected_faces[edge.v1] || verts_of_unselected_faces[edge.v2]) {
|
||||
|
|
Loading…
Reference in New Issue
Canonical variable name for the edges of a face is
poly_edges