Use case: For a scene with a flaming torch on the wall, sometimes it is better to fake it with an animated placard (especially if the camera doesn't move, or the movement doesn't give away the fake).
The scene is then usually lit with an animated pointlight at the same position.
However, if the highs and lows of the light flicker don't match the animated flame texture's apparent highs and lows, it looks odd.
This script allows you to control the light colour (by sampling outColor) and intensity (by sampling outAlpha), so that the texture does whatever it does, but the light always matches it.
Options include pointsampling, or using the average of a grid of samples, sampling to control either or both of colour and intensity.
Extended use case: If the light is quite big in the scene, a single pointlight might not give the moving feel of the flame. In this case, setting up say 4 pointlights sampling from grids that average the 4 quarters of the texture, and arranging them in space around the flame in a similar fashion (but in 3D not just 2D), the lighting is still simple and lite, but responds with moving illumination in response to the animated texture, giving both matching flicker and nice moving shadows. (One could also apply some other small motion to the lights for an even smoother result).
This tool can be used for all sorts of things, from providing a simple way [for an artist] to animate a coloured light by using a texture (the attributes that the engine looks at are on the light so can be keyed from the AttributeEditor), to whatever you can think of. (c:
The instructions for use are in the header comment in the file.
Created and tested on Windows, but should work on other OS's as well, and probably works on Maya6.x
(Note: uses string continuation, which apparently can cause issues on OSX.)
Please use the Feature Requests to give me ideas.
Please use the Support Forum if you have any questions or problems.
Please rate and review in the Review section.