code cleanup: c++ - use empty() rather than size(), use prefix operators for non-primitive types - recommended for non primitive types.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50763 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50764 954f8c5b-7b00-dc11-b283-0030488c597c
style cleanup


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50765 954f8c5b-7b00-dc11-b283-0030488c597c
Add smarter tolerance checking in the planar tracker.

The planar tracker uses Ceres for the refinement stage. During
refinement, Ceres iteratively updates the parameters with the
latest best guess. If the change in the parameters falls below a
threshold, Ceres will abort successfully ("converged").

For the case of pure translation tracking, the parameters are
exactly the two pixel shifts (dx, dy), and measuring the change in
these parameters gives a meaningful termination criterion.
However, for all the other parameterizations like affine, where
the parameterization involves affine parameters that have no
physical interpretation, Ceres is left with no way to terminate
the solver early. With the existing code, often many iterations
are run long after Ceres has found a solution sufficiently
accurate for all tracking needs. No one needs tracking with
a quadrillionth of a pixel accuracy; that time is wasted.

This patch extends the existing iteration callback that is passed
in to Ceres to check if the pattern has fallen out of the search
window, to also check if the optimizer has made a tiny step. In
particular, if the maximum shift of any patch corner between two
successful optimizer steps is less than a threshold (currently
0.005 pixels), the track is declared successful and tracking
is terminated.

This leads to dramatic speed increases in some cases, with little
to no loss in track quality. This is especially apparent when
tracking patches with affine or perspective motion models. For
example, on some tracking cases I tried, the iterations Ceres took
went from 50 to 3.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50766 954f8c5b-7b00-dc11-b283-0030488c597c
Fix variable naming in the planar tracker.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50767 954f8c5b-7b00-dc11-b283-0030488c597c
fix [#32604] Loop select broken with Clipped view and wireframe


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50768 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup:
- make view3d project names more consistent.
- remove apply_project_float() its not needed.
- update comments referencing an old function name.
- move doxygen docs into the C file, prefer they are kept here to avoid getting out of sync with code.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50769 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: some redundant assignments in view3d_draw_bgpic()


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50770 954f8c5b-7b00-dc11-b283-0030488c597c
ffmpeg was adding an include `just incase`, without a cmake find module here - just check if the dir exists.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50771 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: cycles now uses system includes for boost/oiio.. etc, so we dont get warnings from system headers.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50772 954f8c5b-7b00-dc11-b283-0030488c597c
add back -Wundef for g++, also correct clang warnings and add -Wunused-macros warning.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50773 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #32603: Multi-Layer EXR files can't be color managed

Issue was caused by completely different way how multi-layer EXRs are loading,
they're bypassing general image buffer loading functions.

Solved by running color space transformation on render result construction
from multi-layer EXR image.

Also fixed issue with wrong display buffer computing for buffers with less
than 4 channels. Issues were:

- Display buffer is always expected to be RGBA
- OpenColorIO can not apply color space transformations on non-{RGB, RGBA}
  pixels.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50774 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #32607: Color picker tool doesn't work properly: always pick black.

Regressions since color picking support from background image.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50775 954f8c5b-7b00-dc11-b283-0030488c597c
Color Management: avoid byte->linear->byte conversion if display colorspace matches image's one

Solves slowdown when re-encoding byte image sequence or movie in sequencer.

Fixes #32605: Blender vse renders take more time to render than before

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50776 954f8c5b-7b00-dc11-b283-0030488c597c
code cleanup: use frame as a prefix for rna properties


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50777 954f8c5b-7b00-dc11-b283-0030488c597c
style cleanup


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50778 954f8c5b-7b00-dc11-b283-0030488c597c
fix [#32602] Bevel operator's transform input is inverted
inset was inverted also


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50779 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #32579: Sequencer crash when changing render dimensions

Memory limitor's queue could be affected when it's being iterated
on enforcing limits -- that's because iteration could free color
managed image buffers.

Fixed by getting least priority element after every element was
freed. Could be optimized a bit, but it anyway shouldn't be so
slow due to specific of cache limiting and limit enforcing finish
condition.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50780 954f8c5b-7b00-dc11-b283-0030488c597c
Make Euclidean resection "always" succeed.

The Euclidean resection code had a magical constant, 1e-3, used to
compare the results of solving an equation. This failure detection
was well-intended, trying to prevent poor solutions from getting
made without notifying the caller. Unfortunately in practice, this
threshold is too conservative. Furthermore, it is not clear the
threshold should exist at all; the purpose of the Euclidean
resection is to come up with the best solution it can; other
methods (e.g. reprojection error) should be used to compare
whether the method succeeded.

This commit changes the Euclidean EPnP code to always succeed,
causing the previous fallback to projective resection to never
run. In most cases, this will result in better reconstructions.

This should, in most cases, fix the dreaded "flipping" problem.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50781 954f8c5b-7b00-dc11-b283-0030488c597c
There was no way to remove mesh data layers from the interface - add a panel that works in object an editmode.
currently can remove sticky/mask/skin vertex layers.

regarding the skin layer - while adding and removing the modifier normally works fine, its not 100% reliable since the mesh may be linked into another scene, or be a linked duplicate and the object with the modifier deleted.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@50782 954f8c5b-7b00-dc11-b283-0030488c597c