diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-12-22 13:42:55 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-01-05 12:26:23 +0300 |
commit | c0a8dd943f3de2b1c4bdb86790714946fd9c8976 (patch) | |
tree | 5aece29e8f0a4c3fa3654a556d5f8df77c97409e /source/blender/editors | |
parent | dc4014c6763e1e1fb21a5bbe3ec063166ad2ec80 (diff) |
Fix T84018: bulk selection (box, circle, lasso) - unwarranted selection
of islands in vertex mode if "UV Sync Selection" is on
Caused by rB72b422c1e101: UV: support select linked with sync-select in
vert/edge modes
If you had island selection mode enabled in the UV editor with UV Sync
Selection off, and switch UV Sync Selection on, then in vertex selection
mode all bulk selection ops (box, circle, lasso) will be selecting whole
islands.
Prior to culprit commit, for sync selection ON plus island selection ON,
BM_uv_vert_map_create would always return a NULL vmap (it was called
with `use_select` = True, no faces tagged selected). After said commit,
for sync selection ON plus island selection ON, BM_uv_vert_map_create
would return a valid vmap (it is now called with `use_select` = False,
no faces tagged selected - but if `use_select` is False, all UVs will be
added here).
If I am not mistaken, it is never wanted to actually select islands with
box/lasso/circle when sync selection is turned ON [after all you dont
have the UI for it showing], so solution is now to check for this
earlier and not even call uv_select_linked_multi in those cases. (Maybe
in the future this can be unified and we dont need separate selection
modes fo UV and 3D?)
Maniphest Tasks: T84018
Differential Revision: https://developer.blender.org/D9917
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_select.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index 499260127da..bfb01cb073e 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -2878,6 +2878,8 @@ static int uv_box_select_exec(bContext *C, wmOperator *op) const bool use_edge = ((ts->uv_flag & UV_SYNC_SELECTION) ? (ts->selectmode == SCE_SELECT_EDGE) : (ts->uv_selectmode == UV_SELECT_EDGE)); + const bool use_select_linked = !(ts->uv_flag & UV_SYNC_SELECTION) && + (ts->uv_selectmode == UV_SELECT_ISLAND); /* get rectangle from operator */ WM_operator_properties_border_to_rctf(op, &rectf); @@ -2981,7 +2983,7 @@ static int uv_box_select_exec(bContext *C, wmOperator *op) } } } - if (has_selected && ts->uv_selectmode == UV_SELECT_ISLAND) { + if (has_selected && use_select_linked) { UvNearestHit hit = { .ob = obedit, .efa = efa, @@ -3089,6 +3091,8 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) const bool use_edge = ((ts->uv_flag & UV_SYNC_SELECTION) ? (ts->selectmode == SCE_SELECT_EDGE) : (ts->uv_selectmode == UV_SELECT_EDGE)); + const bool use_select_linked = !(ts->uv_flag & UV_SYNC_SELECTION) && + (ts->uv_selectmode == UV_SELECT_ISLAND); /* get operator properties */ x = RNA_int_get(op->ptr, "x"); @@ -3188,7 +3192,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) } } } - if (has_selected && ts->uv_selectmode == UV_SELECT_ISLAND) { + if (has_selected && use_select_linked) { UvNearestHit hit = { .ob = obedit, .efa = efa, @@ -3276,6 +3280,8 @@ static bool do_lasso_select_mesh_uv(bContext *C, const bool use_edge = ((ts->uv_flag & UV_SYNC_SELECTION) ? (ts->selectmode == SCE_SELECT_EDGE) : (ts->uv_selectmode == UV_SELECT_EDGE)); + const bool use_select_linked = !(ts->uv_flag & UV_SYNC_SELECTION) && + (ts->uv_selectmode == UV_SELECT_ISLAND); const bool select = (sel_op != SEL_OP_SUB); const bool use_pre_deselect = SEL_OP_USE_PRE_DESELECT(sel_op); @@ -3370,7 +3376,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, } } } - if (has_selected && ts->uv_selectmode == UV_SELECT_ISLAND) { + if (has_selected && use_select_linked) { UvNearestHit hit = { .ob = obedit, .efa = efa, |