Managing Plugins

Managing Plugins

RenderMan for Maya supports customized plugin shaders. Potential authors of plugins - both Bxdfs and Patterns - should consult the RIS Developers' Guide in the RenderMan Pro Server documentation, particularly Writing Bxdfs and Writing Patterns. The Porting RSL to C++ application note should also be helpful. This particular document, however, describes how to deal with your plugin once you've written it...

First and foremost, having written your plugin, you need to tell RfM where to find both the plugin and its .args file. That location needs to be specified in two places.

.Args files are loaded via RenderMan_for_Maya.ini, using a list of directories where args files are loaded from. It looks like this:

set RISArgsSearchPath [list \
                       [file join $rmantree lib RIS pattern Args] \
                       [file join $rmantree lib RIS bxdf Args] \
                       [file join $cfg ris customNodes] \
                       [file join $cfg ris mayaNodes] \
                      ]

Let's say both your plugin and .args file live in a directory named C:/Users/mwazowski/mypatterns. You can insert your own directory into that list, like this:

set RISArgsSearchPath [list \
                       [file join $rmantree lib RIS pattern Args] \
                       [file join $rmantree lib RIS bxdf Args] \
                       [file join $cfg ris customNodes] \
                       [file join $cfg ris mayaNodes] \
                       {C:/Users/mwazowski/mypatterns}
                      ]

PRMan also needs to know where to find your plugin when rendering. Searchpaths are specified via RMSWorkspace.ini. Find the rix searchpath, and change it like so:

SetPref WSSearchPaths.rixplugin [list \\\${RMSTREE}/lib/shaders/ C:/Users/mwazowski/mypatterns @]
  • Important

    We highly recommend that, rather than editing an .ini file in your installation directory ($RMSTREE/etc), users should create a duplicate file containing your site-specific overrides and place it in a separate directory, which must then be referenced via the $RMS_SCRIPT_PATHS environment variable.

When creating an .args file, it's probably best to grab one from another pattern and modify it to suit your pattern's parameter list. There's a tag at the bottom of the .args file where a nodeid is specified - this is critical for making the node appear in RfM. You must use a new nodeid, otherwise there will be conflicts in Maya. Maya sets aside the range from 0 to 524288 for sites to use for their own custom nodes. Here's what the tag looks like where you need to change the nodeid:

<rfmdata nodeid="413177"
    classification="rendernode/RenderMan/pattern"/>

The classification indicates where in Hypershade the node will appear. Note that you should pick an established category that you see in one of the other .args files or it won't be recognized by the Hypershade.