Pixar's Universal Scene Description (USD) Core Python Library
Pixar's Universal Scene Description (USD) is a robust system designed for scalably encoding and interchanging static and time-sampled 3D geometry, shading, and lighting data across various Digital Content Creation applications. The `usd-core` package, available on PyPI, provides the fundamental Python bindings for authoring, composing, and reading USD data. It is actively maintained by Pixar Animation Studios, with new versions typically released every 3-4 months. The current version is 26.3, continuously evolving the OpenUSD ecosystem.
Warnings
- breaking Python 3.8 support is deprecated as of a recent OpenUSD release (noted in CHANGELOG) and will be removed in the subsequent release. Users on Python 3.8 should plan to upgrade.
- gotcha The `usd-core` PyPI package provides only the core USD libraries for authoring, composing, and reading. It *does not* include optional plugins, imaging features, or tools like `usdview` (Pixar's scene inspector). For a full USD experience, including `usdview` and other utilities, you generally need to download pre-built binaries from NVIDIA or build OpenUSD from source.
- deprecated The older `displayName`, `displayGroup`, and `hidden` metadata APIs within `UsdUI` were deprecated in v25.11 in favor of a new, dictionary-valued `uiHints` metadata field.
- breaking Beginning with the 26.03 release, the `usd-core` PyPI package utilizes the C++11 ABI. Furthermore, clients building C++ code against OpenUSD with Visual Studio must enable the `/permissive-` (strict standards conformance) flag.
- deprecated Support for negative layer offset scale has been removed, and the `PCP_ALLOW_NEGATIVE_LAYER_OFFSET_SCALE` environment variable has been removed. Additionally, the `SDF_FILE_FORMAT_LEGACY_IMPORT` environment variable is now set to 'warn' by default, indicating that legacy `.sdf` file format header support will be removed in a future release.
- gotcha Users on Windows running Python 3.8+ within `conda` environments may encounter DLL loading failures (e.g., `DLL load failed while importing _tf`). This was addressed in USD 22.03.
Install
-
pip install usd-core -
pip install usd-core types-usd
Imports
- Usd, UsdGeom, Sdf, Gf
from pxr import Usd, UsdGeom, Sdf, Gf
Quickstart
from pxr import Usd, UsdGeom
import os
# Create a new USD stage in memory or on disk
output_filename = os.environ.get('USD_OUTPUT_FILE', 'HelloWorld.usda')
stage = Usd.Stage.CreateNew(output_filename)
# Define a root transform prim at the path /hello
xformPrim = UsdGeom.Xform.Define(stage, '/hello')
# Define a sphere prim nested under the transform at /hello/world
spherePrim = UsdGeom.Sphere.Define(stage, '/hello/world')
# Set a radius for the sphere
spherePrim.GetRadiusAttr().Set(2.0)
# Save the stage to a file
stage.GetRootLayer().Save()
print(f"Created {output_filename} with a sphere at /hello/world")