Fix scons building in case git is not available.

Not so nice to use try/except here, but simplest solution to avoid failing in case
git commands fail for some reason...
Fix T40727: Renaming nodes did not correctly fix animation paths.
Fix T40567 Crash when returing to object mode from dyntopo.

Returning to object mode reactivates any generative modifiers
and this can lead to a polycount explosion.

For now just improve the warning when entering dyntopo with generative
modifiers. I would like to add the ability spawn options to apply or
remove the modifiers too, however separate undo stack system comes back
with a vengeance here, since it won't allow restoring the application/
also may invalidate all sculpt undo in the undo stack prior to the
application (needs investigation).
Fix cycles "Is Singular Ray" being on for Camera rays, now is off.

This appears to be a wrong interpretation of the OSL docs, and it's more
convenient to have it off.
Fix T40714: cycles not loading CMYK jpeg files correctly.
Fix T40703: cycles viewport smoke not updating when changing frame.
Cycles: improved Beckmann sampling using precomputed data

It turns out that the new Beckmann sampling function doesn't work well with
Quasi Monte Carlo sampling, mainly near normal incidence where it can be worse
than the previous sampler. In the new sampler the random number pattern gets
split in two, warped and overlapped, which hurts the stratification, see the
visualization in the differential revision.

Now we use a precomputed table, which is much better behaved. GGX does not seem
to benefit from using a precomputed table.

Disadvantage is that this table adds 1MB of memory usage and 0.03s startup time
to every render (on my quad core CPU).

Differential Revision: https://developer.blender.org/D614
WM: set circle select minimum radius to 1
Remove unused function
Code cleanup: de-duplicate widget_num_tria, widget_scroll_circle
Code cleanup: style
Editmesh: extruding end-point verts now maintains edge-direction

Resolves T40745, where faces from extruded edges had flipped normals.
Spelling
Apply fix for T40745 to extrude_face_region too
add brush icons from paint branch to make diff more manageable for arcanist
GTest now works without buildinfo
D605: Fixes for proper handling of wchar_t paths in MinGW.

* Fixed different not-in-sync #ifdef blocks for struct stat variants under Windows.

Comments have been left to indicate the portions of BLI_fileops.h and
BLI_fileops_types.h that need to stay in sync.

* Added BLI_wstat() to de-duplicate #ifdef blocks for stat() variants on Windows.

* Fix for opendir() and associate functions in MinGW not working properly with
non-ASCII, MBCS-compatible paths.

MinGW (FREE_WINDOWS) has opendir() and _wopendir(), and only the
latter accepts a path name of wchar_t type. Rather than messing up with
extra #ifdef's here and there, Blender's own implementations of opendir()
and related functions are used to properly support paths with non-ASCII,
MBCS-compatible characters.

Tested with MSVC 2013 Express, MinGW32 (gcc 4.6.2) and MinGW-w64 (gcc 4.7.1).


Differential Revision: https://developer.blender.org/D605

Reviewed By: campbellbarton
Fix T40756 Select Linked by Particle System matches ignores selected
psys.

This is inconsistent with other comparable cases like materials, where
the active slot is used to define matching objects.
Fix compiler error in Cycles Beckmann sampling precomputation: strict
compiler flags don't allow implicit double -> float casting.

Code was added in rB8fbd71e.
Fix T40764: Keyframed Render Layers Don't Work as Intended