Here is my multiple color shader python script for Maya. This script enables you to:
- Randomly assign any number of colors to a group of objects within one shader
- Provide a range for the random colors to fall within
- Use one file to sample textures from, instead of colors.
Here are 2 examples of what a file texture should look like to work with the script:
For the books in my Writer’s Block scene, I ran the script twice – once for random colors, once for random titles from a texture. I then created a layered texture to combine the results.
I hope someone finds this useful – I’d appreciate feedback and would like suggestions to improve the script.
BONUS TIME! Here is a super simple script to toggle the render (not scene/viewport) visibility of selected objects. Normally you have to uncheck the boxes one by one.
To use, source the script and then type toggleVis() into the Python command line.
Also, check out my friend Aaron’s helpful blog post on how to load these and other custom scripts on startup!


