Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In production, it's desirable to create and add your own patterns and C++ plugins (materials, lights, patterns, and more) to the user interface in Maya, having them load when RenderMan is loaded. This gives artists access to these nodes in a Maya session. Users wanting to do this must obtain a Maya Node ID from Autodesk (these are often assigned in blocks). This allows Maya to assign unique IDs and identify nodes.

Below we have two examples, one for OSL patterns and another for C++ Plu-ins.

 

Info

Since we do not recommend changing the shipped rmf.json files, you may use a system environment variable, RMS_SCRIPT_PATHSRFM_SHOW_PATH or RFM_SITE_PATH, to source your custom versions.

 

OSL Shaders

...

RenderMan for Maya will search in the following order and merge/override in the same order. Note : This hierarchical process is valid for the other config files: shelf.json, aovs.json, menu.json, etc.

  1. rfm will read RFMTREE/config/rfm.json. This is the base configuration and should NEVER be altered by you, please make a custom version.
  2. rfm looks for RFM_SITE_PATH and RFM_SHOW_PATH. These can either be environment variables or values in the main rfm.json (prefer the Environment Variable route).
  3. rfm looks for RFM_SITE_PATH/config/rfm.json. if found, it's contents will be merged with the standard config.
  4. rfm looks for RFM_SHOW_PATH/config/rfm.json. if found, it's contents will be merged/override the standard config and the site config.
  5. rfm looks for ~/rfm/config/rfm.json. if found, it's contents will be merged/override the standard config, the site and show config.

To add extra nodes (patterns, bxdfs, integrators, etc), resources/user/nodes/search_paths should be extended. rfm always expects the same directory structure:

Code Block
BASE
  |_ config
     |_ rfm.json
     |_ shelf.json, etc    (optional)
  |_ nodes    (optional)
     |_ args    (optional)
     |_ osl    (optional)
  |_ icons    (optional)
  |_ logs    (optional)


OSL Shaders

Node IDs for Patterns are embedded in the metadata. Below is an example from the PxrLayer OSL shader.

...

In your custom rfm.json file, you can load your .args files like the below example, your path to the stored .args files:

Code Block
{
    "$schema": "./rfmSchema.json",
    "resources": {
        "user": {
            "nodes": {
                "searchnode_exclusion_pathslist": [
                    "PxrHair",
                    "PxrLMDiffuse",
                    "PxrLMGlass",
                    "PxrLMMetal",
                    "PxrLMPlastic",
                    "${RMANTREE}/lib/plugins/ArgsPxrLMSubsurface",
                    "${RMANTREE}/lib/shadersPxrSkin",
                    "${RFMTREE}/lib/plugins/ArgsPxrUPBP",
                    "${RFMTREE}/nodes",
PxrValidateBxdf"
                ]
            }
        }
    },
    "dirmaps": {
        "user_to_z": {
            "from": "/User/name/maya",
            "to": "Z:/maya",
         "${RFMTREE}/test_files"   "zone": "UNC"
        }
    }
}

 

Node IDs for these are included in the .args file. The order doesn't matter but it must be in the first level of the tags. The below example is for a light.

...