[Bf-blender-cvs] [752c840f1e3] soc-2021-uv-editor-improvements-edge-selection: Cleanup and fix: UV Invert selection

Siddhartha Jejurkar noreply at git.blender.org
Sun Aug 8 09:33:09 CEST 2021


Commit: 752c840f1e3423a62f611e07f6f63b4d6d125036
Author: Siddhartha Jejurkar
Date:   Sat Aug 7 23:39:29 2021 +0530
Branches: soc-2021-uv-editor-improvements-edge-selection
https://developer.blender.org/rB752c840f1e3423a62f611e07f6f63b4d6d125036

Cleanup and fix: UV Invert selection

* Code and comment cleanup
* Fix: Make invert selection respect sticky modes when using edge select
  mode

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

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 964ea5ac0d5..2ba64bb7961 100644
--- a/source/blender/editors/uvedit/uvedit_select.c
+++ b/source/blender/editors/uvedit/uvedit_select.c
@@ -2328,37 +2328,28 @@ static void uv_select_all_perform(Scene *scene, SpaceImage *sima, Object *obedit
           luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
           switch (ts->uv_selectmode) {
-            /* Invert MLOOPUV_EDGESEL flag for all uv elements if in edge selection mode.
-             * This will mark all edges that need to be selected */
-            case UV_SELECT_EDGE: {
-              luv->flag ^= MLOOPUV_EDGESEL;
-              luv->flag &= ~MLOOPUV_VERTSEL;
-              break;
-            }
+            /* Invert MLOOPUV_EDGESEL flag state for all uv elements if in edge/face selection
+             * mode. This will mark all edges that need to be selected */
+            case UV_SELECT_EDGE:
             case UV_SELECT_FACE: {
               luv->flag ^= MLOOPUV_EDGESEL;
               luv->flag &= ~MLOOPUV_VERTSEL;
               break;
             }
-            /* Invert MLOOPUV_VERTSEL flag for all uv elements if in vertex selection mode
-             * This will mark all vertices that need to be selected */
+            /* Invert MLOOPUV_VERTSEL flag state for all uv elements if in vertex/island selection
+             * mode This will mark all vertices that need to be selected */
             case UV_SELECT_VERTEX:
-            case UV_SELECT_ISLAND:
-            /* TEMPORARY: Fallback to vertex selection mode logic */
+            case UV_SELECT_ISLAND: /* Fallback to vertex selection mode logic */
             default: {
-              /* Fallback */
               luv->flag ^= MLOOPUV_VERTSEL;
               break;
             }
           }
         }
       }
-      /* Now, Flush selection flags based on UV selection mode */
+      /* Flush based on selection flags and current UV selection mode */
       switch (ts->uv_selectmode) {
-        case UV_SELECT_EDGE: {
-          uv_flush_edge_to_vert(scene, obedit, cd_loop_uv_offset);
-          break;
-        }
+        case UV_SELECT_EDGE:
         case UV_SELECT_FACE: {
           if (sima->sticky == SI_STICKY_DISABLE) {
             uv_flush_edge_to_vert(scene, obedit, cd_loop_uv_offset);
@@ -2369,8 +2360,7 @@ static void uv_select_all_perform(Scene *scene, SpaceImage *sima, Object *obedit
           break;
         }
         case UV_SELECT_VERTEX:
-        case UV_SELECT_ISLAND:
-        /* TEMPORARY: Fallback to vertex selection mode logic */
+        case UV_SELECT_ISLAND: /* Fallback to vertex selection mode logic */
         default: {
           uv_flush_vert_to_edge(scene, obedit, cd_loop_uv_offset);
           break;



More information about the Bf-blender-cvs mailing list