Loading...
Searching...
No Matches

Object accessors provide access to computation providers, the scene objects from which input values are requested. More...

+ Collaboration diagram for Object Accessors:

Functions

 Attribute (const TfToken &attributeName)
 On a prim computation, provides access to the attribute named attributeName.
 
 Relationship (const TfToken &relationshipName)
 On a prim computation, provides access to the relationship named relationshipName.
 
 Prim ()
 On an attribute computation, provides access to the owning prim.
 
Exec_ComputationBuilderAttributeAccessor< Exec_ComputationBuilderProviderTypes::Attribute > Attribute (const TfToken &attributeName)
 See Attribute().
 
Exec_ComputationBuilderRelationshipAccessor< Exec_ComputationBuilderProviderTypes::Attribute > Relationship (const TfToken &relationshipName)
 See Relationship().
 
 Stage ()
 On any computation, provides access to the stage.
 

Detailed Description

Object accessors provide access to computation providers, the scene objects from which input values are requested.

An input registration starts with a sequence of zero or more accessors. If no accessor is present, the origin object, the object that owns the consuming computation, is the provider. Otherwise, starting from that object, the sequence of accessors describes hops through namespace that end at the computation provider.

A sequence of object accessors does not fully specify an input, however. The sequence must be followed by exactly one value specifier to fully specify an input registration.

Function Documentation

◆ Attribute() [1/2]

Attribute ( const TfToken attributeName)
inline

On a prim computation, provides access to the attribute named attributeName.

Example

{
// Register a prim computation that returns the value of an
// attribute owned by the prim.
self.PrimComputation(_tokens->myComputation)
.Callback<double>(+[](const VdfContext &ctx) {
return ctx.GetInputValue<double>(
ExecBuiltinComputations->computeValue));
})
.Inputs(
Attribute(_tokens->doubleAttribute)
.Computation<double>(
ExecBuiltinComputations->computeValue).Required());
}
A context is the parameter bundle passed to callbacks of computations.
Definition: context.h:40
#define EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA(SchemaType)
Initiates registration of exec computations for the schema SchemaType.
ValueSpecifier Computation(const TfToken &computationName)
See Computation().
Attribute accessor, valid for providing input to a prim computation.

Definition at line 673 of file computationBuilders.h.

◆ Attribute() [2/2]

Exec_ComputationBuilderAttributeAccessor< Exec_ComputationBuilderProviderTypes::Attribute > Attribute ( const TfToken attributeName)
inline

See Attribute().

Definition at line 749 of file computationBuilders.h.

◆ Prim()

Prim ( )
inline

On an attribute computation, provides access to the owning prim.

Example

{
// Register an attribute computation on 'attr' that yields the
// value of a sibling attribute 'otherAttr'.
self.AttributeComputation(
_tokens->attr,
_tokens->myComputation)
.Callback<int>(+[](const VdfContext &ctx) {
return ctx.GetInputValue<int>(
ExecBuiltinComputations->computeValue));
})
.Inputs(
Prim().AttributeValue<int>(_tokens->otherAttr).Required());
}
Prim()
On an attribute computation, provides access to the owning prim.

Definition at line 739 of file computationBuilders.h.

◆ Relationship() [1/2]

Relationship ( const TfToken relationshipName)
inline

On a prim computation, provides access to the relationship named relationshipName.

See also
TargetedObjects()

Definition at line 698 of file computationBuilders.h.

◆ Relationship() [2/2]

Exec_ComputationBuilderRelationshipAccessor< Exec_ComputationBuilderProviderTypes::Attribute > Relationship ( const TfToken relationshipName)
inline

See Relationship().

Definition at line 759 of file computationBuilders.h.

◆ Stage()

Stage ( )
inline

On any computation, provides access to the stage.

This accessor can be used to access stage-level builtin computations.

Note: The Stage() accessor must be the sole accessor in any input registration in which it appears.

Example

{
// Register a prim computation that returns the current time.
self.PrimComputation(_tokens->myComputation)
.Callback<EfTime>(+[](const VdfContext &ctx) {
return ctx.GetInputValue<EfTime>(
ExecBuiltinComputations->computeTime));
})
.Inputs(
Stage().Computation<EfTime>(
ExecBuiltinComputations->computeTime).Required());
}
A class that represents a point in time for execution.
Definition: time.h:37
Stage()
On any computation, provides access to the stage.

Definition at line 817 of file computationBuilders.h.