PyMel Script – Create Shader from folder of textures.

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

Posted by Charles

7 comments

ปั้มไลค์

Like!! I blog frequently and I really thank you for your content. The article has truly peaked my interest.

I like this site very much, Its a really nice post to read and incur information. Quintilla Aldous Tompkins

You made some good points there. I looked on the web for more info about the issue and found most people will go along with your views on this site. Charin Wes Mitchell

I think this site has got some very excellent info for everyone : D. Julee Garwin Rozalin

Like!! I blog frequently and I really thank you for your content. The article has truly peaked my interest. Francisca Ignacio Veneaux

Nice piece of info! May I reference part of this on my blog if I post a backlink to this webpage? Thx. Lynna Jason Cower

Leave a Reply to Charles Cancel reply