top of page

Custom Maya Material GUI


My idea was to create a Maya GUI that would prompt the user to select a material and decide between procedural and using texture files. There would be a scroll bar with the material's attributes that the user can select to determine which ones would have an OSL script assigned to it. The GUI would then run my Python script that assigns the selected attributes to the shape nodes of the selected objects, create the selected material, input the OSL code and make all the correct connections in the HyperShade. The goal is to manipulate material attributes on individual objects with the same material without affecting the look of the other objects. This will ultimately optimize scene files with large amounts of objects in them.


How to Use

1. Download .zip file
2. Unzip and save 'Custom_OSL_Shader_Amanda_Rabade' in '/Users/<username>/Documents/maya/scripts'
3. In Maya, copy and paste in a new Python tab in the script editor and run:

import sys

sys.path.append('C:/Users/<username>/Documents/maya/scripts/Custom_OSL_Shader_Amanda_Rabade')  < Windows
import sys
4. Open '' in the script editor and run
5. Pick material from drop down and select either 'Procedural' or 'Texture Files' then select geometry. (Can select geometry first, order doesn't matter)
6. Click 'Create'

If 'Texture Files' is selected:

  1. A window will appear and prompt you to compile the OSL node in the HyperShade. The rest of the code will not run until this task is complete!

  2. Click 'Done' to finish the process

If 'Procedural' is selected:

Current Features

1. Works with aiStandardSurface and aiToon
2. Procedurally and with Texture Files
3. If done procedurally, can work on any and all objects, regardless of UVs
4. If done with texture files, the objects selected must have the same UVs
5. Adds adjustable color correct and fresnel attributes on shape nodes

Future Features

1. Will work with more materials in Maya
2. User will be able to select desired attributes when run procedurally
3. Will have error messages to help guide the user to make the appropriate selections

Ideation Process

Possible Errors


If you receive this error, go back to How to Use and make sure you did steps 1-3

bottom of page