# pxr_rs
Rust interface for [OpenUSD](https://openusd.org). ## Status This project is in early development and is not ready for production use. Not all of the OpenUSD API is currently exposed. Documentation and examples are currently lacking but will be the focus once the crates are more stable. Currently, OpenUSD 22.11 compiled via build options specified via the [default features of pxr_sys](pxr_sys/Cargo.toml) is the primary target upon which the project is being developed. ## Overview The workspace contains these packages: - **[pxr_build](pxr_build):** Helper crate for building OpenUSD bindings - **[pxr_sys](pxr_sys):** Unsafe Rust bindings for OpenUSD - **[pxr](pxr):** Safe Rust bindings for OpenUSD (WIP) Most of the bindings are automatically generated from the OpenUSD headers using [autocxx](https://github.com/google/autocxx), while some are hand-written via [rust-cpp](https://github.com/mystor/rust-cpp) and additional macros inside [pxr_build](pxr_build). The C++ library of OpenUSD can be automatically downloaded and compiled during the cargo build process if the `vendored` feature is enabled. ## Dependencies The complete list of dependencies can be found within [`Dockerfile`](Dockerfile). Enabling of additional non-default features might require additional dependencies. This is currently not tested/documented. ## Instructions ### Rust Add `pxr` as a Rust dependency to your [`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html) manifest. ```toml [dependencies] pxr = { version = "0.2" } ``` Note that the first build might take up to 50 minutes because OpenUSD will be automatically downloaded and compiled with the `vendored` feature enabled. The artifacts will be cached in `OUT_DIR` and reused for subsequent builds. Alternatively, you can specify the path to an existing OpenUSD installation directory via the following environment variable. ```bash export OPENUSD_PATH=/path/to/pxr/openusd ``` It is highly recommended to use `lld` or `mold` linker because `ld` might currently fail.