Issues was again the ugly hack of swapping last generated tri with original face
we use in BMesh triangulate code - here it could lead in some rare case to have
invalid face pointer in doubles list.
In case two neighbor buttons are very small, their total width (or height) can remain below
max authorized delta, and hence wrong side could be detected as 'common side' for the pair.
This is now fixed by checking both opposite sides at once.
Also, we expect buttons to have some width and height to be considered alignable now!
Took me two days to sort that out, grrrr!
Existing collapse functions were strict regarding the number of verts sharing an edge.
BM_edge_collapse allows any edge to be passed in without first having to manipulate geometry.
This performs a range search on the kdtree, running a callback instead of allocating an array.
Allows the caller to perform extra checks in the case of overlap,
avoids redundant array allocations, since caller can handle matches.
Another fix for a slightly different case from the original report, to give better orientation.
Vertex normals influence on the orientation is now scaled by the alignment with the cut direction.
Also use face normal instead of loop normal which can be unreliable when the corners edges are co-linear.
Aside from some minor cleanup, this commit:
* Fixes checking twice for multiple usage of same vert by a same poly.
* Fixes handling of ME_VERT_TMP_TAG vert flag by that check (there was no guaranty
that flag was cleared for a poly's vertices before we start checking).
The idea is to avoid having roundtrip from byte to float and back to byte buffer
and use render result's byte buffer to store result of sequencer rendering.
This actually matches to what regular render pipeline is doing and this gives
around 2-3 times speedup of sequencer export on a simple scenes.
This is something what IMB_colormanagement_imbuf_for_write() is intended to do.
Gives around 40% speedup in test wile with OpenGL render and about 20% when
rendering simple cube scene animation.
This fixes two issues:
* Normals were not being recalculated correctly when not using optimized
drawing for CDDerivedMesh (Multires actually handles that correctly).
* Loop normals (autosmooth option) were also not being calculated. Doing
this calculation is not desirable, since it can't be done correctly
without a severe performance hit. This is easy to test by doing a
dependency flush on the mesh after each scuplt stroke step. Instead they
are now disabled during sculpting.