These samples demonstrate some key concepts for writing OpenUSD converters. The samples use the OpenUSD and the OpenUSD Exchange SDK (docs, github) to demonstrate how to author consistent and correct USD:
Asset Validator
createStage
createCameras
createLights
createMaterials
createMesh
createReferences
createSkeleton
createTransforms
setDisplayNames
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 build
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/release
to yourLD_LIBRARY_PATH
.
For command line argument help, use --help
./run.sh createStage --help
Use the python.sh
script (e.g. ./python.sh source/createStage/createStage.py
) to execute each program with a pre-configured environment.
For command line argument help, use --help
./python.sh source/createStage/createStage.py --help
This 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 build
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 --help
Use the python.bat
script (e.g. .\python.bat source\createStage\createStage.py
) to execute each program with a pre-configured environment.
For command line argument help, use --help
.\python.bat source\createStage\createStage.py --help
To 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:
Rebuild
the 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
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_usdex
already 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 Getting Started docs for a walkthrough of how use the OpenUSD Exchange SDK and OpenUSD in your application.
The samples listed are focused on these key concepts:
- OpenUSD
- USD Cameras
- USD Display Names
- USD Lights
- USD Materials
- USD Meshes
- USD Prim Names
- USD Primvars
- USD Stages
- USD Xforms
The 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:
./repo.sh test -f testRunAll -e keep
Windows:
.\repo.bat test -f testRunAll -e keep
This will output the location of the C++ and Python generated stages after all of the samples have run sequentially.
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.org
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