PrimitiveVariableType
Converts the type and/or geometric interpretation of primitive variables.
user
Container for user-defined plugs. Nodes should never make their own plugs here, so users are free to do as they wish.
out
The processed output scene.
enabled
The on/off state of the node. When it is off, the node outputs the input scene unchanged.
in
The input scene
filter
The filter used to control which parts of the scene are processed. A Filter node should be connected here.
primitiveVariables
The names of the primitive variables to be converted. These should be separated by spaces and can use Gaffer’s standard wildcards to match multiple variables.
type
The type the primitive variables are converted to. When converting arrays, this is the type of each element in the destination array.
Primitive variables are converted using the following rules :
Single-component sources, such as
floatorint, are applied to every component of the destination. For example, afloatprimitive variable with a value of2is converted toV2f( 2, 2 ), andV3f/Color3f( 2, 2, 2 ).Multi-component sources, such as
V3forColor4f, are applied per-component. Components missing from the destination are dropped, and extra components are set to zero. For example,Color4f( 1, 2, 3, 4 )becomesV3f/Color3f( 1, 2, 3 ),V2f( 1, 2 ), and1.V2f( 1, 2 )becomesV3f/Color3f( 1, 2, 0 ).The alpha of a
Color4fdestination is the exception to the above rules and is instead set to1. For example, afloatsource with a value of2becomesColor4f( 2, 2, 2, 1 )andV2f(1, 2)becomesColor4f( 1, 2, 0, 1 ).Floating point values are truncated towards zero when converted to an integer, so
2.75becomes2, and-2.75becomes-2.Values converted to integer types are clamped to the range of the destination type.
interpretation
The geometric interpretation of each primitive variable. Only relevant
for geometric types, such as V2f and V3f.
Tip
Geometric types converted from non-geometric types, such as
float and Color3f, default to None unless an interpretation
is chosen here.