diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-14 15:10:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-14 15:10:03 +0400 |
commit | e762797af5fb6b903cc255fd746c7ac4b7687dd1 (patch) | |
tree | 549bdf7efc77626c49e070398cd7c2c927bdf93d /source/blender/editors | |
parent | 7a71f58af3b5f70e8982d827d1fef7e8bc4e4ec8 (diff) |
fix for sharp edge selection being inverted, change default angle from 1 to 30deg.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index dc5d1cea443..81776ff7f4f 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -2324,25 +2324,19 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op) BMIter iter; BMEdge *e; BMLoop *l1, *l2; - float sharp = RNA_float_get(op->ptr, "sharpness"), angle; + const float sharp = RNA_float_get(op->ptr, "sharpness"); BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) { - if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) || !e->l) - continue; - - l1 = e->l; - l2 = l1->radial_next; - - if (l1 == l2) - continue; - - /* edge has exactly two neighboring faces, check angle */ - angle = angle_normalized_v3v3(l1->f->no, l2->f->no); + if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == FALSE && + BM_edge_loop_pair(e, &l1, &l2)) + { + /* edge has exactly two neighboring faces, check angle */ + const float angle = angle_normalized_v3v3(l1->f->no, l2->f->no); - if (fabsf(angle) < sharp) { - BM_edge_select_set(em->bm, e, TRUE); + if (fabsf(angle) > sharp) { + BM_edge_select_set(em->bm, e, TRUE); + } } - } WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); @@ -2369,7 +2363,7 @@ void MESH_OT_edges_select_sharp(wmOperatorType *ot) /* props */ prop = RNA_def_float_rotation(ot->srna, "sharpness", 0, NULL, DEG2RADF(0.01f), DEG2RADF(180.0f), "Sharpness", "", DEG2RADF(1.0f), DEG2RADF(180.0f)); - RNA_def_property_float_default(prop, DEG2RADF(1.0f)); + RNA_def_property_float_default(prop, DEG2RADF(30.0f)); } static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) |