Page tree

Versions Compared

Key

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

...

RenderMan can find your custom nodes easily but Houdini will need to generate the Interface for your nodes. The basic idea is to use RenderMan environment variables to point to the plugins and then run a script provided to generate the Houdini Digital Assets (HDA) that supply the interface. This script can run each time you start Houdini or you can generate the files once and then disable the script to reload these each time you start Houdini to save time. Note that changes to these nodes will require that you re-run the script to update the interface.

Environment

...

Variables

The following RenderMan Environment Variables can be used (either/or) to point to your installation location for your custom nodes, this can be a network location or separated list of multiple locations: .

Info

RMAN_

...

RIXPLUGINPATH

RMAN_SHADERPATH

Typically the RIXPLUGINPATH is meant for C++ plugins and SHADERPATH is meant for OSL and .args files. However, in Houdini it will parse either specified set of locations for all types of files. These can be used inside of your Houdini.env file for convenience if desired.

Creating HDAs

First: Shader names can be used to namespace or version your HDAs. Prefix before the first _ (underscore) will become the namespace and the numerical suffix after the last _ (underscore) will become the version. For example, a shader file called namespace_myshader_2.osl will be namespace::myshader::2 in Houdini. This can allow you to have multiple versions of a shader in your scene and not have to worry about naming your shader the same as a third party asset or Houdini node. See a more detailed explanation of digital asset namespacing and versioning here

Then, Houdini needs to create HDAs to generate the correct interface for your nodes from the OSL and .args files. A script is provided to accomplish this after parsing the locations specified above. 

You can find the details of this script below:invoke the script using the following environment variable and specifying a value of 1.


Info

RFH_ARGS2HDA = 1


Once the script is run on Houdini startup, it will save the resulting HDA files in the default user directory unless otherwise specified. You can change this location by setting RFH_USER_PREF_DIR. If this isn’t set, the HDAs will be saved in HOUDINI_USER_PREF_DIR.

Once these have been created, you can reuse them by resetting the RFH_ARG2HDA environment variable to 0, otherwise this will run each time you start Houdini and update the nodes automatically. This can be desirable unless there are many nodes causing a slow startup or no updates are being made that need to be captured each startup.


...


You can find more options for manual operation or possible debugging below, however, the above usage should be enough to accomplish installation of your custom nodes.

'''Usage: args2hda.py [options] argsfile1 [argsfile2...] This program parses an args file from Pixar's RenderMan and creates hda files
which allow the shader to be accessed easily in Houdini.Options:
-v Verbose
-o Dump associated obj files
-l hdafile Create a Houdini Digital Asset (HDA) for a single
shader.
-d dsfile Create a ds (dialog script) for a single shader.
-L hdafile Add shaders to a library of digital assets (one hda for all shaders)
-N label For a single .args file, specify the label in the menu
-C icon For a single .args file, specify the name of the icon
-c iconfile For a single .args file, specify icon file path that will be embedded in hda
-p path Path to find the shader when rendering. This path becomes
the Shader Name property of the hda.
-m menu TAB submenu path
-O Keep original names instead of casting to lower case.
-s namespace
-V version hda version
'''

You can invoke the above script using the following environment variable and specifying any value other than 0, RFH_ARG2HDA

Once the script is run it will save the resulting HDA files in the default user directory unless otherwise specified. You can change this location by setting the following environment variable, HOUDINI_USER_PREF_DIR

Outputs

-l hdafile, create a hdafile for a single shader

-L hdafile, add shaders to a library of digital assets (one hda for all shaders)

-d dsfile, create a dialog script for a single shader

Label

-N label, only valid when script called on a single file

Path

-p path, path to find the shader when rendering. This path becomes the shader name property of the hda.

Icon

-C file, icon must already exist in HOUDINI_PATH

-c path, path to icon file to be in embedded in hda

Menu

-m MyCustomNodes

Original Names

-O, keep original names

Version

-V myVersionNumber, adds version to shader

Verbose

-v, output debug messagesOnce these have been created, you can reuse them by resetting the RFH_ARG2HDA environment variable to 0