Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

June 27, 2013

automatic colour ramped shader from geometry height

As part of BlenderSciViz it's going to be useful to generate materials automatically.

This is going to be fun. or not.

Given whatever kind of mesh, i want to be able to run a function that checks the mesh data and makes a shader automatically. Let's try some basic stuff first, like add nodes and connect sockets via a script.
  • allow to easily define custom color ramps
  • allow easy floor and ceiling for ramp
  • arrange neatly
  • hide unused sockets
This script places the nodes, and connects them as in the image
As you can imagine, this much repitition is going to get on my nerves. So it will be useful to write a mini node connecting grammar. Something like:

Node links mini grammar (faster link scripting)

This is a simple but effective way to reduce lines of code needed to connect nodes and sockets.