Loading...
Searching...
No Matches
Attribute Computations
+ Collaboration diagram for Attribute Computations:

Variables

const TfToken computeValue
 Computes the provider attribute's value.
 
const TfToken computeResolvedValue
 Computes the provider attribute's resolved value as authored in scene description.
 
const TfToken computePath
 Computes the provider's scene path.
 

Detailed Description

Builtin computations for computing information about attributes.

Variable Documentation

◆ computePath

const TfToken computePath

Computes the provider's scene path.

Returns
the path of the provider object, as an SdfPath.

Example

self.PrimComputation(_tokens->pathAsString)
.Callback<std::string>(+[](const VdfContext &ctx) {
return ctx.GetInputValue<SdfPath>(
ExecBuiltinComputations->computePath).GetString();
})
.Inputs(
Computation(ExecBuiltinComputations->computePath)
);
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
A context is the parameter bundle passed to callbacks of computations.
Definition context.h:40
SDF_API const std::string & GetString() const
Returns the expression string used to construct this object.

Definition at line 158 of file builtinComputations.h.

◆ computeResolvedValue

const TfToken computeResolvedValue

Computes the provider attribute's resolved value as authored in scene description.

This computation always produces the resolved value of an attribute, even if an attribute has registered an attribute expression.

Returns
a value whose type is the provider attribute's scalar value type.

Example

self.PrimComputation(_tokens->myComputation)
.Callback<double>(&_MyCallback)
.Inputs(
Attribute(_tokens->myAttribute)
.Computation(ExecBuiltinComputations->computeResolvedValue)
);

Definition at line 138 of file builtinComputations.h.

◆ computeValue

const TfToken computeValue

Computes the provider attribute's value.

The computed value is produced by the first of the following sources that can be resolved:

  1. An attribute expression, if registered, defines the attribute's computed value.
  2. If the provider owns exactly one connection that targets another attribute of the same type that is valid (i.e. it is active, loaded, defined, and non-abstract), then its computed value is the computed value of the targeted attribute.
  3. Otherwise, the computed value is the resolved value of the provider.
Returns
a value whose type is the provider attribute's scalar value type. If the attribute has registered an attribute expression, this may produce a value of any type.
Note
The computation provider must be an attribute.

Example

self.PrimComputation(_tokens->myComputation)
.Callback<double>(&_MyCallback)
.Inputs(
Attribute(_tokens->myAttribute)
.Computation<double>(ExecBuiltinComputations->computeValue)
.Required()
);

Definition at line 114 of file builtinComputations.h.