Fix UV path redo in vert/edge mode master
authorCampbell Barton <ideasman42@gmail.com>
Fri, 10 Jul 2020 03:36:16 +0000 (13:36 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 10 Jul 2020 03:41:51 +0000 (13:41 +1000)
Redo was only working in some situations,
some options were also not being forwarded.

source/blender/editors/uvedit/uvedit_path.c

index 8476592b587ed16183cda4170d1488fd91fb8309..4f0c472158a4534c3ba16b5b93feb31f157249c1 100644 (file)
@@ -69,7 +69,8 @@
 
 #include "bmesh_tools.h"
 
-#define USE_FILL
+/* TODO(campbell): region filling, matching mesh selection. */
+// #define USE_FILL
 
 /* -------------------------------------------------------------------- */
 /** \name Local Utilities
@@ -252,7 +253,8 @@ static void mouse_mesh_uv_shortest_path_vert(Scene *scene,
   };
 
   const struct BMCalcPathUVParams params = {
-      .use_topology_distance = false,
+      .use_topology_distance = op_params->use_topology_distance,
+      .use_step_face = op_params->use_face_step,
       .aspect_y = aspect_y,
       .cd_loop_uv_offset = cd_loop_uv_offset,
   };
@@ -367,7 +369,8 @@ static void mouse_mesh_uv_shortest_path_face(Scene *scene,
   };
 
   const struct BMCalcPathUVParams params = {
-      .use_topology_distance = false,
+      .use_topology_distance = op_params->use_topology_distance,
+      .use_step_face = op_params->use_face_step,
       .aspect_y = aspect_y,
       .cd_loop_uv_offset = cd_loop_uv_offset,
   };
@@ -617,7 +620,7 @@ static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op)
       return OPERATOR_CANCELLED;
     }
   }
-  if (ts->uv_selectmode & UV_SELECT_EDGE) {
+  else if (ts->uv_selectmode & UV_SELECT_EDGE) {
     if (index < 0 || index >= bm->totloop) {
       return OPERATOR_CANCELLED;
     }