OpenUSD Exchange Dev Tools#

Most users of OpenUSD Exchange SDK will have their own build systems & CI/CD processes, and our custom dev tools may be of limited use outside of the usd-exchange and usd-exchange-samples repositories.

However, there are two tools that we highly recommend using:

  • The repo install_usdex tool can be used to acquire all of the OpenUSD Exchange build & runtime requirements.

  • The Omniverse Asset Validator is a python module & command line interface for validating OpenUSD Stage/Layer data. It can be used interactively, but we find it most useful when integrated into CI/CD processes to ensure valid output of data converters.

install_usdex#

The first step to building an application or plugin using OpenUSD Exchange SDK is to install the SDK itself. Assembling the minimal runtime requirements of the SDK can be arduous. The install_usdex tool can be used to download precompiled binary artifacts for any flavor of the SDK, including all runtime dependencies, and assemble them into a single file tree on your local disk.

Important

Be sure to configure the --usd-flavor, --usd-version, --python-version, and --version arguments appropriately to download your preferred flavor of OpenUSD Exchange SDK. See repo install_usdex -h for available options.

This tool can be invoked from a clone of the GitHub repository or from a source archive downloaded from an official release.

Install usdex_core#

By default, the tool will install the core library and module from OpenUSD Exchange SDK. For example, to download & assemble a USD 24.05 & Python 3.11 compatible binaries for OpenUSD Exchange v1.0.0 call:

./repo.sh install_usdex --usd-version 24.05 --python-version 3.11 --version 1.0.0
.\repo.bat install_usdex --usd-version 24.05 --python-version 3.11 --version 1.0.0

Similarly, to download & assemble a minimal monolithic USD 23.11, with no python support, for OpenUSD Exchange v1.0.0 call:

./repo.sh install_usdex --usd-flavor usd-minimal --usd-version 23.11 --python-version 0 --version 1.0.0
.\repo.bat install_usdex --usd-flavor usd-minimal --usd-version 23.11 --python-version 0 --version 1.0.0

Extra OpenUSD plugins#

If you need more OpenUSD modules than the strict minimal requirements of OpenUSD Exchange SDK, you can install them using --install-extra-plugins.

For example, to add on usdSkel and usdPhysics call:

./repo.sh install_usdex --version 1.0.0 --install-extra-plugins usdSkel usdPhysics
.\repo.bat install_usdex --version 1.0.0 --install-extra-plugins usdSkel usdPhysics

Install usdex_rtx#

If you are interested in RTX Rendering via NVIDIA Omniverse, you may want to use usdex_rtx to assist with MDL Shader authoring. Use the --install-rtx argument to install the usdex_rtx library and usdex.rtx python module.

./repo.sh install_usdex --version 1.0.0 --install-rtx
.\repo.bat install_usdex --version 1.0.0 --install-rtx

Python test helpers#

If you would like to use our usdex.test python module, or the Omniverse Asset Validator, you can use --install-test to install them both.

./repo.sh install_usdex --version 1.0.0 --install-test
.\repo.bat install_usdex --version 1.0.0 --install-test

repo_tools configuration#

If you do use repo_tools in your project, you can configure install_usdex by adding the following to your repo.toml along with any tool configuration overrides from the default values:

[repo]
extra_tool_paths."++" = [
    "_build/target-deps/usd-exchange/release/dev/tools/repoman/repo_tools.toml",
]

[repo_install_usdex]
enabled = true

If you would like to run this process automatically during a build, add it to the post build commands:

[repo_build.post_build]
commands = [
    ["$root/repo${shell_ext}", "install_usdex", "-c", "$config"],
]
staging_dir#

Sets the staging root folder for package links.

Required compile, link, and runtime dependencies will be downloaded & linked this folder.

Default value:

staging_dir = "$root/_install"
install_dir#

Sets the install root folder.

Required runtime files will be assembled into this folder.

Default value:

install_dir = "$root/_install/$platform/$config"
usd_flavor#

Sets the usd flavor (set ‘usd’ for stock pxr builds of OpenUSD)

Default value:

usd_flavor = "usd"
usd_ver#

Sets the usd version (YY.MM)

Default value:

usd_ver = ""
python_ver#

Sets the python version.

Use “0” to indicate that python should be disabled.

Default value:

python_ver = ""

Asset Validator#

The Omniverse Asset Validator provides both a python module & command line interface for validating OpenUSD Stage/Layer data. It includes a suite of validation rules that check for common USD authoring mistakes, including all rules from OpenUSD’s usdchecker cli, along with some additional rules developed by NVIDIA.

It can be used interactively, but we find it most useful when integrated into CI/CD processes to test for correctness & compliance of OpenUSD data models.

To use the validator from python, with the default rules enabled, simply provide any layer URI (or composed Usd.Stage object) and validate:

import omni.asset_validator

# validate an existing layer file
engine = omni.asset_validator.ValidationEngine()
print(engine.validate("foo.usd"))

# validate a stage in memory
stage = Usd.Stage.CreateAnonymous()
# define prims
engine = omni.asset_validator.ValidationEngine()
print(engine.validate(stage))

There are also CLI examples of the Asset Validator in OpenUSD Exchange Samples.

If you are using Python’s unittest framework for your regression testing, consider trying the usdex.test python module in your test suite. It includes a few unittest.TestCase derived classes to simplify some common OpenUSD testing scenarios, including the Asset Validator (e.g self.assertIsValidUsd()).

To acquire both the Asset Validator and the usdex.test module, use repo install_usdex --install-test.

Unfortunately, the Omniverse Asset Validator is not yet available for pure C++ testing, but recent OpenUSD versions now include a UsdValidatorSuite that is implemented in C++. Over time these two frameworks will align & validation should be possible from either C++ or Python.