Ok, I've done some experiments and found that the main problem I'm having is, that there isn't an easy way to feed a single material/shader with animated values from the individual objects. There are some approaches which are not developed far enough though. Just as an instance:
https://developer.blender.org/D2057
(early stage with bugs)
Use custom properties (variable values) in the node editor
(changes the property for all objects that own the material)
And I really would prefer to do the syncing within Blender itself. So you can actually divide this into two problems: 1st you need to somehow send color information to the shader. And there are some ways depending on what rendering engine is used.
For Blender Render that would be the objects color (can be found in the objects properties). You can then choose to use the "object color" within the options section of the material properties.
Now if you use Cycles that options falls away. As a slightly more complex and probably less performant solution, vertex colors can be used.
And as Jerryno suggested using an animated texture is also a great way to do complex lighting animations.
Secondly we need to animate the colors, and for that drivers would be the easiest, but least dynamic way. For a little more dynamic, scripted drivers can be written in python, which honestly helped me a lot. But for the maximum control you can write a handler for blender's handler functions.
This is just a little test script which messes around with an objects color and vertex colors:
import bpy
import math
def distance(va, vb):
return math.sqrt( (va[0]-vb[0])**2 + (va[1]-vb[1])**2 + (va[2]-vb[2])**2 )
def MyHandler(v):
sphere = bpy.data.objects['Sphere']
sloc = sphere.location
sphere.color[0] = 0.4;
for a in bpy.data.groups['Lichterkette'].objects:
aloc = a.location
d = 2**(-distance(aloc, sloc) * 1) * 5
# Color the object
c = a.color
c[0] = d * 1.0
c[1] = d * 0.5
c[2] = d * 0.05
# Color the vertices
if hasattr(a.data.vertex_colors, 'Col'):
col = a.data.vertex_colors['Col']
for poly in a.data.polygons:
for idx in poly.loop_indices:
b.color[0] = d * 1.0
b.color[1] = d * 0.5
b.color[2] = d * 0.0
bpy.app.handlers.frame_change_pre.append(MyHandler)
#bpy.app.handlers.scene_update_pre.append(MyHandler)
For a reference of blender handler functions see
https://docs.blender.org/api/blender_python_api_2_74_0/bpy.app.handlers.html
I'm not sure but it might also be possible to use "modal operators" but think that might make more sense for actual operators like grabbing, rotating etc.