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:
authorGeoffrey Bantle <hairbat@yahoo.com>2006-03-27 09:19:14 +0400
committerGeoffrey Bantle <hairbat@yahoo.com>2006-03-27 09:19:14 +0400
commit7b1d69a35c80cffef4965616731deb68760b6fb2 (patch)
tree17a98ca3c76eeb3f3c790507bcff305520704db7 /source/blender/include/BIF_editmesh.h
parent07b88496e0a1bc1662eb8059c14e1fdf5d7d2584 (diff)
-> Stored Selections
Previously Blender did not store the order in which vertices, edges or faces were selected in edit mode. In many cases it is useful to have this data, however it is not desirable to store every selection made. Now blender stores selections in the order in which they were made in a linked list called 'selected' in EditMesh. EditSelection structs are created whenever 'EM_store_selection' from editmesh_lib.c is called (currently only on user selection with mouse). There are several cases in which they might be deallocated by calling the 'EM_remove_selection' function however: -When the user deselects something with the mouse ('mouse_mesh' in editmesh_mods.c) -When switching selection modes stored selections that are not relevant to the new mode are removed by the 'EM_strip_selections' function (multi-select mode is supported) -When the vertex, edge or face pointed to by a certain stored selection is deallocated -When EM_clear_flag_all is called and where the flag passed to the function contains the 'SELECT' bitmask. -When leaving edit mode (making stored selection data persistent across editing sessions will require modifications to mesh DNA later) Todo: There are a few cases still where you can temporarily end up with a stored selection that points to an element that is no longer selected (edge loop de-select can cause this for instance). The solution to this is to add a call to EM_remove_selection from 'EM_select_edge' and 'EM_select_face' when these functions are being used to deselect elements. For the sake of completeness however this will also require that an 'EM_select_vert' function be coded and called at all appropriate parts of the editmesh code. I will look into this later in the week. For now there are two tools that already take advantage of the stored selections. The first one is 'merge at first or last vertex' in the merge menu (the 'firstvert' and 'lastvert' pointers are gone from EditMesh). The second tool is path select, which builds a path between the last vert selected and the second to last vert selected. This allows you to build complex path selections in a short amount of time like this 'select A, select B, path select. select C, path select. select D...'
Diffstat (limited to 'source/blender/include/BIF_editmesh.h')
-rw-r--r--source/blender/include/BIF_editmesh.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/include/BIF_editmesh.h b/source/blender/include/BIF_editmesh.h
index 1b6fafab1f7..d4741aeb135 100644
--- a/source/blender/include/BIF_editmesh.h
+++ b/source/blender/include/BIF_editmesh.h
@@ -84,6 +84,8 @@ extern void EM_select_flush(void); // vertices to edges/faces (exception!)
extern void EM_selectmode_set(void); // when mode changes
extern void EM_selectmode_flush(void); // when selection changes
extern void EM_convertsel(short oldmode, short selectmode);
+extern void EM_remove_selection(void *data, int type);
+extern void EM_store_selection(void *data, int type);
extern int EM_nfaces_selected(void);
extern int EM_nvertices_selected(void);