diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-30 12:43:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-30 12:43:22 +0400 |
commit | 477c924f50c4dffcbf358fb8de63ec28dc35cbf1 (patch) | |
tree | 0acbd5879d204a4f12bf1fcbd28616c3296ebb01 /source/blender/editors/mesh/editmesh_mods.c | |
parent | 648f40f409f1f3fd351a9baa3d0a9f29c4033cf1 (diff) |
bugfix [#20038] Vertex path selection not working in Vertex/Face mode
- disable this tool if edge mode isnt enabled using its poll function. Also fixed a bug where it would de-select the last active edge.
- made view3d grid drawing use GL_LINES's for less context switching.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mods.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mods.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 4bea6488adb..f952820c1f0 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -2150,7 +2150,7 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2]) if(ese && ese->type == EDITEDGE) { eed_act = (EditEdge*)ese->data; if (eed_act != eed) { - if (edgetag_shortest_path(vc.scene, em, eed_act, eed)) { + if (edgetag_shortest_path(vc.scene, em, eed_act, eed)) { /* <- this is where the magic happens */ EM_remove_selection(em, eed_act, EDITEDGE); path = 1; } @@ -2163,13 +2163,19 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2]) } /* even if this is selected it may not be in the selection list */ - if(edgetag_context_check(vc.scene, eed)==EDGE_MODE_SELECT) + if(edgetag_context_check(vc.scene, eed)==0) { EM_remove_selection(em, eed, EDITEDGE); + } else { /* other modes need to keep the last edge tagged */ - if(eed_act) - EM_select_edge(eed_act, 0); + if(eed_act) { + if(vc.scene->toolsettings->edge_mode!=EDGE_MODE_SELECT) { + /* for non-select modes, always de-select the previous active edge */ + EM_select_edge(eed_act, 0); + } + } + /* set the new edge active */ EM_select_edge(eed, 1); EM_store_selection(em, eed, EDITEDGE); } @@ -2208,6 +2214,16 @@ static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *op, wmEvent return OPERATOR_FINISHED; } + +static int mesh_shortest_path_select_poll(bContext *C) +{ + if(ED_operator_editmesh_view3d(C)) { + Object *obedit= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh(obedit->data); + return (em->selectmode & SCE_SELECT_EDGE); + } + return 0; +} void MESH_OT_select_shortest_path(wmOperatorType *ot) { @@ -2218,7 +2234,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot) /* api callbacks */ ot->invoke= mesh_shortest_path_select_invoke; - ot->poll= ED_operator_editmesh_view3d; + ot->poll= mesh_shortest_path_select_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; |