Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-30 10:43:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-30 10:43:30 +0400
commitb5e8e8da6f7fecb336972f621db9af8e2aae8a74 (patch)
treebf33287277e0b6567896022695bc3d118f83a904 /source/blender/bmesh
parent3d7104c37ae937e8824351a9745357f466b8e202 (diff)
add option to select face by matching number of sides.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.h1
-rw-r--r--source/blender/bmesh/operators/bmo_utils.c9
2 files changed, 9 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);