Sync changes with buildbot server
Fix T40447: Creating Rigid Bodies is rejected for meshes without polys.

This check prevents using empty (no faces) meshes as rigid bodies.
While the idea makes sense, it also prevents using modifier-constructed
meshes, where faces are added only by the modifiers.

Further the check is very easy to circumvent, by removing faces after
making the rigid body, or by assigning a different mesh datablock
afterward.

Suggested by Fabian Emmes (@der_fab).
Fix T40459: Gauss table can be NULL when ending the blur node operation,
which must not be passed to MEM_freeN.
Fix T40342 smooth shading flag in dyntopo does not work under MSVC.

Classic case of integer flag AND-ing result passed to boolean and
failing.
Freestyle: Minor fixes.

- Fixed a typo in docstring.
- Replaced int with boolean constants.
- Updated lists of base classes for used-defined unary 0D/1D functions.
Keep active layer when setting up tracking scene

When you hit "setup tracking scene" in MCE, the active layer usually switches
to the layer where the ground has been created, thus he shadow layer.

New objects are created or appended on that layer which means they will be
default be rendered as shadows only. This behaviour requires muscle memory
and is confusing for new users. This patch is changing the behaviour in a
way that the active layer is remembered from before setting up the scene.

Patch by gottfried, thanks!

Reviewers: sebastian_k, sergey

Differential Revision: https://developer.blender.org/D574
Fix possible issues when blender is compiled without Cycles
Improve behavior of Setup Tracking Scene when default nodes exists in the tree
Fix T40457: Subsurf modifier with Freestyle edges

You can't use ORIG index as an index to copy CD from source DM.
Fix compilation error non non-linux architectures
Fix compilation on unofficial 64bit archs
OSX: Set Blender.app and Blenderplayer.app creation and modification date to compiletime, else we would always have the time from checkout here
Disable key-modifier detection when activating windows

Causes issues on X11 for some users
Fix T40448: Blurring bug in the compositor

This commit pretty much reverts all the changes related on tile-ability
of the fast gaussian blur. It's not tilable by definition and would almost
always give you seams on the tile boundaries.

Atmind already met the issue and tried to solve it by increasing some
magic constant, which is pretty much likely simply made it so compositor
switched to full-frame calculation in that particular .blend file.

Fast gaussian is really not a production thing and need to be avoided.
We're to improve speed of normal gaussian blur instead.
Code cleanup: use typedefs for ui handler functions
Correct last commit: workaround for BGE
Fix T39053: Replace mesh actuator does not replace material (only mesh)

The replace mesh actuator was reconverting the mesh data which causes
conflicts with the LoD code. Instead, we just look for an already
converted mesh, which should already be in the scene.
View3d Toolbar: project-paint tools were in options, move into own panel
Bake-API prevent baking for engines that dont support the baking API

In the future we can fallback to the Blender Internal baking.

Review/Suggestions by Campbell Barton
Fix T40476 - Baking multiple selected objects in Cycles final result
depends on last selected object

Reviewers: campbellbarton

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