diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-13 10:35:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-13 11:07:59 +0300 |
commit | 1883dbd8c3ad00fea7b31769943365698e66317a (patch) | |
tree | 745ad29609fe81fd2e6785f1bb903698ab636967 /source/blender | |
parent | cefbe8fe54016d4a16a9ba06c56d6c3c0c3d6024 (diff) |
Fix T48616: Auto-merge selects extra edges
Auto-merge caused all edges between selected vertices to be selected.
This only makes sense in vertex-select-mode.
Correct edge-flag merging code, which now merges flags from multiple edges.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/operators/bmo_removedoubles.c | 21 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 7 |
2 files changed, 11 insertions, 17 deletions
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index a1f40b31fc7..c58b4814726 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -224,22 +224,13 @@ void bmo_weld_verts_exec(BMesh *bm, BMOperator *op) if (v1 == v2) { BMO_elem_flag_enable(bm, e, EDGE_COL); } - else if (!BM_edge_exists(v1, v2)) { - BMEdge *e_new = BM_edge_create(bm, v1, v2, e, BM_CREATE_NOP); - - /* low level selection, not essential but means we can keep - * edge selection valid on auto-merge for example. */ - if ((BM_elem_flag_test(e, BM_ELEM_SELECT) == true) && - (BM_elem_flag_test(e_new, BM_ELEM_SELECT) == false)) - { - BM_elem_flag_disable(e, BM_ELEM_SELECT); - BM_elem_flag_merge_into(e_new, e_new, e); - BM_elem_flag_enable(e_new, BM_ELEM_SELECT); - /* bm->totedgesel remains valid */ - } - else { - BM_elem_flag_merge_into(e_new, e_new, e); + else { + /* always merge flags, even for edges we already created */ + BMEdge *e_new = BM_edge_exists(v1, v2); + if (e_new == NULL) { + e_new = BM_edge_create(bm, v1, v2, e, BM_CREATE_NOP); } + BM_elem_flag_merge(e_new, e); } BMO_elem_flag_enable(bm, e, ELE_DEL); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fa5e86813fa..12cf770d27c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5874,6 +5874,7 @@ static void special_aftertrans_update__mesh(bContext *UNUSED(C), TransInfo *t) BMEditMesh *em = BKE_editmesh_from_object(t->obedit); BMesh *bm = em->bm; char hflag; + bool has_face_sel = (bm->totfacesel != 0); if (t->flag & T_MIRROR) { TransData *td; @@ -5897,8 +5898,10 @@ static void special_aftertrans_update__mesh(bContext *UNUSED(C), TransInfo *t) EDBM_automerge(t->scene, t->obedit, true, hflag); - if ((em->selectmode & SCE_SELECT_VERTEX) == 0) { - EDBM_select_flush(em); + /* Special case, this is needed or faces won't re-select. + * Flush selected edges to faces. */ + if (has_face_sel && (em->selectmode == SCE_SELECT_FACE)) { + EDBM_selectmode_flush_ex(em, SCE_SELECT_EDGE); } } } |