Loading...
Searching...
No Matches
Attribute Computations

Builtin computations for computing information about attributes. More...

+ 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

Definition at line 146 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 126 of file builtinComputations.h.

◆ computeValue

const TfToken computeValue

Computes the provider attribute's value.

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 102 of file builtinComputations.h.