adobe / USD-Fileformat-plugins

A collection of USD fileformat plugins
298 stars 22 forks source link

USD File Format Plugins

These USD file-format-plugins allow the interchange between Pixar's USD (.usd, .usda, .usdz) and the following file formats, with cross platform support (windows, macos, and linux):

Plugin File Format Extension
usdfbx Autodesk's FBX .fbx
usdgltf Khronos' glTF .gtlf .glb
usdobj Wavefront's obj .obj
usdply Polygon File Format .ply
usdsbsar SBSAR file format .sbsar
usdstl STL file format .stl

Each file format's readme contains what they support.
Supported features legend:
    ✅ Supported
    ⚠️ Supported with known issues
    ❌ Not supported
    ⦸ Not applicable/no support planned

Dependencies

The following tools are needed:

The following dependencies are needed: Dependency Version Affects Optional
Pixar USD 23.08 all no
GTest 1.11.0 all tests yes
FBX SDK 2020.3.7 usdfbx no
LibXml2 2.10.0 usdfbx no
Zlib 1.2.11 usdfbx no
TinyGltf 2.8.21 usdgltf no
Draco 1.56 usdgltf yes
Fmt 10.1.1 usdobj no
FastFloat 1.1.2 usdobj no
Happly cfa2611 usdply no
Substance 9.1.2 usdsbsar no

Build

1. Setup dependencies

2. Get it

git clone https://github.com/adobe/USD-Fileformat-plugins

3. Configure, build and install it

To configure, build and install go to the project root folder and, using a multi-configuration backend (MSVC, ...) enter:

cmake -S . -B build -DCMAKE_INSTALL_PREFIX=bin <OPTIONS>
cmake --build   build --config release
cmake --install build --config release

or using a single-configuration backend (Make, ...) enter:

cmake -S . -B build -DCMAKE_INSTALL_PREFIX=bin -DCMAKE_BUILD_TYPE=Release <OPTIONS>
cmake --build   build
cmake --install build

where:

Option Description Default Affects
-Dpxr_ROOT Points to the USD installation empty all
-DGTest_ROOT Points to the GTest installation empty all tests
-DFBXSDK_ROOT Points to the Fbx installation empty usdfbx
-Dsubstance_DIR Points to the Substance SDK installation empty usdsbsar
-DZLIB_ROOT Points to the ZLIB installation empty usdfbx
-DLibXml2_ROOT Points to the LibXml2 installation empty usdfbx
-DTinyGLTF_ROOT Points to the TinyGLTF installation empty usdgltf
-Ddraco_ROOT Points to the draco installation empty usdgltf
-Dfmt_ROOT Points to the fmt installation empty usdobj
-DFastFloat_ROOT Points to the FastFloat installation empty usdobj
-DHapply_ROOT Points to the Happly installation empty usdply
-DUSD_FILEFORMATS_BUILD_TESTS Enables tests ON all tests
-DUSD_FILEFORMATS_ENABLE_FBX Enables fbx plugin ON usdfbx
-DUSD_FILEFORMATS_ENABLE_GLTF Enables gltf plugin ON usdgltf
-DUSD_FILEFORMATS_ENABLE_OBJ Enables obj plugin ON usdobj
-DUSD_FILEFORMATS_ENABLE_PLY Enables ply plugin ON usdply
-DUSD_FILEFORMATS_ENABLE_STL Enables stl plugin ON usdstl
-DUSD_FILEFORMATS_ENABLE_SBSAR Enables sbsar plugin OFF usdsbsar
-DUSD_FILEFORMATS_ENABLE_DRACO Enables draco in usdgltf OFF usdgltf
-DUSD_FILEFORMATS_FORCE_FETCHCONTENT Forces FetchContent for various packages OFF all
-DUSD_FILEFORMATS_FETCH_GTEST Forces FetchContent for GTest ON all tests
-DUSD_FILEFORMATS_FETCH_TINYGLTF Forces FetchContent for TinyGLTF ON usdgltf
-DUSD_FILEFORMATS_FETCH_ZLIB Forces FetchContent for Zlib OFF usdfbx
-DUSD_FILEFORMATS_FETCH_LIBXML2 Forces FetchContent for LibXml2 OFF usdfbx
-DUSD_FILEFORMATS_FETCH_HAPPLY Forces FetchContent for Happly ON usdply
-DUSD_FILEFORMATS_FETCH_FMT Forces FetchContent for Fmt ON usdobj
-DUSD_FILEFORMATS_FETCH_FASTFLOAT Forces FetchContent for FastFLoat ON usdobj
-DUSD_FILEFORMATS_ENABLE_ASM Generate a ASM based material network on layerwrite OFF

ZLIB, Draco and OpenImageIO packages are hinted to search into the USD installation by default. Override this by setting their ROOT or their FETCH variables (no fetch for OIIO).

The previous commands will place intermediate files into the folder build and install binaries into the folder bin. Also, make the plugins discoverable by USD to complete installation, by adding the path <INSTALL_PATH>/plugin/usd to the PXR_PLUGINPATH_NAME environment variable (in this example: USD-Fileformat-plugins/bin/plugin/usd).

Test (https://github.com/pages/adobe/USD-Fileformat-plugins)

1. Install pip components

2. Install Plugins (Environment variables or Copy plugins to USD install)

Environment Variables

For Windows:

  set PATH=%PATH%;.\USD-Fileformat-plugins\bin\bin;.\USD-Fileformat-plugins\bin\plugin\usd
  set PXR_PLUGINPATH_NAME=%PXR_PLUGINPATH_NAME%;.\USD-Fileformat-plugins\bin\plugin\usd

For Linux/Mac

  export PATH=$PATH:./USD-Fileformat-plugins/bin/bin:./USD-Fileformat-plugins/bin/plugin/usd
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./USD-Fileformat-plugins/bin/lib:./USD-Fileformat-plugins/bin/lib64
  export PXR_PLUGINPATH_NAME=$PXR_PLUGINPATH_NAME:./USD-Fileformat-plugins/bin/plugin/usd

Or Copy plugins:

3. Run Tests

4. (Optional) Update Tests

CI Workflow

Our GitHub Actions setup includes two main workflows to support continuous integration.

1. CI Build Workflow

This workflow is triggered by any push or pull request to the main branch and ensures compatibility with Universal Scene Description (USD) versions:

2. Create USD Release Workflow

This manually triggered workflow involves the following steps:

Usage

USD will now be able to work with the supported files, for example:

Refer to each plugin's README for more details.

Documentation

To generate the documentation go to the project root folder and enter:

doxygen

The resulting documentation will be placed at the docs folder.