use openusd::sdf;
pub(crate) use ::openusd;
#[cfg(any(
feature = "geom",
feature = "lux",
feature = "media",
feature = "physics",
feature = "proc",
feature = "render",
feature = "shade",
feature = "skel",
feature = "ui",
feature = "vol"
))]
mod common;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum SchemaError {
#[error(transparent)]
Core(#[from] openusd::Error),
#[error("`{op}` is not an xformOp kind")]
UnknownXformOp {
op: String,
},
#[error("xformOp `{op}` matrix is singular and cannot be inverted")]
SingularTransform {
op: String,
},
#[error("xformOpOrder on `{prim}`: `!resetXformStack!` is only valid at index 0, found at index {index}")]
InvalidOpOrder {
prim: sdf::Path,
index: usize,
},
#[error("connection chain at {attribute} is deeper than {max} hops")]
ConnectionDepthExceeded {
attribute: sdf::Path,
max: usize,
},
#[error("Volume field name must not be empty")]
EmptyFieldName,
#[error("invalid render context {context:?}")]
InvalidRenderContext {
context: String,
},
}
impl From<openusd::usd::StageAuthoringError> for SchemaError {
fn from(error: openusd::usd::StageAuthoringError) -> Self {
Self::Core(error.into())
}
}
impl From<openusd::pcp::QueryError> for SchemaError {
fn from(error: openusd::pcp::QueryError) -> Self {
Self::Core(error.into())
}
}
impl From<sdf::PathParseError> for SchemaError {
fn from(error: sdf::PathParseError) -> Self {
Self::Core(error.into())
}
}
impl From<sdf::CastError> for SchemaError {
fn from(error: sdf::CastError) -> Self {
Self::Core(error.into())
}
}
impl From<sdf::ValueTypeError> for SchemaError {
fn from(error: sdf::ValueTypeError) -> Self {
Self::Core(openusd::usd::StageAuthoringError::from(error).into())
}
}
#[cfg(feature = "geom")]
pub mod geom;
#[cfg(feature = "lux")]
pub mod lux;
#[cfg(feature = "media")]
pub mod media;
#[cfg(feature = "physics")]
pub mod physics;
#[cfg(feature = "proc")]
pub mod proc;
#[cfg(feature = "render")]
pub mod render;
#[cfg(feature = "shade")]
pub mod shade;
#[cfg(feature = "skel")]
pub mod skel;
#[cfg(feature = "ui")]
pub mod ui;
#[cfg(feature = "vol")]
pub mod vol;