diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-18 01:21:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-18 01:31:08 +0400 |
commit | 13870d51773a7d7799084e77b0700c362ddeb64c (patch) | |
tree | 33a40afb6d7f203f9527d1b2a9acb390dde68a09 /source/blender/editors/mesh/editmesh_path.c | |
parent | 1a4b718582efdfc39e81e86577d5d25a6bed9e98 (diff) |
Fix T38655: Face path select fails with edge/vert select enabled too
Diffstat (limited to 'source/blender/editors/mesh/editmesh_path.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_path.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c index 18db21a8726..3e64c22fa4e 100644 --- a/source/blender/editors/mesh/editmesh_path.c +++ b/source/blender/editors/mesh/editmesh_path.c @@ -449,14 +449,21 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *UNUSED(op), c { ViewContext vc; BMEditMesh *em; + BMElem *ele; - view3d_operator_needs_opengl(C); em_setup_viewcontext(C, &vc); copy_v2_v2_int(vc.mval, event->mval); em = vc.em; - if (em->selectmode & SCE_SELECT_VERTEX) { + ele = BM_mesh_active_elem_get(em->bm); + if (ele == NULL) { + return OPERATOR_PASS_THROUGH; + } + + view3d_operator_needs_opengl(C); + + if ((em->selectmode & SCE_SELECT_VERTEX) && (ele->head.htype == BM_VERT)) { if (mouse_mesh_shortest_path_vert(&vc)) { return OPERATOR_FINISHED; } @@ -464,7 +471,7 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *UNUSED(op), c return OPERATOR_PASS_THROUGH; } } - else if (em->selectmode & SCE_SELECT_EDGE) { + else if ((em->selectmode & SCE_SELECT_EDGE) && (ele->head.htype == BM_EDGE)) { if (mouse_mesh_shortest_path_edge(&vc)) { return OPERATOR_FINISHED; } @@ -472,7 +479,7 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *UNUSED(op), c return OPERATOR_PASS_THROUGH; } } - else if (em->selectmode & SCE_SELECT_FACE) { + else if ((em->selectmode & SCE_SELECT_FACE) && (ele->head.htype == BM_FACE)) { if (mouse_mesh_shortest_path_face(&vc)) { return OPERATOR_FINISHED; } |