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));
277 params.calc_looptris =
false;
278 params.calc_normals =
false;
279 params.is_destructive =
false;
402 bool is_path_ordered =
false;
406 if (e_act && (e_act != e_dst)) {
412 is_path_ordered =
true;
426 BMEdge *e_dst_last = e_dst;
439 }
while ((node = node->
next));
444 if ((is_path_ordered ==
false) ||
448 if (is_path_ordered) {
449 e_dst_last =
static_cast<BMEdge *
>(node->
link);
452 }
while ((
void)depth++, (node = node->
next));
489 params.calc_looptris =
false;
490 params.calc_normals =
false;
491 params.is_destructive =
false;
550 bool is_path_ordered =
false;
558 is_path_ordered =
true;
565 if (f_act != f_dst) {
574 BMFace *f_dst_last = f_dst;
587 }
while ((node = node->
next));
592 if ((is_path_ordered ==
false) ||
596 if (is_path_ordered) {
597 f_dst_last =
static_cast<BMFace *
>(node->
link);
600 }
while ((
void)depth++, (node = node->
next));
627 params.calc_looptris =
false;
628 params.calc_normals =
false;
629 params.is_destructive =
false;
714 bool track_active =
true;
729 basact = bases[base_index];
750 BMElem *ele_src, *ele_dst;
760 track_active =
false;
795 if (index < 0 || index >= (
bm->totvert +
bm->totedge +
bm->totface)) {
799 BMElem *ele_src, *ele_dst;
822 ot->name =
"Pick Shortest Path";
823 ot->idname =
"MESH_OT_shortest_path_pick";
824 ot->description =
"Select shortest path between two selections";
839 prop =
RNA_def_int(
ot->srna,
"index", -1, -1, INT_MAX,
"",
"", 0, INT_MAX);
852 bool found_valid_elements =
false;
857 for (
Object *obedit : objects) {
862 BMElem *ele_src =
nullptr, *ele_dst =
nullptr, *ele;
870 if (ese_src && (ese_dst = ese_src->
prev) && (ese_src->
htype == ese_dst->
htype)) {
871 ele_src = ese_src->
ele;
872 ele_dst = ese_dst->
ele;
876 ele_src = ele_dst =
nullptr;
880 if (ele_src ==
nullptr) {
883 else if (ele_dst ==
nullptr) {
897 if (ele_src ==
nullptr) {
900 else if (ele_dst ==
nullptr) {
914 if (ele_src ==
nullptr) {
917 else if (ele_dst ==
nullptr) {
928 if (ele_src && ele_dst) {
934 found_valid_elements =
true;
938 if (!found_valid_elements) {
940 op->
reports,
RPT_WARNING,
"Path selection requires two matching elements to be selected");
950 ot->name =
"Select Shortest Path";
951 ot->idname =
"MESH_OT_shortest_path_select";
952 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)
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)
bool EDBM_uvselect_clear(BMEditMesh *em)
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_GET_BOOL(ele, offset)
#define BM_ELEM_CD_SET_FLOAT(ele, offset, f)
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_ELEM_CD_SET_BOOL(ele, offset, f)
#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)
#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)
static void mouse_mesh_shortest_path_face(Scene *, Object *obedit, const PathSelectParams *op_params, BMFace *f_act, BMFace *f_dst)
@ EDGE_MODE_TAG_FREESTYLE
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)