Dec 29, 2012

Shader Fun

I've written some helper scripts for dealing with shader and render layer assignments called shader_fun, which includes the following commands:

shader_fun.export_shaders() - Store the mesh assignment info for all shaders in the scene and then export them to a separate maya file.
shader_fun.import_shaders() - Import shaders with mesh assignment info and reassign to meshes with the same name. Supports namespaces.

x = shader_fun.get_render_layer_ass() - Get the render layer shader assignments for selected meshes and store it in "x".
shader_fun.set_render_layer_ass(x) - Set the render layer shader assignments stored in "x".

shader_fun.save_mat_ass() - Save all shader assignments in the maya scene to an "ass" file.
shader_fun.load_mat_ass() - Load and apply all the shader assignments from an "ass" file.

Get started:
1. Download with right-click save as and save the file in you maya prefs folder in the scripts folder. For example c:/users/[yourusername]/documents/maya/scripts/
2. Import with the following python command import shader_fun
3. Run those other commands.


Post a Comment