Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-03-01 08:33:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-03-04 19:11:59 +0300
commit5cbd14241f8e1af27e98ce237e442fef1d9d8fcb (patch)
treeaa77087c0a5af152be582da76b3566e25a9f21e9
parentc82e6fe80b1d62d04bd91d3a7ed8c46da40995ab (diff)
Edit Mesh: Edge tag toggle when no active path is found
User request, this matches 2.6x behavior more closely.
-rw-r--r--source/blender/editors/mesh/editmesh_path.c18
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)) {