-Revised script from MEL to Python
Batch rename selected shader(s) and its associated network with the following format:
shader's name + _connected attributes + _NODE TYPE
The script will work on all maya base shaders, textures, render nodes and mental ray nodes.Installation:
Unzip spM_renameShaders.py to maya's scripts folder.
To run the script, select shader(s), run the following in Python script editor:
The above command can be saved as a Python shelf button.
The script will recognize "_mat" and "Mtl" suffix on the shader(s) and take that off the prefix.
shader = "testLambert_mat"
shader's color is connected to "file15"
after running the script, "file15" will become "testLambert_color_FILE"
Any questions, comments or bugs are very welcome.