Tuesday, June 18, 2013

lpMultiShaderTool.py

The idea to put together a tool like this came from a peer of mine needing to be able to identify material assigned to components.

In this post you can see the approach taken to doing this:
http://luizmoreira2012br.blogspot.com/2013/06/finding-shader-for-face-component.html

In summary, this tool allows for the creation and interaction of shaders in both object and component level. Users can copy and transfer shaders across objects. They can also empty shaders and reassign new objects to them, as well as deleting shaders and their shading groups.

Download script here
Watch video demo here

Here are instructions on how to use the tool:

First make sure to place the script in maya/scripts directory.

In Windows it's something like this:
     C:/Program Files/Autodesk/Maya2013/Python/lib/site-packages/ 

In Mac:
     Users/yourUserName/Library/Preferences/Autodesk/maya/2013-x64/scripts/

lpMultiShaderTool v1.0- Live update of current shader

To run the tool:

import lpMultiShaderTool
reload(lpMultiShaderTool)
lpMultiShaderTool.lpMultiShaderToolUI()

1. Assign New Shader to Selected:
     Creates a new shader and shading group and connects to selected objects

2. Get Shader from Selected:
     Copies the shader assigned to the selected object and stores it. Requires that only one object is
     selected

3. Add Shader to Selected:
    Adds the current shader to the selected objects

4. Select All with Shader:
    Selects all objects in the scene with the current shader

5. Remove All from Shader:
    Empties shader, so that all objects previously shaded with it are now shaded with the default shader -
    lambert1. Doe

6. Select All in Selected Shader: NEW
    Selects all objects that have the same shader as the selected object without affecting the current
    shader.

7. Switch All in Shaders:
    Gets the shader from the selected object and assigns it to all the objects with the current shader.
    Applies the current shader to all objects with the same shader as the selected object. In other words,
    switches the objects from on shading group to the other.

8. Delete Current Shader:
    Deletes shader and shading group for the current shader, and returns all objects previously with that
    shader to the default shader: lambert1

9. Reset To Default Shader:
    Assigns the default shader to all selected objects.

0 comments:

Post a Comment