Maya Shader Library

A shading library tool to store and organize shaders in Autodesk Maya. Create and Manage Categories to organize, save and load maya shaders.

Documentation

Installation

MayaShaderLibrary tested on Maya 2017, 2018, and 2019

Download

  • Download/clone MayaShaderLibrary repository from gitHub.
  • If you are not familiar with gitHub, download this zip file
  • Copy/Paste or Unzip the contents into your preferred scripts location, or your maya scripts folder.

Maya Install

  • Add the following environment variable to your Maya.env (this folder is where your shaders and preview files are stored).
::
MAYA_SHADER_LIBRARY = your_install_directorylibrary

Note

Maya.env is usually located under User/My Documents/Maya/2018)

Running the script

Create a shelf button with the following python code:

import msl.shader_library as maya_shader_library
maya_shader_library.load()

Guides

Getting Started

Once the maya plugin is loaded, you should see a new menu called ‘Arcane Tools’ on the maya menu bar Under menus ‘Arcane Tools’ > ‘Lighting & Shading’ > ‘Arcane Shader Library’ you can start the script.

Once you load the tool you should see the interface.

https://github.com/MaxRocamora/MayaShaderLibrary/blob/master/maya_plugin/scripts/msl/ui/screenshot/uiMenu.png?raw=true

How to use

The MayaShaderLibrary works by creating Categories, inside each category you will save/load your shaders. Categorys will be created and listed, but not displayed until you ‘pin’ them to the interface, so you can have lots of categories but only the the ones your are currently in use.

Save shaders to disk by selecting a geometry in your scene and press the ‘add shader’ button, once saved the shader appear in the category. To load a shader, right click mouse on the shader icon and select load shader o or load and assing, the shader will be added to the hypershade, if you choose load and assing, the shader will be assigned to your current selected object.

Other Features

You can generate a thumbnail image base on a specific maya file. To edit this file, go to the top menu a select ‘Options’ > ‘Open Thumbnail Lightrig File’

Add comments to the shader, by editing the text box on the lower left area, and press ‘save’ button.

User Interface

On this section you will find a detailed explanation of each action on the user interface.

Note

Hover over any button to see what it does on the bottom status bar

User Interface Description

https://github.com/MaxRocamora/MayaShaderLibrary/blob/master/maya_plugin/scripts/msl/ui/screenshot/uiAreasDetail.png?raw=true
  1. Shader Info Area

Here is displayed the name of the shader, the maya node type, and user, pc name of who generate this shader. This is useful when you have MayaShaderLibrary installed over a network with a single shader repository.

  1. Notes Areas

You can add/edit comments here, remember to press the save button to save (3) the changes on the comments.

Shader Category’s

  1. Create a category

Go to menu Categorgy > Add New Category or use the ui button to create a new category.

  1. Pin a category

Use the pin button to pin the category to the tabs.

  1. Unpin category

Use the unpin button to remove a category from the tabs, this button dont delete the category from disk, just removes it from the tabs panel.

  1. Browse category folder

Opens an explorer to the actual folder of the category

  1. Refresh

Refresh the interface, this is usefull when the MayaShaderLibrary is used over a network with multiple users and you need to check for changes made by another user.

Shaders

Shaders are represented as thumbnail icons on the selected category, to add a shaders, simply select any maya geometry with a shader on it, and press the green plus button. The shader will appear on the category tab.

  1. Add Shader

Select a geometry to save his shader into current category selected.

Shader Menu

  1. To access shader menu, right click on the thumbnail image of any shader on your category tab.

Each menu option explained below:

  • Import into Scene
    Adds selected shader to the maya hypershade
  • Import and assing into selection
    Adds selected shader to the maya hypershade and assing it to selected object
  • Rename
    Renames the shader
  • Browse
    Open explorer into shader folder
  • Generate Thumnail
    Generates thumbnail image for this shader, using the default lightrig maya file
  • Delete from lib
    Deletes this shader from disk

Misc

The maya file used for render the thumnail image is located on this location:

installDirectory\MayaShaderLibrary\library\scene\thumbnail_scene.ma

The shaders are stored on this location:

installDirectory\MayaShaderLibrary\library\shaders

Indices and tables