82 {0,
nullptr, 0,
nullptr,
nullptr},
90 "The edge flag to tag when selecting the shortest path");
96 "Traverse connected faces (includes diagonals and edge-rings)");
98 "use_topology_distance",
101 "Find the minimum number of steps, ignoring spatial distance");
106 "Select all paths between the source/destination elements");
140 if (
STREQ(prop_id,
"edge_mode")) {
206 bool is_path_ordered =
false;
208 if (v_act && (v_act != v_dst)) {
214 is_path_ordered =
true;
228 BMVert *v_dst_last = v_dst;
241 }
while ((node = node->
next));
246 if ((is_path_ordered ==
false) ||
250 if (is_path_ordered) {
251 v_dst_last =
static_cast<BMVert *
>(node->
link);
254 }
while ((
void)depth++, (node = node->
next));
276 params.calc_looptris =
false;
277 params.calc_normals =
false;
278 params.is_destructive =
false;
411 bool is_path_ordered =
false;
415 if (e_act && (e_act != e_dst)) {
421 is_path_ordered =
true;
435 BMEdge *e_dst_last = e_dst;
448 }
while ((node = node->
next));
453 if ((is_path_ordered ==
false) ||
457 if (is_path_ordered) {
458 e_dst_last =
static_cast<BMEdge *
>(node->
link);
461 }
while ((
void)depth++, (node = node->
next));
497 params.calc_looptris =
false;
498 params.calc_normals =
false;
499 params.is_destructive =
false;
558 bool is_path_ordered =
false;
566 is_path_ordered =
true;
573 if (f_act != f_dst) {
582 BMFace *f_dst_last = f_dst;
595 }
while ((node = node->
next));
600 if ((is_path_ordered ==
false) ||
604 if (is_path_ordered) {
605 f_dst_last =
static_cast<BMFace *
>(node->
link);
608 }
while ((
void)depth++, (node = node->
next));
634 params.calc_looptris =
false;
635 params.calc_normals =
false;
636 params.is_destructive =
false;
721 bool track_active =
true;
736 basact = bases[base_index];
757 BMElem *ele_src, *ele_dst;
767 track_active =
false;
802 if (index < 0 || index >= (
bm->totvert +
bm->totedge +
bm->totface)) {
806 BMElem *ele_src, *ele_dst;
829 ot->name =
"Pick Shortest Path";
830 ot->idname =
"MESH_OT_shortest_path_pick";
831 ot->description =
"Select shortest path between two selections";
846 prop =
RNA_def_int(
ot->srna,
"index", -1, -1, INT_MAX,
"",
"", 0, INT_MAX);
859 bool found_valid_elements =
false;
864 for (
Object *obedit : objects) {
869 BMElem *ele_src =
nullptr, *ele_dst =
nullptr, *ele;
877 if (ese_src && (ese_dst = ese_src->
prev) && (ese_src->
htype == ese_dst->
htype)) {
878 ele_src = ese_src->
ele;
879 ele_dst = ese_dst->
ele;
883 ele_src = ele_dst =
nullptr;
887 if (ele_src ==
nullptr) {
890 else if (ele_dst ==
nullptr) {
904 if (ele_src ==
nullptr) {
907 else if (ele_dst ==
nullptr) {
921 if (ele_src ==
nullptr) {
924 else if (ele_dst ==
nullptr) {
935 if (ele_src && ele_dst) {
941 found_valid_elements =
true;
945 if (!found_valid_elements) {
947 op->
reports,
RPT_WARNING,
"Path selection requires two matching elements to be selected");
957 ot->name =
"Select Shortest Path";
958 ot->idname =
"MESH_OT_shortest_path_select";
959 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 ¶ms)
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_gpu(const bContext *C)
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
#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_named(BMesh *bm, CustomData *data, int type, const StringRef name)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
#define BM_ITER_MESH(ele, iter, bm, itype)
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)
@ EDGE_MODE_TAG_FREESTYLE
static void mouse_mesh_shortest_path_face(Scene *, Object *obedit, const PathSelectParams *op_params, BMFace *f_act, BMFace *f_dst)
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 wmOperatorStatus edbm_shortest_path_pick_exec(bContext *C, wmOperator *op)
static bool edbm_shortest_path_pick_ex(Scene *scene, Object *obedit, const PathSelectParams *op_params, BMElem *ele_src, BMElem *ele_dst)
static bool facetag_filter_cb(BMFace *f, void *)
static wmOperatorStatus edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void path_select_params_from_op(wmOperator *op, ToolSettings *ts, PathSelectParams *op_params)
void MESH_OT_shortest_path_select(wmOperatorType *ot)
static wmOperatorStatus edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
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 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)
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)
bool material_active_index_set(Object *ob, int index)
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
MeshRuntimeHandle * runtime
CheckerIntervalParams interval_params
bool use_topology_distance
struct ToolSettings * toolsettings
const PathSelectParams * op_params
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)