Added option in shift-g to select verts by number of connected edges (valence).

This commit is contained in:
Joseph Eagar
2012-06-15 01:43:01 +00:00
parent 9355bece59
commit bd9192670b
3 changed files with 14 additions and 1 deletions

View File

@@ -72,7 +72,8 @@ enum {
enum {
SIMVERT_NORMAL = 0,
SIMVERT_FACE,
SIMVERT_VGROUP
SIMVERT_VGROUP,
SIMVERT_EDGE
};
enum {

View File

@@ -873,6 +873,7 @@ typedef struct SimSel_VertExt {
BMVert *v;
union {
int num_faces; /* adjacent faces */
int num_edges; /* adjacent edges */
MDeformVert *dvert; /* deform vertex */
};
} SimSel_VertExt;
@@ -928,6 +929,9 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
v_ext[i].dvert = NULL;
}
break;
case SIMVERT_EDGE:
v_ext[i].num_edges = BM_vert_edge_count(v);
break;
}
i++;
@@ -970,6 +974,13 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
}
}
break;
case SIMVERT_EDGE:
/* number of adjacent edges */
if (v_ext[i].num_edges == v_ext[indices[idx]].num_edges) {
BMO_elem_flag_enable(bm, v, VERT_MARK);
cont = FALSE;
}
break;
}
}
}

View File

@@ -676,6 +676,7 @@ static EnumPropertyItem prop_similar_types[] = {
{SIMVERT_NORMAL, "NORMAL", 0, "Normal", ""},
{SIMVERT_FACE, "FACE", 0, "Amount of Adjacent Faces", ""},
{SIMVERT_VGROUP, "VGROUP", 0, "Vertex Groups", ""},
{SIMVERT_EDGE, "EDGE", 0, "Amount of connecting edges", ""},
{SIMEDGE_LENGTH, "LENGTH", 0, "Length", ""},
{SIMEDGE_DIR, "DIR", 0, "Direction", ""},