Blender Git Loki
Git Commits -> Revision 7b1d69a
Revision 7b1d69a by Geoffrey Bantle (master) March 27, 2006, 05:19 (GMT) |
-> 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...' |
Commit Details:
Full Hash: 7b1d69a35c80cffef4965616731deb68760b6fb2
SVN Revision: 7132
Parent Commit: 07b8849
Lines Changed: +186, -85
7 Modified Paths:
/source/blender/blenlib/BLI_editVert.h (+15, -4) (Diff)
/source/blender/include/BIF_editmesh.h (+2, -0) (Diff)
/source/blender/src/edit.c (+8, -13) (Diff)
/source/blender/src/editmesh.c (+63, -49) (Diff)
/source/blender/src/editmesh_lib.c (+70, -2) (Diff)
/source/blender/src/editmesh_mods.c (+9, -3) (Diff)
/source/blender/src/editmesh_tools.c (+19, -14) (Diff)
/source/blender/include/BIF_editmesh.h (+2, -0) (Diff)
/source/blender/src/edit.c (+8, -13) (Diff)
/source/blender/src/editmesh.c (+63, -49) (Diff)
/source/blender/src/editmesh_lib.c (+70, -2) (Diff)
/source/blender/src/editmesh_mods.c (+9, -3) (Diff)
/source/blender/src/editmesh_tools.c (+19, -14) (Diff)