diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-02-13 13:25:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-02-13 13:25:12 +0300 |
commit | 9ac8c5315e8e7959d9e839cc2e7b89a677cc886f (patch) | |
tree | 3c87d8f5fd77b190774cdd2dd74e404973ce60ee /source/blender/editors/mesh | |
parent | 90f543ba3aa5d6ee3b436a96d648cd190f66f513 (diff) |
Fix #26059: select_vertex_path fails when vertices aren't selected 1 by 1 in gui
Cicrcle and border selection doesn't add entry to EditSelection. Use cycle
through vertices rather than EditSelection stack to find two selected vertices.
No slowdown for case two vertices are selected (use this cycle to clear temporary
flag too), minor slowdown for unsupported selections.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 9e6f8f7f078..090a9aa358f 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5984,7 +5984,6 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditVert *eve, *s, *t; EditEdge *eed; - EditSelection *ese; PathEdge *newpe, *currpe; PathNode *currpn; PathNode *Q; @@ -5995,17 +5994,24 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op) Heap *heap; /*binary heap for sorting pointers to PathNodes based upon a 'cost'*/ s = t = NULL; + for(eve=em->verts.first; eve; eve=eve->next) { + if(eve->f&SELECT) { + if(s == NULL) s= eve; + else if(t == NULL) t= eve; + else { + /* more than two vertices are selected, + show warning message and cancel operator */ + s = t = NULL; + break; + } - ese = ((EditSelection*)em->selected.last); - if(ese && ese->type == EDITVERT && ese->prev && ese->prev->type == EDITVERT) { - t = (EditVert*)ese->data; - s = (EditVert*)ese->prev->data; + } /*need to find out if t is actually reachable by s....*/ - for(eve=em->verts.first; eve; eve=eve->next){ - eve->f1 = 0; - } + eve->f1 = 0; + } + if(s != NULL && t != NULL) { s->f1 = 1; unbalanced = 1; |