Skip to main content

openusd_rs/usd/
property.rs

1use super::Object;
2use crate::{sdf, usd};
3
4/// Base class for [`usd::Attribute`] and [`usd::Relationship`] scenegraph objects.
5#[repr(transparent)]
6pub struct Property<'a>(Object<'a>);
7
8impl<'a> Property<'a> {
9	pub(crate) fn new(stage: &'a usd::Stage, path: sdf::Path) -> Self {
10		Property(Object::new(stage, path))
11	}
12}
13
14impl<'a> std::ops::Deref for Property<'a> {
15	type Target = Object<'a>;
16	fn deref(&self) -> &Self::Target {
17		unsafe { std::mem::transmute(self) }
18	}
19}