Fix T38501: blender crashes right after adding image texture to material
in cycles

Also fix very similar problem in half-float SSE conversion.
Fix T38576: cycles hair not rendering in edit/paint modes.
OSX/scons: fix breakage after clang-openmp commit:
use the svn clang version instead of Apple compiler naming,
this also makes Brecht’s cycles sse/avx conditionals behave right
OSX/scons; Adapt ftemplate-depth=1024 condition to new compiler versioning
OSX/scons: adapt forgotten CCVERSION conditional, sorry
UI: fix own error, dont add slider pad when neither sides align
UI: allow clicking to close menus and popups (but not submenus).
Fix part of T38304: cycles render problem with zero length curve segments.

Now these are removed from the curve.
Add Tabs to Paint Modes

This adds tabs for Tools, Options, and Grease Pencil to Sculpt, Texture Paint, Vertex Paint, and Weight Paint. These tabs and their panel allocations were discussed in T38346.

Close T38346
Cycles: Separation of Indirect and Direct clamping.

Indirect and Direct samples can now be clamped individually. This way we can clamp the indirect samples (fireflies), while keeping the direct highlights.
Example render: http://www.pasteall.org/pic/show.php?id=66586

WARNING: This breaks backwards compatibility. If you had Clamping enabled in an old file, you must re-enable either Direct/Indirect clamping or both again.

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D303
Fix T38537: issue with OS X full screen startup.blend after recent changes.

Also fixed the redrawing while entering and exiting fullscreen, it would show
a distracting white window contents during the animation.
Blender Internal: Modify material property "Cast Buffer Shadows" to affect ray shadows also, and rename it to "Cast Shadows".

This allows us to make materials that don't cast ray shadows.
Turning off this property can reduce the rendering time slightly.

Note: RNA path is changed to "use_cast_shadows" as well. The older
path "use_cast_buffer_shadows" still can be used as its alias, but
it will be removed after updating some addons.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D272
Fix T38557: VSE clips with Alpha Over against a transparent background fail to reflect opacity changes
Bring back stabilization and GP panels to MCE
Fix T38574 uv sculpting cursor could be visible during render preview in
image editor.
Cycles: Clamp Direct now affects the Background too.

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D306
Fix T38553: Crash load new level; array modifier using curve length

Since threaded object update we've disabled in-place
curve evaluation (in cases when applying curve modifier
with target curve non-evaluated yet).

This requires game engine to take care of DAG and object
evaluation (currently it's designed to export only objects
it able to render).

This workaround will make sure that curve_cache for curves
is up-to-date.
Own recent removal of string encoded menus missed render layers/passes
Fix Cycles Light Passes being always enabled, own regression in Clamp commit yesterday.

KernelIntegrator just doesn't have valid data at this point, so we need to go one level deeper.
Fix null-pointer dereference in previous sequencer commit