use anyhow::Result;
use crate::usd::Attribute;
use super::tokens as tok;
use super::Gprim;
pub trait PointBased: Gprim {
fn points_attr(&self) -> Attribute {
self.prim().attribute(tok::A_POINTS)
}
fn create_points_attr(&self) -> Result<Attribute> {
Ok(self
.prim()
.create_attribute(tok::A_POINTS, "point3f[]")?
.set_custom(false)?)
}
fn normals_attr(&self) -> Attribute {
self.prim().attribute(tok::A_NORMALS)
}
fn create_normals_attr(&self) -> Result<Attribute> {
Ok(self
.prim()
.create_attribute(tok::A_NORMALS, "normal3f[]")?
.set_custom(false)?)
}
fn velocities_attr(&self) -> Attribute {
self.prim().attribute(tok::A_VELOCITIES)
}
fn create_velocities_attr(&self) -> Result<Attribute> {
Ok(self
.prim()
.create_attribute(tok::A_VELOCITIES, "vector3f[]")?
.set_custom(false)?)
}
fn accelerations_attr(&self) -> Attribute {
self.prim().attribute(tok::A_ACCELERATIONS)
}
fn create_accelerations_attr(&self) -> Result<Attribute> {
Ok(self
.prim()
.create_attribute(tok::A_ACCELERATIONS, "vector3f[]")?
.set_custom(false)?)
}
}