[Bf-blender-cvs] [c0a8dd943f3] master: Fix T84018: bulk selection (box, circle, lasso) - unwarranted selection of islands in vertex mode if "UV Sync Selection" is on

Philipp Oeser noreply at git.blender.org
Tue Jan 5 10:35:26 CET 2021


Commit: c0a8dd943f3de2b1c4bdb86790714946fd9c8976
Author: Philipp Oeser
Date:   Tue Dec 22 11:42:55 2020 +0100
Branches: master
https://developer.blender.org/rBc0a8dd943f3de2b1c4bdb86790714946fd9c8976

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

===================================================================

M	source/blender/editors/uvedit/uvedit_select.c

===================================================================

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,



More information about the Bf-blender-cvs mailing list