diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-03-01 08:33:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-03-01 08:49:11 +0300 |
commit | 8f14baae92b950b7cf9532231f31f4dec4b2b7b8 (patch) | |
tree | 0f77b9a12b7bea5e3072d428d0b0c511fbccf871 /source/blender | |
parent | 509270ee613d2e34b8bd6018aca0dc9fe01f0c38 (diff) |
Edit Mesh: Edge tag toggle when no active path is found
User request, this matches 2.6x behavior more closely.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/editmesh_path.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c index 0adf19337e0..53b7e9fb740 100644 --- a/source/blender/editors/mesh/editmesh_path.c +++ b/source/blender/editors/mesh/editmesh_path.c @@ -548,6 +548,7 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE ViewContext vc; BMEditMesh *em; + bool track_active = true; em_setup_viewcontext(C, &vc); copy_v2_v2_int(vc.mval, event->mval); @@ -559,12 +560,25 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE if (!(ele_src = BM_mesh_active_elem_get(em->bm)) || !(ele_dst = edbm_elem_find_nearest(&vc, ele_src->head.htype))) { - return OPERATOR_PASS_THROUGH; + /* special case, toggle edge tags even when we don't have a path */ + if (((em->selectmode & SCE_SELECT_EDGE) && + (vc.scene->toolsettings->edge_mode != EDGE_MODE_SELECT)) && + /* check if we only have a destination edge */ + ((ele_src == NULL) && + (ele_dst = edbm_elem_find_nearest(&vc, BM_EDGE)))) + { + ele_src = ele_dst; + track_active = false; + } + else { + return OPERATOR_PASS_THROUGH; + } } struct PathSelectParams op_params; + path_select_params_from_op(op, &op_params); - op_params.track_active = true; + op_params.track_active = track_active; op_params.edge_mode = vc.scene->toolsettings->edge_mode; if (!edbm_shortest_path_pick_ex(vc.scene, &op_params, ele_src, ele_dst)) { |