Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Autodesk Maya 2009 / Relate Maya custom shaders to MR for Maya seems to fail
  RSS 2.0 ATOM  

Relate Maya custom shaders to MR for Maya seems to fail
Rate this thread
 
48343
 
Permlink of this thread  
avatar
  • Total Posts: 2
  • Joined: 30 December 2008 03:17 AM

I’ve created two shaders, one for Maya and one for mr.  Both work great, but I have to create two different shaders, one that uses the maya custom shader, and the other that uses the mental ray shader.

In the documentation, specifically “User Guide > Rendering and Render Setup > Shading > mental ray for Maya Shading > Advanced mental ray for Maya shading > Create and use custom mental ray shaders”, it claims that I shouldn’t have to create two separate shaders.  If I give the two custom shaders the same name, then mr for Maya (quote) “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”.

If I do this (give them the exact same name - case sensitive), then the mr node no longer appears, but when it’s loaded, I get the following warning:

Node “unitMapper” is expected to be existing in Maya.  It will be translated according to ghost shader declaration.

This sounded promising since it seems to be aware of the two shaders, but unfortunately it still doesn’t work as described.  I render with Maya Software and it works, but rendering with mr doesn’t.  Looking at the exported .mi file reveals that nothing was substituted (and the upstream part of the shader was ‘truncated’ with the inputs that should have been driven by the custom shader being left with default values).

Included in the documentation is the note that the Maya software shader should be loaded first unless you supply a special attribute, but it fails to document what that attribute should be or its values.  Regardless, I manually load the shaders to force the order that doesn’t require this attribute (maya custom shader first, then mayatomr, then the custom mr shader), but it still fails to work.

The plug-in I created is most like ‘setRange’, but includes a rounding function.  It’s really very simple; it’s a utility node and not a lighting/material/etc. node.  I even tried to mimic setRange (which has the corresponding mr shader ‘maya_setrange’) by prepending the custom mr with ‘maya_’ under the hope that the documentation was wrong about the exact name.  Nope.

The custom mr shader returns a vector (xyz), and I changed that to a structure containing the vector (same as how maya_setrange is declared in its .mi file). Again, nope.

Note that if I do a maya software render using the custom mr shader, the shader fails and gives bizarre results.  But that’s probably a separate issue (though I am curious as to why that would be).

I just can’t figure out what I’m doing wrong.  Can anyone help?

PS: running Maya 2009 x64 sp1 on Windows 7.



Replies: 0