diff options
-rw-r--r-- | source/blender/editors/mesh/editmesh_path.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c index 1f6a48b41b3..cbfb33af937 100644 --- a/source/blender/editors/mesh/editmesh_path.c +++ b/source/blender/editors/mesh/editmesh_path.c @@ -639,6 +639,16 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE em = vc.em; } + /* If nothing is selected, let's select the picked vertex/edge/face. */ + if ((vc.em->bm->totvertsel == 0) && (eve || eed || efa)) { + /* TODO (dfelinto) right now we try to find the closest element twice. + * The ideal is to refactor EDBM_select_pick so it doesn't + * have to pick the nearest vert/edge/face again. + */ + EDBM_select_pick(C, event->mval, true, false, false); + return OPERATOR_FINISHED; + } + BMElem *ele_src, *ele_dst; if (!(ele_src = edbm_elem_active_elem_or_face_get(em->bm)) || !(ele_dst = edbm_elem_find_nearest(&vc, ele_src->head.htype))) |