openusd-rs 0.1.0

Work in progress, opinionated implementation of OpenUSD in pure Rust
Documentation
  • Coverage
  • 20.39%
    63 out of 309 items documented0 out of 94 items with examples
  • Size
  • Source code size: 161.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.7 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 34s Average build duration of successful builds.
  • all releases: 34s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • FloatyMonkey/openusd-rs
    37 3 4
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • laurooyen

OpenUSD-rs

Work in progress, opinionated implementation of OpenUSD in pure Rust

For now, the focus is on reading from flattened files. It is already possible to extract basic scene information for rendering. Expect major API changes during the early stages of development. Once the official OpenUSD specification is released, we aim to be compliant where possible.

Currently 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("FlattenedUsdFile.usdc");
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());
}

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.