openusd-schemas
Typed Rust APIs for USD's standard schemas, built on openusd.
A USD stage is, underneath, prims carrying loosely typed attributes. This crate
puts the schemas back on top of it: ask a Mesh for its points and face counts,
a Camera for its focal length, a Material for the shader bound to its surface
output, a Skeleton for its joints and skinning weights — as ordinary Rust types,
instead of spelling out attribute names and decoding values by hand. Every view
authors as well as reads.
let mesh = get?.unwrap;
let points = mesh.points_attr.?;
Ten schema families ship here, each behind its own feature flag, so a build compiles only the domains it touches:
UsdGeom · UsdLux · UsdMedia · UsdPhysics · UsdProc · UsdRender ·
UsdShade · UsdSkel · UsdUI · UsdVol
The two crates share a version and release together.
Usage
Add both crates — a schema view is a handle on a stage the core opens — and enable the families you need:
[]
= "0.7"
= { = "0.7", = ["geom", "lux"] }
Nothing is enabled by default.
Feature flags
| Feature | Enables |
|---|---|
geom |
UsdGeom — Imageable, Boundable, Xformable, shapes, Camera, Mesh, Curves, PointInstancer |
lux |
UsdLux — light prims and Light/Shaping/Shadow APIs |
media |
UsdMedia — SpatialAudio and AssetPreviewsAPI |
physics |
UsdPhysics — scenes, joints, collisions, limit/drive APIs |
proc |
UsdProc — GenerativeProcedural |
render |
UsdRender — RenderSettings, RenderProduct, RenderVar, RenderPass |
shade |
UsdShade — materials, shader networks, bindings, UsdPreviewSurface |
skel |
UsdSkel — skeleton reader and skinning toolkit |
ui |
UsdUI — Backdrop, SceneGraphPrimAPI, NodeGraphNodeAPI |
vol |
UsdVol — Volume, OpenVDBAsset, Field3DAsset |
lux, media, proc, skel, and vol build on the geom trait chain and
enable it transitively.
Example
Open a stage with the core crate, then read a Mesh and its point positions and
normals through the geom views:
// `PointBased` is brought in so its inherited accessors resolve on the view.
use ;
use ;
let stage = open?;
if let Some = get?
Values a prim does not author fall back to what the schema declares, resolved
through the core's usd::SchemaRegistry.
License
Licensed under the MIT License.