save memory during render and cache render results.
Implementation notes:
In the render engine API it's now possible to get the render result for
one render layer only, and retrieve the expected tile size in case save
buffers is used. This is needed because EXR expects tiles with particular
size and coordinates.
The EXR temporary files are now also separated per layer, since Cycles
can't give the full render result for all render layers, and EXR doesn't
support writing parts of tiles.
In Cycles internally the handling of render buffers and multi GPU
rendering in particular changed quite a bit, and could use a bit more
refactoring to make things more consistent and simple.
The 2D Filter system now only copies the game viewport instead of the whole window. This prevents 2D Filters from grabbing data outside of the game viewport. The textures for 2D filters are now also not forced to be powers of two (if NPOT textures are supported), which can save a little bit of VRAM.
Added back face validation to BKE_mesh_validate_arrays.
This is needed because some addons (like OBJ importer) are reading
tessfaces and then converting them to ngons and validation of tessfaces
is needed before such a conversion.
Validation of faces would happen only if there's no polys in mesh.
Snapping actually was working already, but grid spacing was set to 1.0, which is basically pixel size in the node editor. Increased this to 1x grid step for fine snapping and 5x grid step for rough snapping.
Grid drawing in node editor now draws 2 levels in slightly different shades to indicate the different snapping modes better.
Node editor also supports the general use_snap tool setting to enable automatic snapping during transform. For now only the incremental snapping is supported, in future could be extended to enable alignment between nodes in a number of ways.
the idea of using methods instead of attributes is to avoid users abusing of the system calls.
Thanks Campbell Barton for reviewing and small corrections
- Cleaned up some files -- seems there were some wrongly resolved
conflicts which resulted into duplicated code in space_image.py
and some build configuration files.
- Store all color space related data (such as display device, view
transform and so) as strings, so it could easily be ported to new
OCIO configuration files and it'll be much more portable between
different configurations.
This required adding some look-ups to RNA associated with such
settings, but it's indeed the only way to do this. If it'll be
figured out such look-ups causes performance issues it's possible
to optimize this further using hash. So far it's only few elements
in list to be looked up.
- Added support of display device transformation from OCIO
configuration files. Display device is setting per-window and
different windows could have different display devices, so it's
possible to have one blender window opened on sRGB monitor and
another one on xyz projector.
Display device is ignored when using ACES ODT Tonecurve view
transform due to it's not an OCIO transformation. Probably it'll
be possible to get rid of this tone curve soon (if it'll be
proved useless or it'll be implemented as a part of OCIO LUT).
- Movie Cache now supports deleter functions for user keys, so
such keys could have some allocated data which would be removed
as soon as element in cache is being removed.
- Movie Cache now support callbacks to check whether current
cache element could be removed from a cache due to it wouldn't
be accessed anymore.
- Re-written cache stuff for display buffers of ImBuf. Now it's
using Movie Cache which is global for all ImBufs.
Probably it's not implemented in fastest way, would be investigated
further and probably changed it performance wouldn't be good enough.
Issue is that all loops of a face adjacent to the sliding verts were
getting project-corrected. Introduced a test to only project the
affected loops.
The projection code introduces a small offset to the boundaries so that
any boundary tests can work as expected, but this leads to shrinking of
the barycentric coordinates of the projection, causing a shrink of the
uvs in turn. This even affects the uvs that -should- be affected though
the unfixed behavior works strangely in a correctish way (my guess is
because the projection uses the same face as the opposite sliding loop).
I fixed the behaviour by taking the mean value of the uvs. This won't
support seams but current code doesn't either. Also, all CustomData to
exhibit this unfixed behaviour. I only fixed the uv case, other data
(Vcolors, etc) will have discontinuities when edge sliding. I expect
that the CorrectUV code I am working on may address some of these
issues.
Also, added NULL checks for utility function (was intended for this bug
but wasn't needed after all)
Vector.dot() was always leaking memory, and would crash if args sizes didnt match.
These errors were introduced with n-dimensional vector support.
also fixed an error with bmesh py api allocation.
Issue was caused by loading editNurb into normal nurbs when saving,
this used to set active nurb to NULL.
This isn't actually needed, because active nurb would be set properly
on making editNurb and even if one accessed to active spline via PY API
when object is in object it'll be completely harmless.
When creating tile data include only triangles which have got intersection
with tile's rectangle only. This saves quite a lot of per-pixel iterations
through triangles which simply can not affect on current tile.
In fact, it's AABB check is used here. It could be improved further, but
it'll slowdown tile data generation with questionable speedup.
Another major slowdown is in fact caused by voronoi triangulation code.
Currently it's used naive algorithm which is O(N^2) where N is number
of edges. Added few euristics there and removed unused part of code, which
gave quite noticeable speedup already.
This could be improved further, but this node is not ment to be used for
lots of markers. It's also generates wrong triangulation when there're
many sites used. Need to be investigated further.
switch channel
This was caused by a typo, which would end up toggling the expanded status of
the Grease Pencil datablock (gpd->flag & 4) instead of the layer active status
(gpl->flag & 4).