USD in Houdini#

Houdini has an extensive USD integration and provides a large array of tools to work with USD data.
The Prism USD plugin provides additional tools to manage and organize a USD based workflow with a focus on the Solaris (LOPs) context in Houdini.
This page is a reference of the Prism USD tools available in Houdini.
For workflow examples see these guides:

Solaris HDAs#

In Solaris (LOPs) these Prism HDAs are available:
../../../_images/lops_hdas.jpg

Prism LOP File Cache#

The Prism LOP File Cache is used to write out USD files.
These USD files can then be used as layers in other USD files or as normal products in Prism.
../../../_images/lops_filecache.jpg

Prism LOP Import#

This HDA can be used to import USD files from the Prism project into Solaris.
By default it will import the latest USD product of the asset/shot in which the current scenefile is saved.
../../../_images/lops_import.jpg

Prism LOP Mute Departments#

This HDA provides options to mute specific department layers or sublayers of a USD stage.
This is useful when loading the entity USD container in a department scenefile.
Usually the current department and downstream departments should be muted in this case.
../../../_images/lops_mute_departments.jpg

Prism LOP Render#

This HDA can trigger a render of the input USD stage and save the output images in the Prism project.
This node can also submit renderjobs to Deadline.
Optionally this node can export USD files and submit a render job to Deadline, which renders the USD files using the Husk executable, which doesn’t require a Houdini license and Prism license.
../../../_images/lops_render.jpg

Prism LOP Sequencer#

This HDA will play back all input USD stages in sequence.
It will detect the framerange of each input and offset the startframe, so that multiple shots can be played back after another even if their original startframe number is identical.
../../../_images/lops_sequencer.jpg

Solaris Presets#

Prism offers multiple presets to help setting up nodegraphs for different departments.
From the “Prism Presets” menu in the tab menu there are multiple nodegraph presets available to set up a basic structure for the USD workflow in LOPs and SOPs.
../../../_images/lops_presets.jpg

1 Setup Assets…#
Opens a window where you can select one or more assets from your project.
In the next window you can select which departments you want to setup for each asset.
Once confirmed, Prism will load a nodegraph preset for each selected department of each selected asset.
2 Setup Shots…#
Similar to the Setup Assets... preset.
Select one or more shots and then the departments, which should be setup.
When setting up multiple shots, Prism uses a shot switch in each department nodegraph to switch between the shots, instead of creating independent department nodegraphs for each shot.
3 Current Entity…#
Detects in which asset or shot the current scenefile is saved in and shows a window with the departments, which are available to setup.
4 Import Assets…#
Opens a window where one or more assets can be selected and loaded.
This is intended to load assets into a shot nodegraph.
The asset are loaded using the Prism Import LOP node and are loaded as payload.
The “Add Meta Data” option is disabled to not affect downstream ROPs.
5 New Preset…#
Let’s you create your own presets.
See here for more details.

Creating Custom Solaris Presets#

To create a new nodegraph preset open the tab menu in LOPs and select Prism Presets -> 5 New Preset...
This will open the following window:
../../../_images/usd_createPresetDlg.jpg
Presetname sets the name, which will be visible in the nodegraph tab menu.

Node defines the Houdini nodepath, which will be saved in the preset. All childnodes of the selected node will be saved.

Location defines where the presetfile will be saved on disk.
- “User” location is by default at this path: %userprofile%\Documents\Prism2\Presets\Houdini_Nodegraphs
- “Project” location is by default at this path inside of your current Prism project folder: 00_Pipeline\Presets\Houdini_Nodegraphs
- “USD Plugin” location is at this path inside of the Prism USD plugin folder: Presets\Houdini_Nodegraphs
This is the location where the default nodegraph presets are stored.
Saving custom presets in this location is not recommended because they will be deleted if the Prism USD plugin gets updated in the future.
- “Custom” let’s you choose a folder manually.

Prism will load presets from these locations automatically.

Note

You can use the env var PRISM_HOUDINI_NODEGRAHPRESET_LOCATIONS to define additional locations, where Prism will load nodegraph presets from.

Running Custom Python Code when a preset is loaded#

When you created custom Solaris nodegraph presets, you might want to run some Python function every time after the preset got loaded.
This can be done using a simple Prism plugin like in this example:
class Prism_MyPlugin_Functions(object):
    def __init__(self, core, plugin):
        self.core = core
        self.plugin = plugin
        self.core.registerCallback("pluginLoaded", self.onPluginLoaded, plugin=self.plugin)

    def onPluginLoaded(self, plugin):
        if plugin.pluginName == "USD":
            plugin.api.postPresetLoadHandlers["My Custom Preset"] = self.onPresetLoaded

    def onPresetLoaded(self, presetName=None, kwargs=None):
        self.core.popup("Preset %s" presetName)

SOPs#

In SOPs USD files can be imported using the “Prism ImportFile” SOP.

To export USD files the Prism File Cache SOP can be used.
When working in a full USD workflow, it’s recommended to bring the SOP data into LOPs and cache it out using the Prism LOP File Cache.

Miscellaneous#

Meta Data#

The Prism LOP import nodes can add some meta data to the loaded USD stage to identify the asset or shot from which the USD file originated.
This meta data can be used by downstream filecache and render nodes to set in which asset or in which shot files will be published.

On the Prism LOP Import node there is an Add Meta Data checkbox in the Advanced Settings section.
By default it is enabled, which is recommended when loading asset or shot USD containers at the top of your nodegraph.
When loading assets into a shot USD stage, this checkbox should be unchecked to not overwrite the meta data, which contains the shotname, with the meta data, which contains the assetname. This is because downstream ROPs are expected to publish files to the shot and not the asset.

On the Prism LOP File Cache node and the Prism LOP Render the Context parameter defines in which entity the published files will be saved.
By default this is set to From stage meta data, which will check the input stage for the meta data, which was created by an upstream Prism LOP Import node.

This meta data is stored on the /prism_metadata USD prim on the prism_sources attribute.
This USD prim is hidden by default and can be ignored in most cases.
To see it in the Houdini Scene Graph Tree you can click the Primitive visibility in scene graph button (glasses icon) and toggle Show hidden primitives.
../../../_images/lops_meta_data.jpg

Shot Menu#

When creating nodegraphs from the Prism Solaris Presets for multiple shots, Prism will use switch nodes to work on shot specific overrides.
These switch node use the shot context option.
A convenient way to set this context option and switch the inputs of the switch nodes is to use a shot menu in the main menu bar in Houdini.
../../../_images/lops_shot_menu.jpg
When adding the Prism integration to Houdini, the shot menu will be set up automatically.

If you are using a custom Prism integration in your Houdini startup process, you might need to configure the shot menu manually:
The Prism USD plugin ships with a MainMenuCommon.xml file, which adds this menu to Houdini.
To let Houdini load this file, the Prism.json package file need to be updated to add the path to the Integration``folder of the USD plugin to the ``path env var in the package file.
For example:
{
    "env": [
        {"PRISM_ROOT": "${PRISM_ROOT-C:/Program Files/Prism2}"
        }
    ],
    "path" : [
        "C:/ProgramData/Prism2/plugins/Houdini/Integration",
        "C:/ProgramData/Prism2/plugins/USD/Integration"
    ],
    "load_package_once": true
}
When you open a hipfile, Prism will set the context option shot to the shotname in which the scenefile is saved.

Note

If you want to disable this behavior you can set the PRISM_HOUDINI_SOLARIS_SET_SHOT env var to 0.