There was some bad recursion introduced recently that caused crashes
when a Material node is the same material as the material itself (e.g.,
if Material.001 has a node with Material.001).
This commit attempt to correct this by keeping track of the material
at the root of the node tree, and doesn't recurse further if it
encounters it again within the nodetree.
Joshua, please review!
- Fixed issues with calculating matte with balance != 0.5
It used to be used concave combination of minimal and maximal
channel values which could be inpredictable.
Use concave combination of two non-major channels sorted
by their index, so such combination would always use the same
coefficients for particular non-major channels.
- Added despill balance slider which defines balance between
non-major channels used for calculating average of two
colors. Difference between average value and pixel value of
major screen channel defines amount of despill. Balance of
0.5 gives the same behavior as it was before this slider
was added.
Main problem was in poly_rotate_plane() (which rotates a ngon to make its normal aligned with Z axis), it did not handled the case where the normal was aligned but opposite to the Z axis (which had the consequence that, as with the T mesh of the given blend, all tested new edges inside face were detected as outside, and vice-versa...).
Additionnaly, I made a mistake in previous Triangulate commit (r48243) in bm_face_goodline, which could allow a few invalid triangles in some specific cases, fixed!
And done a bit of cleanup, as I was at it.
The glViewport used for 2D Filters wasn't quite matching the 3d view. It seems the height and width were both off by one. There may be a deeper bug with the canvas rectangle having slightly wrong dimensions, but this at least fixes the 2D Filters.
There were some crashes discovered in some circumstances of using
color management within the clip editor which ended up some refactoring
of color management cache.
Switch from global movie cache instance to per-image buffer instances
This only means keys for color managed buffers could be much simpier
and that look up would happen much faster in there're lots of frames
cached. Memory limiter stuff is still global for all color management
and in fact it's also shared with movie clip cache .
This allowed to get rid of original image buffer stored in cache
key and allowed to easily remove all display buffers when source
image buffer is being freed. This was main culptrit leading to
crashes.
Additional changes:
- Add option to make moviecache verbose. If DEBUG_MESSAGES is
defined in moviecache.c detailed logs would be printed to the
console.
- Movie caches are now named which helps reading debug messages.
- Improved a bit behavior of cache element removing when buffer
overflows on adding new display buffer and there're frames from
movie clip.