Builtin computations for computing information about attributes.
◆ 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) {
ExecBuiltinComputations->computePath).
GetString();
})
.Inputs(
Computation(ExecBuiltinComputations->computePath)
);
A path value used to locate objects in layers or scenegraphs.
A context is the parameter bundle passed to callbacks of computations.
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
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
Computes the provider attribute's value.
The computed value is produced by the first of the following sources that can be resolved:
- An attribute expression, if registered, defines the attribute's computed value.
- 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.
- 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.