This script was a request from Monica Cappiello. Setting up a shader network and all its connections can be tedious work. Especially when working with artists or students who are not following the correct prefix naming convention. What this script does is prompt you to select a folder of textures. Then if they are named correctly plug them into the correct connections on the shading group and apply the shader to the selected object. If they are not named correctly you are prompted for what channel it should be mapped to and applies the correct prefix to the filenames. After fixing the files it then does the same shader creation functionality. Currently it supports aiStandardSurface, Blinn, Phong, and Lambert.
To install:
1: Put instantShaderUI.py and instantShaderClass.py in your C:\Users\’user’\Documents\maya\scripts folder
2. Add new shelf item with the following script:
import instantShaderUI
iscWindow()
To use:
1. Select object to assign to if desired.
2. Select Shader from drop down and hit create.
3. Select folder of images for your shader (will be name of shader). Must be in ‘jpg’,’gif’,’png’,’tif’,’bmp’ formats.
4. If files are named with correct prefixes shader will be created.
If not you will be prompted to fix each prefix and then the shader will be created.
5. Your newly created shader will be selected, take a moment to verify settings and enjoy.
Download here:
instantShader.zip
UPDATE:
Added better UI.
instantShaderUI.zip
