Cycles / Wavelength to RGB node:
* Added a node to convert wavelength (in nanometers, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.

* Code cleanup:
** Moved color functions (xyz and hsv) into dedicated utility files.
** Remove svm_lerp(), use interp() instead. 

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Wavelength

Example render:
http://www.pasteall.org/pic/show.php?id=53202

This is part of my GSoC 2013. (revisions 57322, 57326, 57335 and 57367 from soc-2013-dingto). 

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57368 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #35561: freestyle + read full sample layers = crash.

Now add_freestyle() in pipeline.c takes a second argument to enable/disable
stroke rendering.  When stroke rendering is disabled, the function allocates
data structures but does not perform stroke rendering.  The allocated data
structures (mostly left unpopulated with data elements) are intended to allow
for the Read Full Sample Layers (Shift-R) command in the compositor.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57369 954f8c5b-7b00-dc11-b283-0030488c597c
fix [#35656] Crash on File Browser


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57370 954f8c5b-7b00-dc11-b283-0030488c597c
fix for problem where curve handles in editmode could be obscured by other selected objects (referred to in [#35669])


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57371 954f8c5b-7b00-dc11-b283-0030488c597c
another case that should have been in r57371, also reduce type conversions in compassion.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57372 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for distortion happens when flipping mesh normals

Issue was caused by missing X/Y displacement components
flip when flipping the normals (flipping the normals changes
the tangent space apparently and displacement vectors need
to be modified to correspond to new space).

Reported by Jonathan Williamson in IRC.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57373 954f8c5b-7b00-dc11-b283-0030488c597c
Fix compilation error caused by recent wavelength node commit

Apparently, it's bad idea to rely on compiler to cast NULL
which is (void*)0 to int -- and in fact if i was a compiler
would also generate an error.

Further, couldn't see why we need to pass NULL or 0 th add_node,
argument value is defautl to 0 already.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57374 954f8c5b-7b00-dc11-b283-0030488c597c
Use OpenMP threads in bm_loop_interp_mdisps

Gives approx 2x speedup on my laptop on such operations
as mesh subdivision in edit mode. Desktops with fancier
CPUs could benefit even more.

Thanks Campbell for review!

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57375 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #35704: Simplify on scene with dupli recursion crashes

Couple of issues here:

- User shouldn't be able to run into dupligroup recursion.
  It was checking already when setting a group for dupli.
  Added check to operator which adds object to group.

- It's still possible files with recursion are hanging around,
  so made simplify function robust to such kind of crap.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57376 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #35405: properties editor preview render restarted unnecessarily after F12 render.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57377 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #35251: cycles crash rendering with a particular user preferences configuration.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57378 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #35711: cycles border render issue after recent changes.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57379 954f8c5b-7b00-dc11-b283-0030488c597c
fix [#35574] Export Key Map issue

problem was the keymap failed to import but didnt give any feedback, now it displays error message.


git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57380 954f8c5b-7b00-dc11-b283-0030488c597c
Fix lamp size allowing negative values.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57382 954f8c5b-7b00-dc11-b283-0030488c597c
Fix #35665: more CUDA issues with recent kernel changes, tested on sm_20, sm_21
and sm_30 cards, so hopefully it should all work now.

Also includes some warnings fixes related to nvcc compiler arguments, should make
no difference otherwise.

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