Houdini 20.5 Nodes TOP nodes

USD Modify Paths TOP node

Modify asset path attribute values.

Since 20.0

This node finds all asset path referenced by any prim in the root layer of a USD file, and modifies the path values. This can be useful when receiving USD files from other users which may contain absolute paths that need to be converted to relative paths. It is also useful for converting texture map files into a renderer-specific format (such as .rat files for rendering in Karma).

Two attributes are added to each work item if at least one asset path is changed.

Parameters

Create Attributes

Generate When

Determines when this node will generate work items. You should generally leave this set to “Automatic” unless you know the node requires a specific generation mode, or that the work items need to be generated dynamically.

All Upstream Items are Generated

This node will generate work items once all of the input nodes have generated their work items.

All Upstream Items are Cooked

This node will generate work items once all of the input nodes have cooked their work items.

Each Upstream Item is Cooked

This node will generate work items each time a work item in an input node is cooked.

Automatic

The generation mode is selected based on the generation mode of the input nodes. If any of the input nodes are generating work items when their inputs cook, this node will be set to Each Upstream Item is Cooked. Otherwise, it will be set to All Upstream Items are Generated.

Source

The input the node reads to fetch data from.

File Source

Determines the source of the file. A USD file should be supplied, either as the output from the upstream node or as a custom file path.

Custom File Path

Uses the file specified by the custom file path.

Upstream Output File

Uses the output file produced by the upstream work item as the path to the file.

File Path

The path to the file to be read.

This parameter is only available when File Source is set to Custom File Path.

File Tag

The data tag that identifies the result from the upstream work item.

This parameter is only available when File Source is set to Upstream Output File.

Destination

Where to write the modified USD file.

Overwrite Source File

If checked, the file at the path of the input source file will be overwritten with the changed made by this node.

Destination File

The path at which to save the modified USD file. This field is disabled if Overwrite Input File is checked.

Add Destination Path to Output

If checked, the destination file path will be set as a file output for each of this node’s work items.

Modifications

A list of the modifications to make to each asset path.

Allow Chaining

If checked, multiple modification blocks can be applied to a single asset path. The blocks are checked top to bottom, and if a block causes modifications to occur, the remaining blocks will only be processed for that path if this box is checked. Chaining is always on within a single block - the prefix pattern will be checked, then the suffix, then the Python code.

Number of Modifications

The number of modification blocks in this node. Each block allows for specification of a prefix, suffix, and custom Python code to use for searching and replacing asset paths.

Find Prefix

The glob pattern that will be matched against the start of every asset path. If the pattern does not start with “^”, it will be prepended internally.

Replace Prefix

The string to replace every prefix that matches the pattern specified in Find Prefix. This cannot be a pattern.

Find Suffix

The glob pattern that will be matched against the end of every asset path. If the pattern does not end with “$”, it will be appended internally.

Replace Suffix

The string to replace every suffix that matches the pattern specified in Find Suffix. This cannot be a pattern.

Python Code

The Python code to run for each asset path. The “assetpath” variable is made available in this code block, a string representing the asset path currently being processed. If “None” is returned by this code, no change will be made as a result of the Python code. If a string is returned, that string will be used as the new asset path.

TOP nodes