These samples demonstrate some key concepts for writing OpenUSD converters. The samples use OpenUSD and the OpenUSD Exchange SDK (docs, github) to demonstrate how to author consistent and correct USD:
Asset ValidatorcreateStagecreateTransformscreateMeshcreateMaterialscreateReferencescreateAssetcreateCamerascreateLightscreatePhysicscreateSkeletonsetDisplayNamessetSemantics
This project requires "make" and "g++".
- Open a terminal.
- To obtain "make" type
sudo apt install make(Ubuntu/Debian), oryum install make(CentOS/RHEL). - For "g++" type
sudo apt install g++(Ubuntu/Debian), oryum install gcc-c++(CentOS/RHEL).
Use the provided build script to download all other dependencies (e.g USD), create the Makefiles, and compile the code.
./repo.sh buildFor debug builds, use ./repo.sh build -d
Use the run.sh script (e.g. ./run.sh createStage) to execute each program with a pre-configured environment.
Tip: If you prefer to manage the environment yourself, add
<samplesRoot>/_build/linux64-x86_64/releaseto yourLD_LIBRARY_PATH.
For command line argument help, use --help
./run.sh createStage --helpYou can also run all samples together, saved into a single layer.
Setup and activate a virtual environment for USD Exchange using these directions from the SDK docs.
To install the optional Asset Validator, use the optional/extra syntax:
(usdex-env): python3 -m pip install usd-exchange[test]Call python3 directly (e.g. python3 source/python/createStage.py) to execute each program with a pre-configured environment.
For command line argument help, use --help
(usdex-env): python3 source/python/createStage.py --helpThis project requires Microsoft Visual Studio 2019 or newer. Download & install Visual Studio with C++.
Use the provided build script to download all dependencies (e.g USD), create the projects, and compile the code.
.\repo.bat buildFor debug builds, use .\repo.bat build -d
Use the run.bat script (e.g. .\run.bat createStage) to execute each program with a pre-configured environment.
For command line argument help, use --help
.\run.bat createStage --helpYou can also run all samples together, saved into a single layer.
Setup and activate a virtual environment for USD Exchange using these directions from the SDK docs.
To install the optional Asset Validator, use the optional/extra syntax:
(usdex-env)> python.exe -m pip install usd-exchange[test]Call python.exe directly (e.g. python.exe source/python/createStage.py) to execute each program with a pre-configured environment.
For command line argument help, use --help
(usdex-env)> python.exe source/python/createStage.py --helpTo build within the VS IDE, open the solution found in the _compiler folder in Visual Studio. The sample C++ code can then be tweaked, debugged, rebuilt, etc. from there.
Note : If the user installs the OpenUSD Exchange Samples into the
%LOCALAPPDATA%folder, Visual Studio will not "Build" properly when changes are made because there is something wrong with picking up source changes. Do one of these things to address the issue:
Rebuildthe project with every source change rather thanBuild- Copy the OpenUSD Exchange Samples folder into another folder outside of
%LOCALAPPDATA%- Make a junction to a folder outside of %LOCALAPPDATA% and open the solution from there:
mklink /J C:\usd-exchange-samples %LOCALAPPDATA%\cloned-repos\usd-exchange-samples
If the scripts from the Samples fail due to self-signed cert issues, a possible workaround would be to do this:
Install python-certifi-win32 which allows the windows certificate store to be used for TLS/SSL requests:
tools\packman\python.bat -m pip install python-certifi-win32 --trusted-host pypi.org --trusted-host files.pythonhosted.orgThe samples are intended to be run sequentially and will build up the USD stage that is originally created in the createStage sample. The can also be run independently and will either open or create a stage depending on whether it exists. To run all of the samples sequentially with one command, type this in the command line after building:
Linux:
./run.sh all
python3 source/python/all.py
Windows:
.\run.bat all
python.exe source\python\all.py
This will output a single layer file after all of the samples have run sequentially. This output layer can be passed as the first command line argument to the usdview.[bat|sh] script to view it.
The Samples repository uses the Repo Tools Framework (repo_man) to configure premake, packman, build and runtime dependencies, testing, formatting, and other tools. Packman is used as a dependency manager for packages like OpenUSD, the Omniverse Asset Validator, the OpenUSD Exchange SDK, and other items. The Samples use OpenUSD Exchange SDK's repo_man, premake, and packman tooling as templates for including and linking against OpenUSD, the OpenUSD Exchange SDK, and other dependencies. These can serve as an example for the build and runtime configuration that a customer's application might require. Here's a list of interesting files:
- premake5.lua - the build configuration file for the samples
- prebuild.toml - consumed by the repo build tools to specify where runtime dependencies should be copied (beyond what
repo install_usdexalready installs) _build/target-deps/usd-exchange/release/dev/tools/premake/usdex_build.lua- the OpenUSD Exchange SDK's premake build configuration template file for including USD, the OpenUSD Exchange SDK itself, and other libraries.- this file isn't available until dependencies are fetched
For details on choosing and installing the OpenUSD Exchange SDK build flavors, features, or versions, see the install_usdex tool documentation.
See the OpenUSD Exchange SDK Native Application Guide for a walkthrough of how use the OpenUSD Exchange SDK and OpenUSD in a native application.
First search the existing GitHub Issues and the OpenUSD Exchange SDK Discussions to see if anyone has reported something similar.
If not, create a new GitHub Issue or forum topic explaining your bug or feature request.
- For bugs, please provide clear steps to reproduce the issue, including example failure data as needed.
- For features, please provide user stories and persona details (i.e. who does this feature help and how does it help them).
Whether adding details to an existing issue or creating a new one, please let us know what companies are impacted.
The license for the samples is located in LICENSE.md.
Third party license notices for dependencies used by the samples are located in the OpenUSD Exchange SDK License Notices.
OpenUSD Docs - Creating Your First USD Stage
NVIDIA OpenUSD Resources and Learning
OpenUSD Code Samples Documentation