83 "Traverse connected faces (includes diagonals and edge-rings)");
85 "use_topology_distance",
88 "Find the minimum number of steps, ignoring spatial distance");
93 "Select all paths between the source/destination elements");
164 const float aspect_y,
185 bool is_path_ordered =
false;
187 if (l_src != l_dst) {
197 is_path_ordered =
true;
202 BMLoop *l_dst_last = l_dst;
218 if ((is_path_ordered ==
false) ||
221 if (is_path_ordered) {
222 l_dst_last =
node->link;
225 }
while ((
void)depth++, (
node =
node->next));
228 flush = all_set ? -1 : 1;
284 const float aspect_y,
305 bool is_path_ordered =
false;
307 if (l_src != l_dst) {
317 is_path_ordered =
true;
322 BMLoop *l_dst_last = l_dst;
338 if ((is_path_ordered ==
false) ||
341 if (is_path_ordered) {
342 l_dst_last =
node->link;
345 }
while ((
void)depth++, (
node =
node->next));
348 flush = all_set ? -1 : 1;
402 const float aspect_y,
423 bool is_path_ordered =
false;
425 if (f_src != f_dst) {
435 is_path_ordered =
true;
440 BMFace *f_dst_last = f_dst;
456 if ((is_path_ordered ==
false) ||
459 if (is_path_ordered) {
460 f_dst_last =
node->link;
463 }
while ((
void)depth++, (
node =
node->next));
466 flush = all_set ? -1 : 1;
539 const bool select = (flush == 1);
595 aspect_y = aspx / aspy;
611 ele_src = (
BMElem *)f_src;
635 ele_src = (
BMElem *)l_src;
638 ele_src = (
BMElem *)l_src;
662 ele_src = (
BMElem *)l_src;
666 if (ele_src ==
NULL || ele_dst ==
NULL) {
671 scene,
depsgraph, obedit, &op_params, ele_src, ele_dst, aspect_y, cd_loop_uv_offset);
706 aspect_y = aspx / aspy;
711 BMElem *ele_src, *ele_dst;
746 scene,
depsgraph, obedit, &op_params, ele_src, ele_dst, aspect_y, cd_loop_uv_offset)) {
758 ot->
name =
"Pick Shortest Path";
759 ot->
idname =
"UV_OT_shortest_path_pick";
760 ot->
description =
"Select shortest path between two selections";
789 bool found_valid_elements =
false;
796 aspect_y = aspx / aspy;
800 uint objects_len = 0;
803 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
804 Object *obedit = objects[ob_index];
813 int ele_array_len = 0;
824 if (ele_array_len == 2) {
825 ele_src = ele_array[0];
826 ele_dst = ele_array[1];
831 if (ele_src && ele_dst) {
836 scene,
depsgraph, obedit, &op_params, ele_src, ele_dst, aspect_y, cd_loop_uv_offset);
838 found_valid_elements =
true;
843 if (!found_valid_elements) {
845 op->
reports,
RPT_WARNING,
"Path selection requires two matching elements to be selected");
855 ot->
name =
"Select Shortest Path";
856 ot->
idname =
"UV_OT_shortest_path_select";
857 ot->
description =
"Selected shortest path between two vertices/edges/faces";
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const struct CustomData *data, int type)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
void BKE_mesh_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode)
@ BKE_MESH_BATCH_DIRTY_UVEDIT_SELECT
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers,...
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
Object is a sort of wrapper for general info.
#define UV_SYNC_SELECTION
bool ED_operator_uvedit_space_image(struct bContext *C)
void ED_uvedit_select_sync_flush(const struct ToolSettings *ts, struct BMEditMesh *em, bool select)
struct BMLoop * ED_uvedit_active_edge_loop_get(struct BMesh *bm)
bool uvedit_uv_select_test(const struct Scene *scene, struct BMLoop *l, int cd_loop_uv_offset)
void ED_uvedit_get_aspect(struct Object *obedit, float *r_aspx, float *r_aspy)
void uvedit_face_select_set_with_sticky(const struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa, bool select, bool do_history, int cd_loop_uv_offset)
void ED_uvedit_active_vert_loop_set(struct BMesh *bm, struct BMLoop *l)
struct BMLoop ** ED_uvedit_selected_verts(const struct Scene *scene, struct BMesh *bm, int len_max, int *r_verts_len)
void uvedit_edge_select_set_with_sticky(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, bool select, bool do_history, uint cd_loop_uv_offset)
char ED_uvedit_select_mode_get(const struct Scene *scene)
struct BMLoop * ED_uvedit_active_vert_loop_get(struct BMesh *bm)
bool uvedit_edge_select_test(const struct Scene *scene, struct BMLoop *l, int cd_loop_uv_offset)
void ED_uvedit_active_edge_loop_set(struct BMesh *bm, struct BMLoop *l)
struct BMFace ** ED_uvedit_selected_faces(const struct Scene *scene, struct BMesh *bm, int len_max, int *r_faces_len)
bool uvedit_face_visible_test(const struct Scene *scene, struct BMFace *efa)
void ED_uvedit_selectmode_flush(const struct Scene *scene, struct BMEditMesh *em)
UV Select Mode Flush.
void uvedit_uv_select_set(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, bool select, bool do_history, int cd_loop_uv_offset)
Select UV Vertex.
struct BMLoop ** ED_uvedit_selected_edges(const struct Scene *scene, struct BMesh *bm, int len_max, int *r_edges_len)
Read Guarded memory(de)allocation.
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
#define BM_elem_index_get(ele)
#define BM_ITER_ELEM(ele, iter, data, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMEdge * BM_mesh_active_edge_get(BMesh *bm)
BMVert * BM_mesh_active_vert_get(BMesh *bm)
void BM_mesh_active_face_set(BMesh *bm, BMFace *f)
BMFace * BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
BMFace * BM_face_at_index_find_or_table(BMesh *bm, const int index)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
BMLoop * BM_loop_at_index_find(BMesh *bm, const int index)
LinkNode * BM_mesh_calc_path_uv_region_vert(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, const uint cd_loop_uv_offset, bool(*filter_fn)(BMLoop *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_uv_region_face(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, const uint cd_loop_uv_offset, bool(*filter_fn)(BMFace *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_uv_region_edge(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, const uint cd_loop_uv_offset, bool(*filter_fn)(BMLoop *, void *user_data), void *user_data)
struct LinkNode * BM_mesh_calc_path_uv_vert(BMesh *bm, BMLoop *l_src, BMLoop *l_dst, const struct BMCalcPathUVParams *params, bool(*filter_fn)(BMLoop *, void *), void *user_data)
struct LinkNode * BM_mesh_calc_path_uv_face(BMesh *bm, BMFace *f_src, BMFace *f_dst, const struct BMCalcPathUVParams *params, bool(*filter_fn)(BMFace *, void *), void *user_data)
struct LinkNode * BM_mesh_calc_path_uv_edge(BMesh *bm, BMLoop *l_src, BMLoop *l_dst, const struct BMCalcPathUVParams *params, bool(*filter_fn)(BMLoop *, void *), void *user_data)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
bool BM_loop_uv_share_edge_check(BMLoop *l_a, BMLoop *l_b, const int cd_loop_uv_offset)
const Depsgraph * depsgraph
void(* MEM_freeN)(void *vmemh)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
struct CheckerIntervalParams interval_params
bool use_topology_distance
struct ToolSettings * toolsettings
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
BMLoop * uv_find_nearest_loop_from_vert(struct Scene *scene, struct Object *obedit, struct BMVert *v, const float co[2])
BMLoop * uv_find_nearest_loop_from_edge(struct Scene *scene, struct Object *obedit, struct BMEdge *e, const float co[2])
bool uv_find_nearest_vert(struct Scene *scene, struct Object *obedit, const float co[2], float penalty_dist, struct UvNearestHit *hit)
#define UV_NEAREST_HIT_INIT_MAX(v2d)
bool uv_find_nearest_face(struct Scene *scene, struct Object *obedit, const float co[2], struct UvNearestHit *hit)
bool uv_find_nearest_edge(struct Scene *scene, struct Object *obedit, const float co[2], float penalty, struct UvNearestHit *hit)
static bool facetag_filter_cb(BMFace *f, void *user_data_v)
void UV_OT_shortest_path_pick(wmOperatorType *ot)
static int mouse_mesh_uv_shortest_path_edge(Scene *scene, Object *obedit, const struct PathSelectParams *op_params, BMLoop *l_src, BMLoop *l_dst, const float aspect_y, const int cd_loop_uv_offset)
static bool facetag_test_cb(BMFace *f, void *user_data_v)
static bool edgetag_test_cb(BMLoop *l, void *user_data_v)
static bool verttag_test_cb(BMLoop *l, void *user_data_v)
static bool edgetag_filter_cb(BMLoop *l, void *user_data_v)
static bool uv_shortest_path_pick_ex(Scene *scene, Depsgraph *depsgraph, Object *obedit, const struct PathSelectParams *op_params, BMElem *ele_src, BMElem *ele_dst, const float aspect_y, const int cd_loop_uv_offset)
static void verttag_set_cb(BMLoop *l, bool val, void *user_data_v)
static void path_select_properties(wmOperatorType *ot)
static int uv_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void UV_OT_shortest_path_select(wmOperatorType *ot)
static int mouse_mesh_uv_shortest_path_vert(Scene *scene, Object *obedit, const struct PathSelectParams *op_params, BMLoop *l_src, BMLoop *l_dst, const float aspect_y, const int cd_loop_uv_offset)
static void path_select_params_from_op(wmOperator *op, struct PathSelectParams *op_params)
static int uv_shortest_path_select_exec(bContext *C, wmOperator *op)
static int mouse_mesh_uv_shortest_path_face(Scene *scene, Object *obedit, const struct PathSelectParams *op_params, BMFace *f_src, BMFace *f_dst, const float aspect_y, const int cd_loop_uv_offset)
static void facetag_set_cb(BMFace *f, bool val, void *user_data_v)
static void edgetag_set_cb(BMLoop *l, bool val, void *user_data_v)
static bool verttag_filter_cb(BMLoop *l, void *user_data_v)
static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)
bool WM_operator_properties_checker_interval_test(const struct CheckerIntervalParams *op_params, int depth)
void WM_operator_properties_checker_interval_from_op(struct wmOperator *op, struct CheckerIntervalParams *op_params)
void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_disable)