diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-13 07:41:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-13 07:41:07 +0400 |
commit | 8c70caf9665217554708318362e8a6c8ffef2906 (patch) | |
tree | e28d39cb6749951f325ab98473173e11ab99c906 /source/blender/editors | |
parent | bdce58a42c3ca63773ce9c6b32189cfe10b27039 (diff) |
fix for UV reveal (wasnt selecting all verts because check for unselected vert was incorrect after selecting the first face).
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 2 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 30 |
2 files changed, 22 insertions, 10 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 9ceb30267d1..43a0cf1c6a4 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4534,7 +4534,7 @@ static int edbm_inset_exec(bContext *C, wmOperator *op) BM_mesh_elem_flag_disable_all(em->bm, BM_VERT | BM_EDGE, BM_ELEM_SELECT, FALSE); BMO_slot_buffer_hflag_disable(em->bm, &bmop, "faceout", BM_FACE, BM_ELEM_SELECT, FALSE); /* so selected faces verts & edges get selected */ - BM_mesh_select_flush_strip(em->bm, BM_VERT | BM_EDGE, BM_FACE); + BM_mesh_select_flush_strip(em->bm, BM_VERT | BM_EDGE, BM_FACE, BM_ELEM_SELECT); } if (!EDBM_op_finish(em, &bmop, op, TRUE)) { diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 96511ed2bac..53826eec758 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3094,6 +3094,9 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) int facemode= sima ? sima->flag & SI_SELACTFACE : 0; int stickymode= sima ? (sima->sticky != SI_STICKY_DISABLE) : 1; + /* note on tagging, selecting faces needs to be delayed so it doesn't select the verts and + * confuse our checks on selected verts. */ + /* call the mesh function if we are in mesh sync sel */ if (ts->uv_flag & UV_SYNC_SELECTION) { EDBM_mesh_reveal(em); @@ -3104,12 +3107,14 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) if (facemode) { if (em->selectmode == SCE_SELECT_FACE) { BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { + BM_elem_flag_disable(efa, BM_ELEM_TAG); if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { - BM_elem_select_set(em->bm, efa, TRUE); BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); luv->flag |= MLOOPUV_VERTSEL; } + /* BM_elem_select_set(em->bm, efa, TRUE); */ + BM_elem_flag_enable(efa, BM_ELEM_TAG); } } } @@ -3117,6 +3122,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) /* enable adjacent faces to have disconnected UV selections if sticky is disabled */ if (!stickymode) { BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { + BM_elem_flag_disable(efa, BM_ELEM_TAG); if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { int totsel=0; BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { @@ -3128,14 +3134,15 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); luv->flag |= MLOOPUV_VERTSEL; } - - BM_elem_select_set(em->bm, efa, TRUE); + /* BM_elem_select_set(em->bm, efa, TRUE); */ + BM_elem_flag_enable(efa, BM_ELEM_TAG); } } } } else { BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { + BM_elem_flag_disable(efa, BM_ELEM_TAG); if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)==0) { @@ -3143,8 +3150,8 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) luv->flag |= MLOOPUV_VERTSEL; } } - - BM_elem_select_set(em->bm, efa, TRUE); + /* BM_elem_select_set(em->bm, efa, TRUE); */ + BM_elem_flag_enable(efa, BM_ELEM_TAG); } } } @@ -3152,18 +3159,20 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) } else if (em->selectmode == SCE_SELECT_FACE) { BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { + BM_elem_flag_disable(efa, BM_ELEM_TAG); if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); luv->flag |= MLOOPUV_VERTSEL; } - - BM_elem_select_set(em->bm, efa, TRUE); + /* BM_elem_select_set(em->bm, efa, TRUE); */ + BM_elem_flag_enable(efa, BM_ELEM_TAG); } } } else { BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { + BM_elem_flag_disable(efa, BM_ELEM_TAG); if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)==0) { @@ -3171,12 +3180,15 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) luv->flag |= MLOOPUV_VERTSEL; } } - - BM_elem_select_set(em->bm, efa, TRUE); + /* BM_elem_select_set(em->bm, efa, TRUE); */ + BM_elem_flag_enable(efa, BM_ELEM_TAG); } } } + /* de-select none, re-select tagged faces */ + BM_mesh_select_flush_strip(em->bm, 0, BM_FACE, BM_ELEM_TAG); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; |