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
Bake-API small cleanup
Code cleanup: replace macro with function to reduce binary size
Change to key modifier should trigger re-evaluation of drag-and-drop

This change is part of a fix for T40435, but will postpone for now.

Original patch by Sergey Sharybin
Tweaks to bevel and crease transform

They were using INPUT_SPRING in a way which didn't allow
it to easily redo the operator because INPUT_SPRING internally
is stored as a ration between old value and new one and crease
and bevel were converting this to value delta.

Now made it special input type INPUT_SPRING_DELTA which is
storing delta of the spring, meaning now values in the redo
panel kind of makes sense -- they mean how much to add/remove
to the crease/bevel weight.

Expect to be no functional changes from interactive transform
POV, just a bit more convenient to use redo panel.
Fix T40489: Curve drawing skipped loose-wire when mixed with solid faces
Fix for dupli's ignoring color in set-scenes

also skip setting wire color drawing depth
Freestyle: Fix for a potential infinite loop in stroke resampling by vertex count.

Changes were made in Stroke::Resample(int) in C++ to prevent a potential infinite loop
caused by an inconsistency between Stroke::_Length and the stroke length computed
based on stroke vertices.  Such a stroke length inconsistency is usually caused by missing
calls of Stroke::UpdateLength() (i.e., API implementation bugs), but also may occur due
to scripting errors in user-defined style modules.  This commit is meant to help script
writters to identify the latter error cases.  Now Stroke.resample(int) may raise a runtime
error to signal an error condition.
OSX 10.10: fix for Blender crashing on fsmenu due icloud in the favorite list but pointer is NULL when not activated
This does not break other OSX versions, just add a check for pathString
Optimize editmode drawing edgees

Was interpolating and setting the color twice per edge.
Now only set the color when needed (can be once per draw),
~2x speedup for edge drawing.