Skip to main content

openusd_rs/usd/
relationschip.rs

1use super::Property;
2use crate::{sdf, usd};
3
4/// A [`usd::Relationship`] creates dependencies between scenegraph objects by allowing a prim to target other prims, attributes, or relationships.
5#[repr(transparent)]
6pub struct Relationship<'a>(Property<'a>);
7
8impl<'a> Relationship<'a> {
9	pub(crate) fn new(stage: &'a usd::Stage, path: sdf::Path) -> Self {
10		Relationship(Property::new(stage, path))
11	}
12}
13
14impl<'a> std::ops::Deref for Relationship<'a> {
15	type Target = Property<'a>;
16	fn deref(&self) -> &Self::Target {
17		unsafe { std::mem::transmute(self) }
18	}
19}