Commit: 331de028ef7dcebb63dd09345b311942d6e22f62
Author: Germano Cavalcante
Date:   Tue Sep 20 17:29:33 2022 -0300
Branches: blender-v3.3-release
https://developer.blender.org/rB331de028ef7dcebb63dd09345b311942d6e22f62

Fix T101220: UV proportional editing not working correctly with UV Sync 
Selection

Regression introduced in rb2ba1cf4b40fc.

The `MLOOPUV_VERTSEL` flag only indicates UV selection without sync.

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

M       source/blender/editors/transform/transform_convert_mesh_uv.c

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

diff --git a/source/blender/editors/transform/transform_convert_mesh_uv.c 
b/source/blender/editors/transform/transform_convert_mesh_uv.c
index d95bc7b976f..bcd4c2a2b29 100644
--- a/source/blender/editors/transform/transform_convert_mesh_uv.c
+++ b/source/blender/editors/transform/transform_convert_mesh_uv.c
@@ -74,8 +74,12 @@ static void UVsToTransData(const float aspect[2],
 /**
  * \param dists: Store the closest connected distance to selected vertices.
  */
-static void uv_set_connectivity_distance(BMesh *bm, float *dists, const float 
aspect[2])
+static void uv_set_connectivity_distance(const ToolSettings *ts,
+                                         BMesh *bm,
+                                         float *dists,
+                                         const float aspect[2])
 {
+#define TMP_LOOP_SELECT_TAG BM_ELEM_TAG_ALT
   /* Mostly copied from #transform_convert_mesh_connectivity_distance. */
   BLI_LINKSTACK_DECLARE(queue, BMLoop *);
 
@@ -103,13 +107,15 @@ static void uv_set_connectivity_distance(BMesh *bm, float 
*dists, const float as
       float dist;
       MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
-      bool uv_vert_sel = luv->flag & MLOOPUV_VERTSEL;
+      bool uv_vert_sel = uvedit_uv_select_test_ex(ts, l, cd_loop_uv_offset);
 
       if (uv_vert_sel) {
         BLI_LINKSTACK_PUSH(queue, l);
+        BM_elem_flag_enable(l, TMP_LOOP_SELECT_TAG);
         dist = 0.0f;
       }
       else {
+        BM_elem_flag_disable(l, TMP_LOOP_SELECT_TAG);
         dist = FLT_MAX;
       }
 
@@ -164,7 +170,7 @@ static void uv_set_connectivity_distance(BMesh *bm, float 
*dists, const float as
 
         bool other_vert_sel, connected_vert_sel;
 
-        other_vert_sel = luv_other->flag & MLOOPUV_VERTSEL;
+        other_vert_sel = BM_elem_flag_test_bool(l_other, TMP_LOOP_SELECT_TAG);
 
         BM_ITER_ELEM (l_connected, &l_connected_iter, l_other->v, 
BM_LOOPS_OF_VERT) {
           if (l_connected == l_other) {
@@ -176,7 +182,7 @@ static void uv_set_connectivity_distance(BMesh *bm, float 
*dists, const float as
           }
 
           MLoopUV *luv_connected = BM_ELEM_CD_GET_VOID_P(l_connected, 
cd_loop_uv_offset);
-          connected_vert_sel = luv_connected->flag & MLOOPUV_VERTSEL;
+          connected_vert_sel = BM_elem_flag_test_bool(l_connected, 
TMP_LOOP_SELECT_TAG);
 
           /* Check if this loop is connected in UV space.
            * If the uv loops share the same selection state (if not, they are 
not connected as
@@ -232,6 +238,7 @@ static void uv_set_connectivity_distance(BMesh *bm, float 
*dists, const float as
   BLI_LINKSTACK_FREE(queue_next);
 
   MEM_freeN(dists_prev);
+#undef TMP_LOOP_SELECT_TAG
 }
 
 static void createTransUVs(bContext *C, TransInfo *t)
@@ -339,7 +346,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
     if (is_prop_connected) {
       prop_dists = MEM_callocN(em->bm->totloop * sizeof(float), 
"TransObPropDists(UV Editing)");
 
-      uv_set_connectivity_distance(em->bm, prop_dists, t->aspect);
+      uv_set_connectivity_distance(t->settings, em->bm, prop_dists, t->aspect);
     }
 
     BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to