Skip to content

FloatyMonkey/openusd-rs

Repository files navigation

OpenUSD-rs

Implementation of OpenUSD in pure Rust

crates.io docs.rs ci

This library supports reading binary USDC and text USDA files and includes support for composition. It implements the low-level SDF API for single-layer access and the high-level USD API for working with composed stages. It also provides schemas for easy access to common domain concepts like geometry, lights and skinning.

We're focused on reaching compliance with the USD Core Specification. Expect major API changes during these early stages of development. Currently the codebase mostly reflects the needs of our own engine but contributions are more than welcome.

Example

use openusd_rs::{gf, vt, usd, usd_geom};

let stage = usd::Stage::open("RootLayer.usd");
let mesh = usd_geom::Mesh::define(&stage, "/Path/To/Mesh/Prim");

// These are arrays of 3D vectors and integers,
// they can be used directly with a graphics API.
let points = mesh.points_attr().get::<vt::Array<gf::Vec3f>>();
let normals = mesh.normals_attr().get::<vt::Array<gf::Vec3f>>();
let indices = usd_geom::triangulate(&mesh);

// Iterate over all top level prims on the stage.
for prim in stage.pseudo_root().children() {
    println!("{}", prim.path());
}

Features

  • File formats

    • USDC (binary): most features supported
    • USDA (text): support for parsing composition is being worked on
    • USDZ (zip archive): planned
  • Composition

    Initial composition support is implemented. Ongoing work aims to pass more compliance tests (see the tests directory).

  • Schemas

    • Rust code is generated automatically from USD schema definitions.
    • Additional bespoke APIs for working with schemas include:
      • usdGeom: Primvars and Xform
      • usdSkel: Topology

Installation

Add openusd-rs to the [dependencies] section of your Cargo.toml.

Credits

Based on Pixar Animations Studios OpenUSD.

Maintained by Lauro Oyen (@laurooyen).

Licensed under MIT or Apache-2.0.

About

Implementation of OpenUSD in pure Rust

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Sponsor this project

Languages