Added option in shift-g to select verts by number of connected edges (valence).
authorJoseph Eagar <joeedh@gmail.com>
Fri, 15 Jun 2012 01:43:01 +0000 (01:43 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Fri, 15 Jun 2012 01:43:01 +0000 (01:43 +0000)
source/blender/bmesh/intern/bmesh_operators.h
source/blender/bmesh/operators/bmo_utils.c
source/blender/editors/mesh/editmesh_select.c

index 3c6c3004e3a8015f36164280b20e13fdcd52cbf1..b1da8ecb275424360494fc28a6c5610129a0a8c3 100644 (file)
@@ -72,7 +72,8 @@ enum {
 enum {
        SIMVERT_NORMAL = 0,
        SIMVERT_FACE,
-       SIMVERT_VGROUP
+       SIMVERT_VGROUP,
+       SIMVERT_EDGE
 };
 
 enum {
index 3ebc7b04aa4abd5d5f83d7ff9ba6106e3c000de5..e0cd3e2ba90dfb321a54de317234f01e75f0e9b9 100644 (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;
                                }
                        }
                }
index 57bce6b9de4f081090de6dbbe9f09c3789b98330..44ec8bd6aaaa9911c991dc36d8143e649136089b 100644 (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", ""},