diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-19 18:28:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-19 18:28:07 +0300 |
commit | 0a69e3b307f05aeab8bd84f69560b4118c9bfaf2 (patch) | |
tree | 2dfeaae34f13c78bfd1594a78637ce31a95aba33 /source/blender/editors/uvedit | |
parent | 92ea28101725631f8ebe6c6cfd37007175f1af03 (diff) |
Option not to select with un-hide
D1518 from @mba105 w/ edits
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index c369068fe05..d69588e91c6 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3761,7 +3761,7 @@ static void UV_OT_hide(wmOperatorType *ot) /****************** reveal operator ******************/ -static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op)) +static int uv_reveal_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); Object *obedit = CTX_data_edit_object(C); @@ -3777,12 +3777,14 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op)) const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); + const bool select = RNA_boolean_get(op->ptr, "select"); + /* 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); + EDBM_mesh_reveal(em, select); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); return OPERATOR_FINISHED; @@ -3794,7 +3796,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op)) if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - luv->flag |= MLOOPUV_VERTSEL; + SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL); } /* BM_face_select_set(em->bm, efa, true); */ BM_elem_flag_enable(efa, BM_ELEM_TAG); @@ -3815,7 +3817,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op)) if (!totsel) { BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - luv->flag |= MLOOPUV_VERTSEL; + SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL); } /* BM_face_select_set(em->bm, efa, true); */ BM_elem_flag_enable(efa, BM_ELEM_TAG); @@ -3830,7 +3832,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op)) BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) == 0) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - luv->flag |= MLOOPUV_VERTSEL; + SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL); } } /* BM_face_select_set(em->bm, efa, true); */ @@ -3846,7 +3848,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op)) if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) { BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - luv->flag |= MLOOPUV_VERTSEL; + SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL); } /* BM_face_select_set(em->bm, efa, true); */ BM_elem_flag_enable(efa, BM_ELEM_TAG); @@ -3860,7 +3862,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op)) BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) == 0) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - luv->flag |= MLOOPUV_VERTSEL; + SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL); } } /* BM_face_select_set(em->bm, efa, true); */ @@ -3888,6 +3890,8 @@ static void UV_OT_reveal(wmOperatorType *ot) /* api callbacks */ ot->exec = uv_reveal_exec; ot->poll = ED_operator_uvedit; + + RNA_def_boolean(ot->srna, "select", true, "Select", ""); } /******************** set 3d cursor operator ********************/ |