88 "The edge flag to tag when selecting the shortest path");
94 "Traverse connected faces (includes diagonals and edge-rings)");
96 "use_topology_distance",
99 "Find the minimum number of steps, ignoring spatial distance");
104 "Select all paths between the source/destination elements");
138 if (
STREQ(prop_id,
"edge_mode")) {
186 bool is_path_ordered =
false;
188 if (v_act && (v_act != v_dst)) {
194 is_path_ordered =
true;
213 BMVert *v_dst_last = v_dst;
231 if ((is_path_ordered ==
false) ||
234 if (is_path_ordered) {
235 v_dst_last =
node->link;
238 }
while ((
void)depth++, (
node =
node->next));
261 .calc_looptri = false,
262 .calc_normals = false,
263 .is_destructive = false,
281 const char edge_mode =
user_data->op_params->edge_mode;
295 #ifdef WITH_FREESTYLE
307 const char edge_mode =
user_data->op_params->edge_mode;
326 #ifdef WITH_FREESTYLE
353 #ifdef WITH_FREESTYLE
379 bool is_path_ordered =
false;
383 if (e_act && (e_act != e_dst)) {
389 is_path_ordered =
true;
408 BMEdge *e_dst_last = e_dst;
426 if ((is_path_ordered ==
false) ||
429 if (is_path_ordered) {
430 e_dst_last =
node->link;
433 }
while ((
void)depth++, (
node =
node->next));
470 .calc_looptri = false,
471 .calc_normals = false,
472 .is_destructive = false,
514 bool is_path_ordered =
false;
522 is_path_ordered =
true;
534 if (f_act != f_dst) {
543 BMFace *f_dst_last = f_dst;
561 if ((is_path_ordered ==
false) ||
564 if (is_path_ordered) {
565 f_dst_last =
node->link;
568 }
while ((
void)depth++, (
node =
node->next));
592 .calc_looptri = false,
593 .calc_normals = false,
594 .is_destructive = false,
678 bool track_active =
true;
692 basact = bases[base_index];
714 BMElem *ele_src, *ele_dst;
760 BMElem *ele_src, *ele_dst;
782 ot->
name =
"Pick Shortest Path";
783 ot->
idname =
"MESH_OT_shortest_path_pick";
784 ot->
description =
"Select shortest path between two selections";
812 bool found_valid_elements =
false;
815 uint objects_len = 0;
818 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
819 Object *obedit = objects[ob_index];
832 if (ese_src && (ese_dst = ese_src->
prev) && (ese_src->
htype == ese_dst->
htype)) {
833 ele_src = ese_src->
ele;
834 ele_dst = ese_dst->
ele;
838 ele_src = ele_dst =
NULL;
842 if (ele_src ==
NULL) {
845 else if (ele_dst ==
NULL) {
859 if (ele_src ==
NULL) {
862 else if (ele_dst ==
NULL) {
876 if (ele_src ==
NULL) {
879 else if (ele_dst ==
NULL) {
890 if (ele_src && ele_dst) {
896 found_valid_elements =
true;
901 if (!found_valid_elements) {
903 op->
reports,
RPT_WARNING,
"Path selection requires two matching elements to be selected");
913 ot->
name =
"Select Shortest Path";
914 ot->
idname =
"MESH_OT_shortest_path_select";
915 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 View3D * CTX_wm_view3d(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer(const struct CustomData *data, int type)
void * CustomData_bmesh_get(const struct CustomData *data, void *block, int type)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
#define BKE_view_layer_array_from_bases_in_edit_mode(view_layer, v3d, r_len)
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
void DEG_id_tag_update(struct ID *id, int flag)
Object is a sort of wrapper for general info.
#define BASACT(_view_layer)
#define SCE_SELECT_VERTEX
struct BMVert * EDBM_vert_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p)
bool EDBM_select_pick(struct bContext *C, const int mval[2], const struct SelectPick_Params *params)
void EDBM_update(struct Mesh *me, const struct EDBMUpdate_Params *params)
struct BMEdge * EDBM_edge_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p)
void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc)
bool EDBM_unified_findnearest(struct ViewContext *vc, struct Base **bases, uint bases_len, int *r_base_index, struct BMVert **r_eve, struct BMEdge **r_eed, struct BMFace **r_efa)
struct BMFace * EDBM_face_find_nearest(struct ViewContext *vc, float *dist_px_manhattan_p)
void EDBM_selectmode_flush(struct BMEditMesh *em)
void ED_object_base_activate(struct bContext *C, struct Base *base)
bool ED_operator_editmesh_region_view3d(struct bContext *C)
bool ED_operator_editmesh(struct bContext *C)
void ED_uvedit_live_unwrap(const struct Scene *scene, struct Object **objects, int objects_len)
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
void view3d_operator_needs_opengl(const struct bContext *C)
float ED_view3d_select_dist_px(void)
Read Guarded memory(de)allocation.
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_test_bool(ele, hflag)
float BM_elem_float_data_get(CustomData *cd, void *element, int type)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
void BM_elem_float_data_set(CustomData *cd, void *element, int type, const float val)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
void BM_mesh_active_face_set(BMesh *bm, BMFace *f)
BMElem * BM_mesh_active_elem_get(BMesh *bm)
#define BM_select_history_store(bm, ele)
#define BM_select_history_remove(bm, ele)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
void BM_mesh_cd_flag_ensure(BMesh *bm, Mesh *mesh, const char cd_flag)
LinkNode * BM_mesh_calc_path_vert(BMesh *bm, BMVert *v_src, BMVert *v_dst, const struct BMCalcPathParams *params, bool(*filter_fn)(BMVert *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_edge(BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const struct BMCalcPathParams *params, bool(*filter_fn)(BMEdge *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_face(BMesh *bm, BMFace *f_src, BMFace *f_dst, const struct BMCalcPathParams *params, bool(*filter_fn)(BMFace *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_region_edge(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, bool(*filter_fn)(BMEdge *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_region_vert(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, bool(*filter_fn)(BMVert *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_region_face(BMesh *bm, BMElem *ele_src, BMElem *ele_dst, bool(*filter_fn)(BMFace *, void *user_data), void *user_data)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static bool edgetag_test_cb(BMEdge *e, void *user_data_v)
static void edgetag_ensure_cd_flag(Mesh *me, const char edge_mode)
static bool path_select_poll_property(const bContext *C, wmOperator *UNUSED(op), const PropertyRNA *prop)
static BMElem * edbm_elem_active_elem_or_face_get(BMesh *bm)
static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
@ EDGE_MODE_TAG_FREESTYLE
static void verttag_set_cb(BMVert *v, bool val, void *user_data_v)
static bool edgetag_filter_cb(BMEdge *e, void *UNUSED(user_data_v))
static int edbm_shortest_path_pick_exec(bContext *C, wmOperator *op)
static bool verttag_test_cb(BMVert *v, void *UNUSED(user_data_v))
static bool facetag_filter_cb(BMFace *f, void *UNUSED(user_data_v))
static void mouse_mesh_shortest_path_vert(Scene *UNUSED(scene), Object *obedit, const struct PathSelectParams *op_params, BMVert *v_act, BMVert *v_dst)
static void mouse_mesh_shortest_path_edge(Scene *scene, Object *obedit, const struct PathSelectParams *op_params, BMEdge *e_act, BMEdge *e_dst)
void MESH_OT_shortest_path_select(wmOperatorType *ot)
static void path_select_params_from_op(wmOperator *op, ToolSettings *ts, struct PathSelectParams *op_params)
static bool edbm_shortest_path_pick_ex(Scene *scene, Object *obedit, const struct PathSelectParams *op_params, BMElem *ele_src, BMElem *ele_dst)
static void path_select_properties(wmOperatorType *ot)
static bool facetag_test_cb(BMFace *f, void *UNUSED(user_data_v))
static BMElem * edbm_elem_find_nearest(ViewContext *vc, const char htype)
static void edgetag_set_cb(BMEdge *e, bool val, void *user_data_v)
static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void mouse_mesh_shortest_path_face(Scene *UNUSED(scene), Object *obedit, const struct PathSelectParams *op_params, BMFace *f_act, BMFace *f_dst)
static bool verttag_filter_cb(BMVert *v, void *UNUSED(user_data_v))
static void facetag_set_cb(BMFace *f, bool val, void *user_data_v)
void MESH_OT_shortest_path_pick(wmOperatorType *ot)
BMElem * EDBM_elem_from_index_any(BMEditMesh *em, uint index)
int EDBM_elem_to_index_any(BMEditMesh *em, BMElem *ele)
void(* MEM_freeN)(void *vmemh)
const char * RNA_property_identifier(const PropertyRNA *prop)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_int_get(PointerRNA *ptr, const char *name)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
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)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct BMEditSelection * prev
struct BMEditMesh * edit_mesh
struct CheckerIntervalParams interval_params
bool use_topology_distance
struct ToolSettings * toolsettings
const struct PathSelectParams * op_params
struct ViewLayer * view_layer
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
bool(* poll_property)(const struct bContext *C, struct wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
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)