pub mod tokens {
pub const API_SCHEMAS: &str = "apiSchemas";
pub const AUTOMATIC: &str = "automatic";
pub const CLIPS: &str = "clips";
pub const CLIP_SETS: &str = "clipSets";
pub const COLLECTION: &str = "collection";
pub const COLLECTION_MULTIPLE_APPLY_TEMPLATE_: &str = "collection:__INSTANCE_NAME__";
pub const COLLECTION_MULTIPLE_APPLY_TEMPLATE_EXCLUDES: &str = "collection:__INSTANCE_NAME__:excludes";
pub const COLLECTION_MULTIPLE_APPLY_TEMPLATE_EXPANSION_RULE: &str = "collection:__INSTANCE_NAME__:expansionRule";
pub const COLLECTION_MULTIPLE_APPLY_TEMPLATE_INCLUDE_ROOT: &str = "collection:__INSTANCE_NAME__:includeRoot";
pub const COLLECTION_MULTIPLE_APPLY_TEMPLATE_INCLUDES: &str = "collection:__INSTANCE_NAME__:includes";
pub const COLLECTION_MULTIPLE_APPLY_TEMPLATE_MEMBERSHIP_EXPRESSION: &str = "collection:__INSTANCE_NAME__:membershipExpression";
pub const COLLECTION_MULTIPLE_APPLY_TEMPLATE_MODE: &str = "collection:__INSTANCE_NAME__:mode";
pub const COLOR_SPACE_DEFINITION: &str = "colorSpaceDefinition";
pub const COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_BLUE_CHROMA: &str = "colorSpaceDefinition:__INSTANCE_NAME__:blueChroma";
pub const COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_GAMMA: &str = "colorSpaceDefinition:__INSTANCE_NAME__:gamma";
pub const COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_GREEN_CHROMA: &str = "colorSpaceDefinition:__INSTANCE_NAME__:greenChroma";
pub const COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_LINEAR_BIAS: &str = "colorSpaceDefinition:__INSTANCE_NAME__:linearBias";
pub const COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_NAME: &str = "colorSpaceDefinition:__INSTANCE_NAME__:name";
pub const COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_RED_CHROMA: &str = "colorSpaceDefinition:__INSTANCE_NAME__:redChroma";
pub const COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_WHITE_POINT: &str = "colorSpaceDefinition:__INSTANCE_NAME__:whitePoint";
pub const COLOR_SPACE_NAME: &str = "colorSpace:name";
pub const CUSTOM: &str = "custom";
pub const EXCLUDE: &str = "exclude";
pub const EXPAND_PRIMS: &str = "expandPrims";
pub const EXPAND_PRIMS_AND_PROPERTIES: &str = "expandPrimsAndProperties";
pub const EXPLICIT_ONLY: &str = "explicitOnly";
pub const EXPRESSION: &str = "expression";
pub const FALLBACK_PRIM_TYPES: &str = "fallbackPrimTypes";
pub const RELATIONSHIP: &str = "relationship";
pub const API_SCHEMA_BASE: &str = "APISchemaBase";
pub const CLIPS_API: &str = "ClipsAPI";
pub const COLLECTION_API: &str = "CollectionAPI";
pub const COLOR_SPACE_API: &str = "ColorSpaceAPI";
pub const COLOR_SPACE_DEFINITION_API: &str = "ColorSpaceDefinitionAPI";
pub const MODEL_API: &str = "ModelAPI";
pub const SCHEMA_BASE: &str = "SchemaBase";
pub const TYPED: &str = "Typed";
}
#[derive(
::std::clone::Clone,
::std::marker::Copy,
::std::fmt::Debug,
::std::cmp::PartialEq,
::std::cmp::Eq,
::std::hash::Hash,
::std::default::Default
)]
pub enum ExpansionRule {
ExplicitOnly,
#[default]
ExpandPrims,
ExpandPrimsAndProperties,
}
impl ExpansionRule {
pub const fn as_token(self) -> &'static str {
match self {
Self::ExplicitOnly => tokens::EXPLICIT_ONLY,
Self::ExpandPrims => tokens::EXPAND_PRIMS,
Self::ExpandPrimsAndProperties => tokens::EXPAND_PRIMS_AND_PROPERTIES,
}
}
pub fn from_token(
token: impl ::std::convert::AsRef<str>,
) -> ::std::option::Option<Self> {
match token.as_ref() {
tokens::EXPLICIT_ONLY => ::std::option::Option::Some(Self::ExplicitOnly),
tokens::EXPAND_PRIMS => ::std::option::Option::Some(Self::ExpandPrims),
tokens::EXPAND_PRIMS_AND_PROPERTIES => {
::std::option::Option::Some(Self::ExpandPrimsAndProperties)
}
_ => ::std::option::Option::None,
}
}
}
::openusd::sdf::impl_token_value!(ExpansionRule);
#[derive(
::std::clone::Clone,
::std::marker::Copy,
::std::fmt::Debug,
::std::cmp::PartialEq,
::std::cmp::Eq,
::std::hash::Hash,
::std::default::Default
)]
pub enum CollectionMode {
#[default]
Automatic,
Relationship,
Expression,
}
impl CollectionMode {
pub const fn as_token(self) -> &'static str {
match self {
Self::Automatic => tokens::AUTOMATIC,
Self::Relationship => tokens::RELATIONSHIP,
Self::Expression => tokens::EXPRESSION,
}
}
pub fn from_token(
token: impl ::std::convert::AsRef<str>,
) -> ::std::option::Option<Self> {
match token.as_ref() {
tokens::AUTOMATIC => ::std::option::Option::Some(Self::Automatic),
tokens::RELATIONSHIP => ::std::option::Option::Some(Self::Relationship),
tokens::EXPRESSION => ::std::option::Option::Some(Self::Expression),
_ => ::std::option::Option::None,
}
}
}
::openusd::sdf::impl_token_value!(CollectionMode);
pub const LIBRARY_NAME: &str = "usd";
pub const SCHEMAS: &::openusd::usd::SchemaFamily<'static> = &::openusd::usd::SchemaFamily::new(
LIBRARY_NAME,
&[
::openusd::usd::SchemaDecl::new(
"SchemaBase",
::openusd::usd::SchemaKind::AbstractBase,
),
::openusd::usd::SchemaDecl::new(
"Typed",
::openusd::usd::SchemaKind::AbstractBase,
)
.bases(&["SchemaBase"]),
::openusd::usd::SchemaDecl::new(
"APISchemaBase",
::openusd::usd::SchemaKind::AbstractBase,
)
.bases(&["SchemaBase"]),
::openusd::usd::SchemaDecl::new(
"ModelAPI",
::openusd::usd::SchemaKind::NonAppliedApi,
)
.bases(&["APISchemaBase"]),
::openusd::usd::SchemaDecl::new(
"ColorSpaceAPI",
::openusd::usd::SchemaKind::SingleApplyApi,
)
.bases(&["APISchemaBase"])
.properties(
&[
::openusd::usd::PropertyDecl::attribute("colorSpace:name", "token")
.uniform(),
],
),
::openusd::usd::SchemaDecl::new(
"ColorSpaceDefinitionAPI",
::openusd::usd::SchemaKind::MultipleApplyApi,
)
.bases(&["APISchemaBase"])
.property_namespace_prefix("colorSpaceDefinition")
.properties(
&[
::openusd::usd::PropertyDecl::attribute(
"colorSpaceDefinition:__INSTANCE_NAME__:name",
"token",
)
.uniform()
.fields(&[::openusd::usd::Field::token("default", "custom")]),
::openusd::usd::PropertyDecl::attribute(
"colorSpaceDefinition:__INSTANCE_NAME__:redChroma",
"float2",
)
.varying()
.fields(
&[
::openusd::usd::Field::new(
"default",
|| ::openusd::sdf::Value::Vec2f(
::openusd::gf::vec2f(1f32, 0f32),
),
),
],
),
::openusd::usd::PropertyDecl::attribute(
"colorSpaceDefinition:__INSTANCE_NAME__:greenChroma",
"float2",
)
.varying()
.fields(
&[
::openusd::usd::Field::new(
"default",
|| ::openusd::sdf::Value::Vec2f(
::openusd::gf::vec2f(0f32, 1f32),
),
),
],
),
::openusd::usd::PropertyDecl::attribute(
"colorSpaceDefinition:__INSTANCE_NAME__:blueChroma",
"float2",
)
.varying()
.fields(
&[
::openusd::usd::Field::new(
"default",
|| ::openusd::sdf::Value::Vec2f(
::openusd::gf::vec2f(0f32, 0f32),
),
),
],
),
::openusd::usd::PropertyDecl::attribute(
"colorSpaceDefinition:__INSTANCE_NAME__:whitePoint",
"float2",
)
.varying()
.fields(
&[
::openusd::usd::Field::new(
"default",
|| ::openusd::sdf::Value::Vec2f(
::openusd::gf::vec2f(0.33333334f32, 0.33333334f32),
),
),
],
),
::openusd::usd::PropertyDecl::attribute(
"colorSpaceDefinition:__INSTANCE_NAME__:gamma",
"float",
)
.varying()
.fields(
&[
::openusd::usd::Field::new(
"default",
|| ::openusd::sdf::Value::Float(1f32),
),
],
),
::openusd::usd::PropertyDecl::attribute(
"colorSpaceDefinition:__INSTANCE_NAME__:linearBias",
"float",
)
.varying()
.fields(
&[
::openusd::usd::Field::new(
"default",
|| ::openusd::sdf::Value::Float(0f32),
),
],
),
],
),
::openusd::usd::SchemaDecl::new(
"CollectionAPI",
::openusd::usd::SchemaKind::MultipleApplyApi,
)
.bases(&["APISchemaBase"])
.property_namespace_prefix("collection")
.properties(
&[
::openusd::usd::PropertyDecl::attribute(
"collection:__INSTANCE_NAME__:expansionRule",
"token",
)
.uniform()
.fields(
&[
::openusd::usd::Field::strings(
"allowedTokens",
&["explicitOnly", "expandPrims", "expandPrimsAndProperties"],
),
::openusd::usd::Field::token("default", "expandPrims"),
],
),
::openusd::usd::PropertyDecl::attribute(
"collection:__INSTANCE_NAME__:includeRoot",
"bool",
)
.uniform(),
::openusd::usd::PropertyDecl::relationship(
"collection:__INSTANCE_NAME__:includes",
)
.uniform(),
::openusd::usd::PropertyDecl::relationship(
"collection:__INSTANCE_NAME__:excludes",
)
.uniform(),
::openusd::usd::PropertyDecl::attribute(
"collection:__INSTANCE_NAME__:membershipExpression",
"pathExpression",
)
.uniform(),
::openusd::usd::PropertyDecl::attribute(
"collection:__INSTANCE_NAME__:mode",
"token",
)
.uniform()
.fields(
&[
::openusd::usd::Field::strings(
"allowedTokens",
&["automatic", "relationship", "expression"],
),
::openusd::usd::Field::token("default", "automatic"),
],
),
::openusd::usd::PropertyDecl::attribute(
"collection:__INSTANCE_NAME__",
"opaque",
)
.uniform(),
],
),
::openusd::usd::SchemaDecl::new(
"ClipsAPI",
::openusd::usd::SchemaKind::NonAppliedApi,
)
.bases(&["APISchemaBase"]),
],
);
pub trait ModelAPISchema: ::openusd::usd::APISchemaBase {}
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ModelAPI(::openusd::usd::Prim);
impl ModelAPI {
pub fn from_prim_unchecked(prim: ::openusd::usd::Prim) -> Self {
Self(prim)
}
}
impl ::openusd::usd::SchemaBase for ModelAPI {
const KIND: ::openusd::usd::SchemaKind = ::openusd::usd::SchemaKind::NonAppliedApi;
fn prim(&self) -> &::openusd::usd::Prim {
&self.0
}
}
impl ::std::ops::Deref for ModelAPI {
type Target = ::openusd::usd::Prim;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl ModelAPISchema for ModelAPI {}
impl ::openusd::usd::APISchemaBase for ModelAPI {}
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ColorSpaceAPI(::openusd::usd::Prim);
impl ColorSpaceAPI {
pub fn from_prim_unchecked(prim: ::openusd::usd::Prim) -> Self {
Self(prim)
}
pub fn apply(prim: &::openusd::usd::Prim) -> ::openusd::Result<Self> {
::std::result::Result::Ok(Self(prim.clone().apply_api(tokens::COLOR_SPACE_API)?))
}
pub fn can_apply(
prim: &::openusd::usd::Prim,
) -> ::std::result::Result<(), ::openusd::usd::ApplyApiError> {
prim.can_apply_api(tokens::COLOR_SPACE_API)
}
pub fn from_prim(
prim: ::openusd::usd::Prim,
) -> ::openusd::Result<::std::option::Option<Self>> {
::std::result::Result::Ok(
prim.has_api_schema(tokens::COLOR_SPACE_API)?.then_some(Self(prim)),
)
}
pub fn get(
stage: &::openusd::usd::Stage,
path: impl ::openusd::sdf::IntoPath,
) -> ::openusd::Result<::std::option::Option<Self>> {
Self::from_prim(stage.prim(path)?)
}
pub fn color_space_name_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(tokens::COLOR_SPACE_NAME)
}
pub fn color_space_name(
&self,
) -> ::openusd::Result<::std::option::Option<::openusd::tf::Token>> {
self.color_space_name_attr().get::<::openusd::tf::Token>()
}
pub fn color_space_name_attr_builder(
&self,
) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
tokens::COLOR_SPACE_NAME,
::openusd::sdf::ValueTypeName::TOKEN,
)
.custom(false)
.variability(::openusd::sdf::Variability::Uniform)
}
pub fn create_color_space_name_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.color_space_name_attr_builder().build()?)
}
}
impl ::openusd::usd::SchemaBase for ColorSpaceAPI {
const KIND: ::openusd::usd::SchemaKind = ::openusd::usd::SchemaKind::SingleApplyApi;
fn prim(&self) -> &::openusd::usd::Prim {
&self.0
}
}
impl ::std::ops::Deref for ColorSpaceAPI {
type Target = ::openusd::usd::Prim;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl ::openusd::usd::APISchemaBase for ColorSpaceAPI {}
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ColorSpaceDefinitionAPI {
prim: ::openusd::usd::Prim,
name: ::openusd::tf::Token,
}
impl ColorSpaceDefinitionAPI {
pub fn from_prim_unchecked(
prim: ::openusd::usd::Prim,
name: impl ::std::convert::Into<::openusd::tf::Token>,
) -> Self {
Self { prim, name: name.into() }
}
pub fn name(&self) -> &::openusd::tf::Token {
&self.name
}
pub fn apply(
prim: &::openusd::usd::Prim,
name: impl ::std::convert::Into<::openusd::tf::Token>,
) -> ::openusd::Result<Self> {
let name = name.into();
let applied = ::openusd::usd::SchemaRegistry::make_applied_name(
tokens::COLOR_SPACE_DEFINITION_API,
name.as_str(),
);
::std::result::Result::Ok(
Self::from_prim_unchecked(prim.clone().apply_api(applied)?, name),
)
}
pub fn get_instance(
prim: &::openusd::usd::Prim,
name: impl ::std::convert::Into<::openusd::tf::Token>,
) -> ::openusd::Result<::std::option::Option<Self>> {
let name = name.into();
let applied = ::openusd::usd::SchemaRegistry::make_applied_name(
tokens::COLOR_SPACE_DEFINITION_API,
name.as_str(),
);
let carried = prim.has_api_schema(applied)?;
::std::result::Result::Ok(
carried.then(|| Self::from_prim_unchecked(prim.clone(), name)),
)
}
pub fn can_apply(
prim: &::openusd::usd::Prim,
name: &str,
) -> ::std::result::Result<(), ::openusd::usd::ApplyApiError> {
prim.can_apply_api(
::openusd::usd::SchemaRegistry::make_applied_name(
tokens::COLOR_SPACE_DEFINITION_API,
name,
),
)
}
pub fn get_all(
prim: &::openusd::usd::Prim,
) -> ::openusd::Result<::std::vec::Vec<Self>> {
prim.api_schema_instance_names(tokens::COLOR_SPACE_DEFINITION_API)
.map(|names| {
names
.into_iter()
.map(|name| Self::from_prim_unchecked(prim.clone(), name))
.collect()
})
}
pub fn is_schema_property_base_name(base_name: &str) -> bool {
::std::matches!(
base_name, "name" | "redChroma" | "greenChroma" | "blueChroma" | "whitePoint"
| "gamma" | "linearBias"
)
}
pub fn instance_at_path(
path: &::openusd::sdf::Path,
) -> ::std::option::Option<(::openusd::sdf::Path, ::openusd::tf::Token)> {
let (prim, property) = path.split_property()?;
if !property.split(':').all(::openusd::sdf::Path::is_valid_identifier) {
return ::std::option::Option::None;
}
let instance = property.strip_prefix("colorSpaceDefinition")?.strip_prefix(':')?;
let base_name = instance.rsplit(':').next()?;
match Self::is_schema_property_base_name(base_name) {
true => ::std::option::Option::None,
false => {
::std::option::Option::Some((prim, ::openusd::tf::Token::from(instance)))
}
}
}
pub fn name_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_NAME,
self.name.as_str(),
),
)
}
pub fn name_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_NAME,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::TOKEN,
)
.custom(false)
.variability(::openusd::sdf::Variability::Uniform)
}
pub fn create_name_attr(&self) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.name_attr_builder().build()?)
}
pub fn red_chroma_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_RED_CHROMA,
self.name.as_str(),
),
)
}
pub fn red_chroma(
&self,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.red_chroma_attr().get::<::openusd::gf::Vec2f>()
}
pub fn red_chroma_at(
&self,
time: impl ::std::convert::Into<::std::option::Option<::openusd::usd::TimeCode>>,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.red_chroma_attr().get_at::<::openusd::gf::Vec2f>(time)
}
pub fn red_chroma_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_RED_CHROMA,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::FLOAT2,
)
.custom(false)
}
pub fn create_red_chroma_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.red_chroma_attr_builder().build()?)
}
pub fn green_chroma_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_GREEN_CHROMA,
self.name.as_str(),
),
)
}
pub fn green_chroma(
&self,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.green_chroma_attr().get::<::openusd::gf::Vec2f>()
}
pub fn green_chroma_at(
&self,
time: impl ::std::convert::Into<::std::option::Option<::openusd::usd::TimeCode>>,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.green_chroma_attr().get_at::<::openusd::gf::Vec2f>(time)
}
pub fn green_chroma_attr_builder(
&self,
) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_GREEN_CHROMA,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::FLOAT2,
)
.custom(false)
}
pub fn create_green_chroma_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.green_chroma_attr_builder().build()?)
}
pub fn blue_chroma_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_BLUE_CHROMA,
self.name.as_str(),
),
)
}
pub fn blue_chroma(
&self,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.blue_chroma_attr().get::<::openusd::gf::Vec2f>()
}
pub fn blue_chroma_at(
&self,
time: impl ::std::convert::Into<::std::option::Option<::openusd::usd::TimeCode>>,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.blue_chroma_attr().get_at::<::openusd::gf::Vec2f>(time)
}
pub fn blue_chroma_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_BLUE_CHROMA,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::FLOAT2,
)
.custom(false)
}
pub fn create_blue_chroma_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.blue_chroma_attr_builder().build()?)
}
pub fn white_point_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_WHITE_POINT,
self.name.as_str(),
),
)
}
pub fn white_point(
&self,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.white_point_attr().get::<::openusd::gf::Vec2f>()
}
pub fn white_point_at(
&self,
time: impl ::std::convert::Into<::std::option::Option<::openusd::usd::TimeCode>>,
) -> ::openusd::Result<::std::option::Option<::openusd::gf::Vec2f>> {
self.white_point_attr().get_at::<::openusd::gf::Vec2f>(time)
}
pub fn white_point_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_WHITE_POINT,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::FLOAT2,
)
.custom(false)
}
pub fn create_white_point_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.white_point_attr_builder().build()?)
}
pub fn gamma_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_GAMMA,
self.name.as_str(),
),
)
}
pub fn gamma(&self) -> ::openusd::Result<::std::option::Option<f32>> {
self.gamma_attr().get::<f32>()
}
pub fn gamma_at(
&self,
time: impl ::std::convert::Into<::std::option::Option<::openusd::usd::TimeCode>>,
) -> ::openusd::Result<::std::option::Option<f32>> {
self.gamma_attr().get_at::<f32>(time)
}
pub fn gamma_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_GAMMA,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::FLOAT,
)
.custom(false)
}
pub fn create_gamma_attr(&self) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.gamma_attr_builder().build()?)
}
pub fn linear_bias_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_LINEAR_BIAS,
self.name.as_str(),
),
)
}
pub fn linear_bias(&self) -> ::openusd::Result<::std::option::Option<f32>> {
self.linear_bias_attr().get::<f32>()
}
pub fn linear_bias_at(
&self,
time: impl ::std::convert::Into<::std::option::Option<::openusd::usd::TimeCode>>,
) -> ::openusd::Result<::std::option::Option<f32>> {
self.linear_bias_attr().get_at::<f32>(time)
}
pub fn linear_bias_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLOR_SPACE_DEFINITION_MULTIPLE_APPLY_TEMPLATE_LINEAR_BIAS,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::FLOAT,
)
.custom(false)
}
pub fn create_linear_bias_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.linear_bias_attr_builder().build()?)
}
}
impl ::openusd::usd::SchemaBase for ColorSpaceDefinitionAPI {
const KIND: ::openusd::usd::SchemaKind = ::openusd::usd::SchemaKind::MultipleApplyApi;
fn prim(&self) -> &::openusd::usd::Prim {
&self.prim
}
}
impl ::std::ops::Deref for ColorSpaceDefinitionAPI {
type Target = ::openusd::usd::Prim;
fn deref(&self) -> &Self::Target {
&self.prim
}
}
impl ::openusd::usd::APISchemaBase for ColorSpaceDefinitionAPI {}
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CollectionAPI {
prim: ::openusd::usd::Prim,
name: ::openusd::tf::Token,
}
impl CollectionAPI {
pub fn from_prim_unchecked(
prim: ::openusd::usd::Prim,
name: impl ::std::convert::Into<::openusd::tf::Token>,
) -> Self {
Self { prim, name: name.into() }
}
pub fn name(&self) -> &::openusd::tf::Token {
&self.name
}
pub fn apply(
prim: &::openusd::usd::Prim,
name: impl ::std::convert::Into<::openusd::tf::Token>,
) -> ::openusd::Result<Self> {
let name = name.into();
let applied = ::openusd::usd::SchemaRegistry::make_applied_name(
tokens::COLLECTION_API,
name.as_str(),
);
::std::result::Result::Ok(
Self::from_prim_unchecked(prim.clone().apply_api(applied)?, name),
)
}
pub fn get_instance(
prim: &::openusd::usd::Prim,
name: impl ::std::convert::Into<::openusd::tf::Token>,
) -> ::openusd::Result<::std::option::Option<Self>> {
let name = name.into();
let applied = ::openusd::usd::SchemaRegistry::make_applied_name(
tokens::COLLECTION_API,
name.as_str(),
);
let carried = prim.has_api_schema(applied)?;
::std::result::Result::Ok(
carried.then(|| Self::from_prim_unchecked(prim.clone(), name)),
)
}
pub fn can_apply(
prim: &::openusd::usd::Prim,
name: &str,
) -> ::std::result::Result<(), ::openusd::usd::ApplyApiError> {
prim.can_apply_api(
::openusd::usd::SchemaRegistry::make_applied_name(
tokens::COLLECTION_API,
name,
),
)
}
pub fn get_all(
prim: &::openusd::usd::Prim,
) -> ::openusd::Result<::std::vec::Vec<Self>> {
prim.api_schema_instance_names(tokens::COLLECTION_API)
.map(|names| {
names
.into_iter()
.map(|name| Self::from_prim_unchecked(prim.clone(), name))
.collect()
})
}
pub fn is_schema_property_base_name(base_name: &str) -> bool {
::std::matches!(
base_name, "expansionRule" | "includeRoot" | "includes" | "excludes" |
"membershipExpression" | "mode" | ""
)
}
pub fn instance_at_path(
path: &::openusd::sdf::Path,
) -> ::std::option::Option<(::openusd::sdf::Path, ::openusd::tf::Token)> {
let (prim, property) = path.split_property()?;
if !property.split(':').all(::openusd::sdf::Path::is_valid_identifier) {
return ::std::option::Option::None;
}
let instance = property.strip_prefix("collection")?.strip_prefix(':')?;
let base_name = instance.rsplit(':').next()?;
match Self::is_schema_property_base_name(base_name) {
true => ::std::option::Option::None,
false => {
::std::option::Option::Some((prim, ::openusd::tf::Token::from(instance)))
}
}
}
pub fn expansion_rule_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_EXPANSION_RULE,
self.name.as_str(),
),
)
}
pub fn expansion_rule(
&self,
) -> ::openusd::Result<::std::option::Option<ExpansionRule>> {
self.expansion_rule_attr().get::<ExpansionRule>()
}
pub fn expansion_rule_attr_builder(
&self,
) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_EXPANSION_RULE,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::TOKEN,
)
.custom(false)
.variability(::openusd::sdf::Variability::Uniform)
}
pub fn create_expansion_rule_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.expansion_rule_attr_builder().build()?)
}
pub fn include_root_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_INCLUDE_ROOT,
self.name.as_str(),
),
)
}
pub fn include_root(&self) -> ::openusd::Result<::std::option::Option<bool>> {
self.include_root_attr().get::<bool>()
}
pub fn include_root_attr_builder(
&self,
) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_INCLUDE_ROOT,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::BOOL,
)
.custom(false)
.variability(::openusd::sdf::Variability::Uniform)
}
pub fn create_include_root_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.include_root_attr_builder().build()?)
}
pub fn includes_rel(&self) -> ::openusd::usd::Relationship {
self.relationship(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_INCLUDES,
self.name.as_str(),
),
)
}
pub fn includes_rel_builder(&self) -> ::openusd::usd::RelationshipBuilder<'static> {
self.relationship_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_INCLUDES,
self.name.as_str(),
),
)
.custom(false)
}
pub fn create_includes_rel(
&self,
) -> ::openusd::Result<::openusd::usd::Relationship> {
::std::result::Result::Ok(self.includes_rel_builder().build()?)
}
pub fn excludes_rel(&self) -> ::openusd::usd::Relationship {
self.relationship(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_EXCLUDES,
self.name.as_str(),
),
)
}
pub fn excludes_rel_builder(&self) -> ::openusd::usd::RelationshipBuilder<'static> {
self.relationship_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_EXCLUDES,
self.name.as_str(),
),
)
.custom(false)
}
pub fn create_excludes_rel(
&self,
) -> ::openusd::Result<::openusd::usd::Relationship> {
::std::result::Result::Ok(self.excludes_rel_builder().build()?)
}
pub fn membership_expression_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_MEMBERSHIP_EXPRESSION,
self.name.as_str(),
),
)
}
pub fn membership_expression(
&self,
) -> ::openusd::Result<::std::option::Option<::openusd::sdf::PathExpression>> {
self.membership_expression_attr().get::<::openusd::sdf::PathExpression>()
}
pub fn membership_expression_attr_builder(
&self,
) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_MEMBERSHIP_EXPRESSION,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::PATH_EXPRESSION,
)
.custom(false)
.variability(::openusd::sdf::Variability::Uniform)
}
pub fn create_membership_expression_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.membership_expression_attr_builder().build()?)
}
pub fn mode_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_MODE,
self.name.as_str(),
),
)
}
pub fn mode(&self) -> ::openusd::Result<::std::option::Option<CollectionMode>> {
self.mode_attr().get::<CollectionMode>()
}
pub fn mode_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_MODE,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::TOKEN,
)
.custom(false)
.variability(::openusd::sdf::Variability::Uniform)
}
pub fn create_mode_attr(&self) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.mode_attr_builder().build()?)
}
pub fn collection_attr(&self) -> ::openusd::usd::Attribute {
self.attribute(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_,
self.name.as_str(),
),
)
}
pub fn collection_attr_builder(&self) -> ::openusd::usd::AttributeBuilder<'static> {
self.attribute_builder(
::openusd::usd::SchemaRegistry::make_multiple_apply_name_instance(
tokens::COLLECTION_MULTIPLE_APPLY_TEMPLATE_,
self.name.as_str(),
),
::openusd::sdf::ValueTypeName::OPAQUE,
)
.custom(false)
.variability(::openusd::sdf::Variability::Uniform)
}
pub fn create_collection_attr(
&self,
) -> ::openusd::Result<::openusd::usd::Attribute> {
::std::result::Result::Ok(self.collection_attr_builder().build()?)
}
}
impl ::openusd::usd::SchemaBase for CollectionAPI {
const KIND: ::openusd::usd::SchemaKind = ::openusd::usd::SchemaKind::MultipleApplyApi;
fn prim(&self) -> &::openusd::usd::Prim {
&self.prim
}
}
impl ::std::ops::Deref for CollectionAPI {
type Target = ::openusd::usd::Prim;
fn deref(&self) -> &Self::Target {
&self.prim
}
}
impl ::openusd::usd::APISchemaBase for CollectionAPI {}
pub trait ClipsAPISchema: ::openusd::usd::APISchemaBase {}
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ClipsAPI(::openusd::usd::Prim);
impl ClipsAPI {
pub fn from_prim_unchecked(prim: ::openusd::usd::Prim) -> Self {
Self(prim)
}
}
impl ::openusd::usd::SchemaBase for ClipsAPI {
const KIND: ::openusd::usd::SchemaKind = ::openusd::usd::SchemaKind::NonAppliedApi;
fn prim(&self) -> &::openusd::usd::Prim {
&self.0
}
}
impl ::std::ops::Deref for ClipsAPI {
type Target = ::openusd::usd::Prim;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl ClipsAPISchema for ClipsAPI {}
impl ::openusd::usd::APISchemaBase for ClipsAPI {}