- was looping over all verts/edges/faces to setup the selection store, even when there was no selection store (mselect), since this is fairly common case, add a check.
also use BLI_array_growitems rather then BLI_array_growone to allocate in larger steps.
Warning! Tesselation uvs or vcol data got out of sync, "had to reset!
This would happen on every editmode edit with UV's and wasn't too reassuring that blender was handling uvs/vcols correctly.
From looking into the problem I found that creating the undo mesh would act as if it was tessellating the existing mesh each time and complain that the data was out of sync, when infact the mesh was just created and being filled in.
Also, allocating uv and vcol customdata arrats for tessfaces isn't needed for undo mesh, so save some memory and dont allocate these in the first place.
- went over every BM_SetIndex call and added comments about its use, if its setting dirty values or correct ones.
- replace loops over all elements _just_ to set index values, with a new function, BM_ElemIndex_Ensure(...), this will eventually only initialize values when they are dirty.
also added a safety check for the crash, even though reverting fixes.
bmesh_to_mesh_exec() could set me->mface array to NULL but leave me->totface when notellelation=1, which is likely to give trouble elsewhere.
This code is from Andrew Wiggen (ender79) and reviewed by me.
His comments:
Implements some tools that were marked TODO:
- select nth
- separate loose parts
And also fixes a few bugs;
- extrude and move on normals causes faces to disappear until the move starts
- hiding verts/edges/faces does not deselect them
- deleting a selection sometimes deletes too much (e.g. a solid cube and a wire cube build of only edges, join them on a single edge, select only the faces of the solid cube and delete, some of the deselected edges from the wire cube were also being deleted)
back in selection history for bmesh->mesh
and mesh->bmesh conversions:
----------------------------------------------
Select Vertex Path had wrong invoke callback
(shouldn't have any?).
Also selection history was not converted when
doing bmesh->mesh or mesh->bmesh conversions.
This meant that tabbing in and out of editmode
would make your selection history dissapear.
Undo pop would also not preserve selection
history so any operators that relied on it
would not work when you adjusted their settings.