Shader Attribute Cycler
The Shader Attribute Cycler (SAC) is a MEL script for Maya. (The script is here.)
SAC was inspired by a figure in Lee Lanier's Advanced Maya Texturing and Lighting, on page 64. He's discussing Maya's translucence shader and includes a figure that shows renderings at three different settings of the translucence, translucenceDepth, and translucenceFocus settings of that shader.
I thought it would be cool to be able to see how the output changes as the three parameters are changed, so I wrote the SAC script. It cycles through up to three attributes of a shader, stepping through a specified number of times. Each time, the attributes are incremented (starting at a specified value and ending at another specified value--the increment is calculated automagically based on the specified number of steps).
Here are some movies using the Maya scene file from Lee's book. (Each movie is about 10MB.) In each movie, I've actually kept two attributes constant and stepped only one of them.
Normally, each combination of the selected attributes, between their respective starting and ending values, inclusive, is used to render an image at each step. Each rendered image shows the shader parameters used in generating that image.
Be careful about setting the number of steps too high, since the number of images generated is the cube of 1 plus the number of steps. So 10 steps will give you 1331 images ((10+1)*(10+1)*(10+1)). The the "+1" is to account for the starting settings. After rendering using the starting settings, then the specified 10 steps (in this example) are rendered.
So when you click the Render button in the script's window, the first attribute will be stepped from its starting value to its ending value. After reaching the ending value, the second attribute will be incremented, and the first attribute will cycle through all of its steps again. After the second attribute has reached its ending value, the third attribute is incremented. Finally, on the last step of the first attribute, on the last step of the second attribute, on the last step of the thrid attribute, the final image is rendered. So what we have is a loop within a loop, all within a loop.


