84 {0,
nullptr, 0,
nullptr,
nullptr},
92 "The edge flag to tag when selecting the shortest path");
98 "Traverse connected faces (includes diagonals and edge-rings)");
100 "use_topology_distance",
103 "Find the minimum number of steps, ignoring spatial distance");
108 "Select all paths between the source/destination elements");
142 if (
STREQ(prop_id,
"edge_mode")) {
208 bool is_path_ordered =
false;
210 if (v_act && (v_act != v_dst)) {
216 is_path_ordered =
true;
230 BMVert *v_dst_last = v_dst;
243 }
while ((node = node->next));
248 if ((is_path_ordered ==
false) ||
252 if (is_path_ordered) {
253 v_dst_last =
static_cast<BMVert *
>(node->link);
256 }
while ((
void)depth++, (node = node->next));
278 params.calc_looptris =
false;
279 params.calc_normals =
false;
280 params.is_destructive =
false;
347 fed->
flag &= ~FREESTYLE_EDGE_MARK;
360 BMesh *
bm = mesh->runtime->edit_mesh->bm;
413 bool is_path_ordered =
false;
417 if (e_act && (e_act != e_dst)) {
423 is_path_ordered =
true;
437 BMEdge *e_dst_last = e_dst;
450 }
while ((node = node->next));
455 if ((is_path_ordered ==
false) ||
459 if (is_path_ordered) {
460 e_dst_last =
static_cast<BMEdge *
>(node->link);
463 }
while ((
void)depth++, (node = node->next));
499 params.calc_looptris =
false;
500 params.calc_normals =
false;
501 params.is_destructive =
false;
560 bool is_path_ordered =
false;
568 is_path_ordered =
true;
575 if (f_act != f_dst) {
584 BMFace *f_dst_last = f_dst;
597 }
while ((node = node->next));
602 if ((is_path_ordered ==
false) ||
606 if (is_path_ordered) {
607 f_dst_last =
static_cast<BMFace *
>(node->link);
610 }
while ((
void)depth++, (node = node->next));
633 params.calc_looptris =
false;
634 params.calc_normals =
false;
635 params.is_destructive =
false;
718 bool track_active =
true;
733 basact = bases[base_index];
753 BMElem *ele_src, *ele_dst;
763 track_active =
false;
802 BMElem *ele_src, *ele_dst;
825 ot->
name =
"Pick Shortest Path";
826 ot->
idname =
"MESH_OT_shortest_path_pick";
827 ot->
description =
"Select shortest path between two selections";
855 bool found_valid_elements =
false;
860 for (
Object *obedit : objects) {
865 BMElem *ele_src =
nullptr, *ele_dst =
nullptr, *ele;
873 if (ese_src && (ese_dst = ese_src->
prev) && (ese_src->
htype == ese_dst->
htype)) {
874 ele_src = ese_src->
ele;
875 ele_dst = ese_dst->
ele;
879 ele_src = ele_dst =
nullptr;
883 if (ele_src ==
nullptr) {
886 else if (ele_dst ==
nullptr) {
900 if (ele_src ==
nullptr) {
903 else if (ele_dst ==
nullptr) {
917 if (ele_src ==
nullptr) {
920 else if (ele_dst ==
nullptr) {
931 if (ele_src && ele_dst) {
937 found_valid_elements =
true;
941 if (!found_valid_elements) {
943 op->
reports,
RPT_WARNING,
"Path selection requires two matching elements to be selected");
953 ot->
name =
"Select Shortest Path";
954 ot->
idname =
"MESH_OT_shortest_path_select";
955 ot->
description =
"Selected shortest path between two vertices/edges/faces";
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
void * CustomData_bmesh_get(const CustomData *data, void *block, eCustomDataType type)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
blender::Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
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(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
BMEdge * EDBM_edge_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
BMVert * EDBM_vert_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
BMFace * EDBM_face_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
bool EDBM_unified_findnearest(ViewContext *vc, blender::Span< Base * > bases, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
ViewContext em_setup_viewcontext(bContext *C)
void EDBM_selectmode_flush(BMEditMesh *em)
bool EDBM_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params)
bool ED_operator_editmesh_region_view3d(bContext *C)
bool ED_operator_editmesh(bContext *C)
void ED_uvedit_live_unwrap(const Scene *scene, blender::Span< Object * > objects)
float ED_view3d_select_dist_px()
void view3d_operator_needs_opengl(const bContext *C)
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
Read Guarded memory(de)allocation.
#define BM_ELEM_CD_SET_FLOAT(ele, offset, f)
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_test_bool(ele, hflag)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name)
#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.
BMElem * BM_mesh_active_elem_get(BMesh *bm)
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)
#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)
LinkNode * BM_mesh_calc_path_edge(BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const BMCalcPathParams *params, bool(*filter_fn)(BMEdge *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_vert(BMesh *bm, BMVert *v_src, BMVert *v_dst, const BMCalcPathParams *params, bool(*filter_fn)(BMVert *, void *user_data), void *user_data)
LinkNode * BM_mesh_calc_path_face(BMesh *bm, BMFace *f_src, BMFace *f_dst, const BMCalcPathParams *params, bool(*filter_fn)(BMFace *, 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_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_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 BMElem * edbm_elem_find_nearest(ViewContext *vc, const char htype)
static void mouse_mesh_shortest_path_face(Scene *, Object *obedit, const PathSelectParams *op_params, BMFace *f_act, BMFace *f_dst)
static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
static bool verttag_filter_cb(BMVert *v, void *)
static void verttag_set_cb(BMVert *v, bool val, void *user_data_v)
static bool path_select_poll_property(const bContext *C, wmOperator *, const PropertyRNA *prop)
static bool edbm_shortest_path_pick_ex(Scene *scene, Object *obedit, const PathSelectParams *op_params, BMElem *ele_src, BMElem *ele_dst)
static int edbm_shortest_path_pick_exec(bContext *C, wmOperator *op)
static bool facetag_filter_cb(BMFace *f, void *)
static void path_select_params_from_op(wmOperator *op, ToolSettings *ts, PathSelectParams *op_params)
void MESH_OT_shortest_path_select(wmOperatorType *ot)
static void path_select_properties(wmOperatorType *ot)
static void mouse_mesh_shortest_path_vert(Scene *, Object *obedit, const PathSelectParams *op_params, BMVert *v_act, BMVert *v_dst)
static void mouse_mesh_shortest_path_edge(Scene *scene, Object *obedit, const PathSelectParams *op_params, BMEdge *e_act, BMEdge *e_dst)
static bool facetag_test_cb(BMFace *f, void *)
static bool edgetag_filter_cb(BMEdge *e, void *)
static void edgetag_set_cb(BMEdge *e, bool val, void *user_data_v)
static bool verttag_test_cb(BMVert *v, void *)
static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void facetag_set_cb(BMFace *f, bool val, void *user_data_v)
static void edgetag_ensure_cd_flag(Mesh *mesh, const char edge_mode)
void MESH_OT_shortest_path_pick(wmOperatorType *ot)
@ EDGE_MODE_TAG_FREESTYLE
static BMElem * edbm_elem_active_elem_or_face_get(BMesh *bm)
BMElem * EDBM_elem_from_index_any(BMEditMesh *em, uint index)
int EDBM_elem_to_index_any(BMEditMesh *em, BMElem *ele)
void base_activate(bContext *C, Base *base)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
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)
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)
const char * RNA_property_identifier(const PropertyRNA *prop)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const 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, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
struct BMEditSelection * prev
CheckerIntervalParams interval_params
bool use_topology_distance
struct ToolSettings * toolsettings
const PathSelectParams * op_params
bool(* poll_property)(const bContext *C, wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(uint type, void *reference)
void WM_operator_properties_checker_interval_from_op(wmOperator *op, CheckerIntervalParams *op_params)
void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_disable)
bool WM_operator_properties_checker_interval_test(const CheckerIntervalParams *op_params, int depth)