Loading...
Searching...
No Matches
+ 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(+[](const VdfContext &ctx) -> double {
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
VdfByValueOrConstRef< T > GetInputValue(const TfToken &name) const
Returns a value from the input named name of type T.
Definition context.h:299
#define EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA(SchemaType)
Initiates registration of exec computations for the schema SchemaType.
This & Required()
Declares the input is required, i.e., that the computation expects an input value always to be provid...
ValueSpecifier Computation(const TfToken &computationName)
See Computation().
Attribute accessor, valid for providing input to a prim computation.

Definition at line 686 of file computationBuilders.h.

◆ Attribute() [2/2]

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

See Attribute().

Definition at line 762 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(+[](const VdfContext &ctx) -> int {
return ctx.GetInputValue<int>(
ExecBuiltinComputations->computeValue));
})
.Inputs(
Prim().AttributeValue<int>(_tokens->otherAttr).Required());
}
Prim()
On an attribute computation, provides access to the owning prim.
auto AttributeValue(const TfToken &attributeName)
See AttributeValue().

Definition at line 752 of file computationBuilders.h.

◆ Relationship() [1/2]

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

See Relationship().

Definition at line 772 of file computationBuilders.h.

◆ Relationship() [2/2]

Relationship ( const TfToken & relationshipName)
inline

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

See also
TargetedObjects()

Definition at line 711 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(+[](const VdfContext &ctx) -> EfTime {
return ctx.GetInputValue<EfTime>(
ExecBuiltinComputations->computeTime));
})
.Inputs(
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.
Computation value specifier, valid for providing input to any computation.

Definition at line 830 of file computationBuilders.h.