Relate Maya custom shaders to mental ray for Maya custom shaders
 
 
 

Custom shaders written for Maya’s Software renderer can be translated to equivalent mental ray for Maya custom shaders. This way, two shaders are required (one custom Maya plug-in shader and one mental ray custom shader) but only one shading network is necessary.

In previous versions of Maya, you must create two separate shading networks, one with Maya's plug-in shader and the other with mental ray custom shader. Beginning Maya 7.0, you only need to make one shading network with the Maya plug-in shader, and mental ray for Maya will automatically translate the connection to the corresponding mental ray shader during processing.

Tip
  • The mental ray shader must have the same name as the Maya plug-in shader.
  • If the mental ray shader is loaded first, then you must create a custom MEL script and place it in their your path. The script should be called mentalrayCustomNodeGhost.mel and should contain a single function as follows:
int mentalrayCustomNodeGhost(string $shader)
{
// return "true" if $shader should be used in place of a custom Maya shader of the same name
}

To relate a Maya custom shader with a mental ray for Maya custom shader

  1. The mental ray shader and its .mi file declaration must have a name matching the custom Maya shader node. For more information, see Write a shader declaration file.
  2. Load the .mi declaration for your custom mental ray for Maya shader in the Shader Manager (if you have not already loaded it). For more information, see Window > Rendering Editors > mental ray > Shader Manager and Load shaders

    mental ray for Maya automatically detects that a custom Maya shader has the same name as the new mental ray shader. When rendering, it will use the mental ray shader as appropriate.