Struct usd::pxr::usd::Attribute

source ·
#[repr(C)]
pub struct Attribute { /* private fields */ }
Expand description

Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.

Implementations§

source§

impl Attribute

source

pub fn set(&self, value: &Value, time: TimeCode)

Set the value of this attribute in the current UsdEditTarget to value at UsdTimeCode time, which defaults to default.

Values are authored without regard to this attribute’s variability. For example, time sample values may be authored on a uniform attribute. However, the USD_VALIDATE_VARIABILITY TF_DEBUG code will cause debug information to be output if values that are inconsistent with this attribute’s variability are authored. See UsdAttribute::GetVariability for more details.

return false and generate an error if type if value does not match this attribute’s defined scene description type exactly, or if there is no existing definition for the attribute.

source

pub fn get(&self, value: &mut Value, time: TimeCode)

Perform value resolution to fetch the value of this attribute at the requested UsdTimeCode time, which defaults to default.

If no value is authored at time but values are authored at other times, this function will return an interpolated value based on the stage’s interpolation type. See Usd_AttributeInterpolation.

This accessor is designed for high performance data-streaming applications, allowing one to fetch data into the same container repeatedly, avoiding memory allocations when possible (VtArray containers will be resized as necessary to conform to the size of data being read).

Values are retrieved without regard to this attribute’s variability. For example, a uniform attribute may retrieve time sample values if any are authored. However, the USD_VALIDATE_VARIABILITY TF_DEBUG code will cause debug information to be output if values that are inconsistent with this attribute’s variability are retrieved. See UsdAttribute::GetVariability for more details.

Return true if there was a value to be read, it was of the type T requested, and we read it successfully - false otherwise.

For more details, see Usd_ValueResolution , and also Usd_AssetPathValuedAttributes for information on how to retrieve resolved asset paths from sdf.AssetPath valued attributes.

source

pub fn get_name(&self) -> Result<&Token>

Return the full name of this object, i.e. the last component of its SdfPath in namespace.

This is equivalent to, but generally cheaper than, get_path().get_name_token()

source

pub fn get_type_name(&self) -> ValueTypeName

Return the “scene description” value type name for this attribute.

source

pub fn has_value(&self) -> bool

Return true if this attribute has an authored default value, authored time samples or a fallback value provided by a registered schema. If the attribute has been Usd_AttributeBlocking “blocked”, then return true if and only if it has a fallback value.

source

pub fn get_metadata(&self, key: &Token, value: &mut Value)

Resolve the requested metadatum named key into value, returning true on success.

Return false if key was not resolvable, or if value's type differed from that of the resolved metadatum.

Note

For any composition-related metadata, as enumerated in GetAllMetadata(), this method will return only the strongest opinion found, not applying the composition rules used by Pcp to process the data. For more processed/composed views of composition data, please refer to the specific interface classes, such as UsdReferences, UsdInherits, UsdVariantSets, etc.

Trait Implementations§

source§

impl Clone for Attribute

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Attribute

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Drop for Attribute

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.