Experimenting with C++ libraries capable of parsing USD files
- USD file format
- OpenUSD Github repository
- tinyusdz Github repository
- OpenUSD - Converting Between Layer Formats
- Download Pre-Built OpenUSD Libraries and Tools
- A really small getting-started project for USD based projects
- OpenUSD sample files for download
- vcpkg issue
- Download and install CMake from the official website or trough a package manager
- Install a C++ compiler on your operating system. For example, on Ubuntu Linux use
sudo apt install -y build-essential
to install thegcc
andg++
compilers; on Windows, thecl.exe
compiler is included with the Visual Studio IDE; and on macOS,clang
andclang++
compilers are system binaries - Add git submodules:
git subdmodule update --init
To generate USD files from glTF files, you can either download the pre-built OpenUSD libraries and tools to use the usdcat
CLI tool or build the project from GitHub. On macOS 12.0 (Monterey) and later, the pre-built OpenUSD CLI tools, including usdcat
, should already be installed. The data folder can be utilized for storing USDA or USDC files. Example usage os usdcat
:
usdcat <path to gltf file> -o <path to usd file>
# e.g. usdcat third-party/glTF-Sample-Models/2.0/BrainStem/glTF/BrainStem.gltf -o data/BrainStem.usda
# e.g. usdcat third-party/glTF-Sample-Models/2.0/BrainStem/glTF/BrainStem.gltf -o data/BrainStem.usdc
Run:
# INFO: Tested on macOS 15
./third-party/vcpkg/bootstrap-vcpkg.sh
./third-party/vcpkg/vcpkg install --allow-unsupported # Initially building USD can be time-consuming and resource-intensive. Packages persist in the vcpkg git submodule
# Unable to use the `-DCMAKE_TOOLCHAIN_FILE` option because of build errors as the `--allow-unsupported` flag is not available in the subsequent `cmake` command
cmake -B build -DCMAKE_BUILD_TYPE=Release .
cmake --build build --parallel --config Release
./build/apps/openusd-parser/openusd-parser <path to USDC or USDA file> <path to output text file>
# e.g. ./build/apps/openusd-parser/openusd-parser data/BrainStem.usdc data/BrainStem.txt
Run:
# INFO: Tested on Windows 10
.\third-party\vcpkg\bootstrap-vcpkg.bat
.\third-party\vcpkg\vcpkg install # Initially building USD can be time-consuming and resource-intensive. Packages persist in the vcpkg git submodule
cmake -B build -DCMAKE_BUILD_TYPE=Release .
cmake --build build --parallel --config Release
.\build\apps\openusd-parser\Release\openusd-parser <path to USDC or USDA file> <path to output text file>
Run:
# INFO: Tested on Linux Ubuntu 20.04
./third-party/vcpkg/bootstrap-vcpkg.sh
./third-party/vcpkg/vcpkg install # Initially building USD can be time-consuming and resource-intensive. Packages persist in the vcpkg git submodule
cmake -B build -DCMAKE_BUILD_TYPE=Release .
cmake --build build --parallel --config Release
./build/apps/openusd-parser/openusd-parser <path to USDC or USDA file> <path to output text file>