diff options
author | Geoffrey Bantle <hairbat@yahoo.com> | 2006-09-28 06:37:35 +0400 |
---|---|---|
committer | Geoffrey Bantle <hairbat@yahoo.com> | 2006-09-28 06:37:35 +0400 |
commit | bd6e5d20c7f4d34709b99576dce9cfa92c95227e (patch) | |
tree | c74b779f954d066480ad240033675bf6ba624a45 /source/blender/src/editmesh_lib.c | |
parent | b4e97c01ff7478cc7fbcbc33d12e37375d28b7aa (diff) |
-> Sanity Check for Selection History
Some operations like edge loop deselect would cause selection history
to become invalid. Added a sanity check to countall() to try and catch
these when they happen.
Diffstat (limited to 'source/blender/src/editmesh_lib.c')
-rw-r--r-- | source/blender/src/editmesh_lib.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index 3234ddb7589..2f742d8e985 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -71,7 +71,7 @@ editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data #include "editmesh.h" -/* ********* Selection ************ */ +/* ********* Selection History ************ */ static int EM_check_selection(void *data) { EditSelection *ese; @@ -105,6 +105,20 @@ void EM_store_selection(void *data, int type) } } +void EM_validate_selections(void) +{ + EditSelection *ese, *nextese; + EditMesh *em = G.editMesh; + ese = em->selected.first; + while(ese){ + nextese = ese->next; + if(ese->type == EDITVERT && !(((EditVert*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese); + else if(ese->type == EDITEDGE && !(((EditEdge*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese); + else if(ese->type == EDITFACE && !(((EditFace*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese); + ese = nextese; + } +} + static void EM_strip_selections(void) { EditSelection *ese, *nextese; |