A USD file format plugin that enables direct reading of Autodesk Maya XGen primitive files (.xpd and .xuv) as USD layers. This plugin integrates XGen groom data seamlessly into USD pipelines without requiring manual conversion.
- Direct USD Integration: Read
.xpdand.xuvfiles directly in USD applications (usdview, Houdini Solaris, etc.) - Lightweight Dependencies: Only requires XGen's
libAdskXpdlibrary, not the full Maya runtime - No Qt Conflicts: Works with usdview and other Qt-based USD tools without library conflicts
- Preserved Metadata: Maintains XGen-specific attributes like face IDs and UV locations
- Maya (2022 or later) - Required for XGen's
libAdskXpd.dyliblibrary - USD (0.20.05 or later) - Pixar's Universal Scene Description
- macOS (Apple Silicon and Intel)
- Linux (experimental)
- Windows (experimental)
# Clone the repository
git clone https://github.com/user/xpdToUsd.git
cd xpdToUsd
# Build (auto-detects Maya and requires USD at ~/work/Usd)
./scripts/build_local.sh# Option A: Source the generated setup script
source install/setup_env.sh
# Option B: Set manually
export PXR_PLUGINPATH_NAME=/path/to/xpdToUsd/install/lib/usd
export DYLD_LIBRARY_PATH=/Applications/Autodesk/maya2026/plug-ins/xgen/lib:$HOME/work/Usd/lib# View XPD in usdview
./scripts/usdview.sh /path/to/groom.xpd
# Or use USD tools directly
usdcat /path/to/groom.xpd
usdview /path/to/groom.xpdThe scripts/build_local.sh script is configured for local development with USD installed at ~/work/Usd:
./scripts/build_local.sh [OPTIONS]
Options:
--clean Clean build directory before building
--skip-install Skip the install step
--verbose Show verbose build output
--install-path Override install path (default: ./install)
--help, -h Show help messagemkdir build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=../install \
-DPXR_USD_LOCATION=/path/to/USD \
-DMAYA_LOCATION=/Applications/Autodesk/maya2026
make -j8
make install| Dependency | Environment Variable | Example Path |
|---|---|---|
| USD | PXR_USD_LOCATION |
~/work/Usd |
| Maya | MAYA_LOCATION |
/Applications/Autodesk/maya2026 |
The included scripts/usdview.sh script sets up the environment and launches usdview:
./scripts/usdview.sh /path/to/groom.xpd [usdview options]from pxr import Sdf, Usd
# Open an XPD file as a USD layer
layer = Sdf.Layer.FindOrOpen('/path/to/groom.xpd')
print(layer.ExportToString())
# Open as a USD stage
stage = Usd.Stage.Open('/path/to/groom.xpd')
for prim in stage.Traverse():
print(prim.GetPath())
# Convert XPD to USDA
layer = Sdf.Layer.FindOrOpen('/path/to/groom.xpd')
layer.Export('/path/to/output.usda')# View XPD structure
usdcat /path/to/groom.xpd
# Convert to USDA format
usdcat /path/to/groom.xpd -o /path/to/output.usda
# Interactive viewer
usdview /path/to/groom.xpd| XPD Data | USD Representation |
|---|---|
| Curve geometry | UsdGeomBasisCurves primitives |
| Face IDs | xpd:faceIds (VtArray) |
| UV locations | xpd:uvLocations (VtArray) |
| Curve widths | Standard widths attribute |
| XUV Data | USD Representation |
|---|---|
| Point positions | UsdGeomPoints primitives |
| Face IDs | xpd:faceIds (VtArray) |
| UV locations | xpd:uvLocations (VtArray) |
| Point IDs | xpd:xuvids (VtArray) |
The plugin only requires XGen's libAdskXpd.dylib at runtime - not the full Maya installation. This is achieved by:
- Minimal linking: The plugin links only to USD libraries and
libAdskXpd - Runtime symbol resolution: Python symbols are resolved at runtime via
-undefined dynamic_lookup - No Qt conflicts: Avoids linking Maya's Qt libraries that conflict with usdview's PySide
Set DYLD_LIBRARY_PATH to include the XGen lib directory:
export DYLD_LIBRARY_PATH=/Applications/Autodesk/maya2026/plug-ins/xgen/lib:$USD_LIB_PATHcd build
ctest --verbose
# Or run directly
./test_xpd_file_formatError: File format plugin for extension 'xpd' not found
Solution: Set PXR_PLUGINPATH_NAME to the plugin install directory:
export PXR_PLUGINPATH_NAME=/path/to/install/lib/usdLibrary not loaded: @rpath/libAdskXpd.dylib
Solution: Add XGen's lib directory to the library path:
export DYLD_LIBRARY_PATH=/Applications/Autodesk/maya2026/plug-ins/xgen/lib:$DYLD_LIBRARY_PATHMaya not found. Set MAYA_LOCATION environment variable...
Solution: Set MAYA_LOCATION to your Maya installation:
export MAYA_LOCATION=/Applications/Autodesk/maya2026In Maya's XGen:
- Select your XGen description
- Change renderer to "XPD"
- Set the output directory
- Click "Create XPD File"
# In a USD Import LOP, reference directly:
/path/to/groom.xpd
from pxr import Usd
import glob
# Batch convert XPD files to USDA
for xpd_file in glob.glob("*.xpd"):
stage = Usd.Stage.Open(xpd_file)
stage.Export(xpd_file.replace('.xpd', '.usda'))XPD is a groom-centric format designed for XGen instancing. When converting USD back to XPD, certain attributes are required:
- xpd:faceIds (VtArray): Per-curve OSD patch index for curve root placement
- xpd:uvLocations (VtArray): Per-curve UV coordinates on the OSD patch
- Uniform CV count: XGen requires all curves to have the same number of control vertices
See LICENSE file for details.