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
This commit is contained in:
Philipp Oeser 2020-12-22 11:42:55 +01:00
parent dc4014c676
commit c0a8dd943f
Notes: blender-bot 2023-12-22 20:14:11 +01:00
Referenced by issue #84018, UV editor: bulk selection (box, circle, lasso) - unwarranted selection of islands in vertex mode if "UV Sync Selection" is on
1 changed files with 9 additions and 3 deletions

View File

@ -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,