From 821b231bd6bf47d3b90dc3525d6aa4c711ae76ff Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 May 2012 14:06:35 +0000 Subject: add bevel to select similar edges operator --- source/blender/bmesh/intern/bmesh_operators.h | 1 + source/blender/bmesh/operators/bmo_utils.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'source/blender/bmesh') diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h index b0a647b7009..3c6c3004e3a 100644 --- a/source/blender/bmesh/intern/bmesh_operators.h +++ b/source/blender/bmesh/intern/bmesh_operators.h @@ -63,6 +63,7 @@ enum { SIMEDGE_FACE, SIMEDGE_FACE_ANGLE, SIMEDGE_CREASE, + SIMEDGE_BEVEL, SIMEDGE_SEAM, SIMEDGE_SHARP }; diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index 8409c5b76b8..b4703990b1e 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -809,6 +809,20 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) } break; + case SIMEDGE_BEVEL: + if (CustomData_has_layer(&bm->edata, CD_BWEIGHT)) { + float *c1, *c2; + + c1 = CustomData_bmesh_get(&bm->edata, e->head.data, CD_BWEIGHT); + c2 = CustomData_bmesh_get(&bm->edata, es->head.data, CD_BWEIGHT); + + if (c1 && c2 && fabsf(*c1 - *c2) <= thresh) { + BMO_elem_flag_enable(bm, e, EDGE_MARK); + cont = FALSE; + } + } + break; + case SIMEDGE_SEAM: if (BM_elem_flag_test(e, BM_ELEM_SEAM) == BM_elem_flag_test(es, BM_ELEM_SEAM)) { BMO_elem_flag_enable(bm, e, EDGE_MARK); -- cgit v1.2.3