#[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
impl Attribute
sourcepub fn set(&self, value: &Value, time: TimeCode)
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.
sourcepub fn get(&self, value: &mut Value, time: TimeCode)
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.
sourcepub fn get_name(&self) -> Result<&Token>
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()
sourcepub fn get_type_name(&self) -> ValueTypeName
pub fn get_type_name(&self) -> ValueTypeName
Return the “scene description” value type name for this attribute.
sourcepub fn has_value(&self) -> bool
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.
sourcepub fn get_metadata(&self, key: &Token, value: &mut Value)
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.