diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-30 10:43:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-30 10:43:30 +0400 |
commit | b5e8e8da6f7fecb336972f621db9af8e2aae8a74 (patch) | |
tree | bf33287277e0b6567896022695bc3d118f83a904 | |
parent | 3d7104c37ae937e8824351a9745357f466b8e202 (diff) |
add option to select face by matching number of sides.
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.h | 1 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 9 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h index b1da8ecb275..3341a7df6f7 100644 --- a/source/blender/bmesh/intern/bmesh_operators.h +++ b/source/blender/bmesh/intern/bmesh_operators.h @@ -51,6 +51,7 @@ enum { SIMFACE_MATERIAL = 201, SIMFACE_IMAGE, SIMFACE_AREA, + SIMFACE_SIDES, SIMFACE_PERIMETER, SIMFACE_NORMAL, SIMFACE_COPLANAR diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index 42c5557327b..c4626a429c3 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -542,7 +542,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) SimSel_FaceExt *f_ext = NULL; int *indices = NULL; float t_no[3]; /* temporary normal */ - int type = BMO_slot_int_get(op, "type"); + const int type = BMO_slot_int_get(op, "type"); const float thresh = BMO_slot_float_get(op, "thresh"); const float thresh_radians = thresh * (float)M_PI; @@ -662,6 +662,13 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) } break; + case SIMFACE_SIDES: + if (fm->len == fs->len) { + BMO_elem_flag_enable(bm, fm, FACE_MARK); + cont = FALSE; + } + break; + case SIMFACE_PERIMETER: if (fabsf(f_ext[i].perim - f_ext[indices[idx]].perim) <= thresh) { BMO_elem_flag_enable(bm, fm, FACE_MARK); diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 03c88c4a9da..a8b72bee88f 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -690,6 +690,7 @@ static EnumPropertyItem prop_similar_types[] = { {SIMFACE_MATERIAL, "MATERIAL", 0, "Material", ""}, {SIMFACE_IMAGE, "IMAGE", 0, "Image", ""}, {SIMFACE_AREA, "AREA", 0, "Area", ""}, + {SIMFACE_SIDES, "SIDES", 0, "Polygon Sides", ""}, {SIMFACE_PERIMETER, "PERIMETER", 0, "Perimeter", ""}, {SIMFACE_NORMAL, "NORMAL", 0, "Normal", ""}, {SIMFACE_COPLANAR, "COPLANAR", 0, "Co-planar", ""}, |