|On this page|
This node is similar to the Attribute Wrangle SOP.
For each prim selected in the Primitives parameter, the node runs the VEX snippet.
You can read current attribute values using
@name, and create/update attribute values by writing to an
@variable with the same name as the attribute.
You can also use VEX USD functions to manipulate the primitive.
The Bindings tab lets you explicitly map VEX variable names to USD attributes.
This is useful when USD attributes have names that are not valid VEX variable names.
For attributes that don’t exist yet, you can specify an explicit USD type.
@primpathis the scene graph path of the current prim.
elemnumis the index of the current prim in the list of selected prims, and
numelemis the total number of selected prims. However, the meanings of these variables are different when Run on elements of array attributes is on.
The following “convenience” built-ins are available as well:
usd_name( 0, @primpath )
Current prim’s name
Current prim’s schema name
Current prim’s kind
Current prim’s purpose
Current prim’s draw mode
1if current prim is active
1if primitive is visible
The prim’s current variant doesn’t have a built-in, but you can get it using a function call:
usd_variantselection(0, @primpath, "variant_set_name")
This node can run the snippet over each prim, or over each element in each array attribute on each prim. See the Run On Elements of Array Attributes parameter.
When using the sampling parameters on this node, be aware that only the setting of attributes are applied to the USD stage after the first sample is evaluated. Other operations such as the creation of primitives or setting metadata (which cannot vary over time) will only run for the first sample.
Cooking multiple samples may require cooking other nodes multiple times. If your VEX code refers to a SOP network, for example, that SOP network may be cooked for each time sample. If a LOP node connected to the input of this node is time dependent, this input node will also be recooked for each time sample on this node.
In VEX snippets, you can use
@variable names containing colons (
:). This makes it easier to automatically bind certain USD attribute names (for example
i@primvars:foo). (These names are not normally legal in names in VEX source code. The node automatically encodes these kinds of names when used in a snippet.)
Cooking this node can generate many USD time samples, rather than just a single time sample at the current time. This can be equivalent to having a Cache LOP following this node, but it will evaluate much faster, and does not cache data from any other nodes. This allows animated data to be authored to USD without introducing a node time dependency which would then cause all following nodes to also be time dependent. This can vastly improve playback performance of some LOP Networks.
In all sampling modes, if a parameter on this node does not vary with time, and does not rely on other time sampled data from the stage, only a single default value will be generated in USD for the corresponding attribute. USD time samples are only generated for parameters that may vary over time.
Sample Current Frame
A single time sample will be generated for the current time.
Sample Frame Range If Input Is Not Time Dependent
If the input to this node is time dependent, this node behaves as if it is in
Sample current frame mode. Otherwise it behaves as if it is in
Sample frame range mode.
Sample Frame Range
The Start/End/Inc parameter is used to generate multiple times at which this node’s parameters are evaluated, and a USD time sample is created for each attribute at each one of these times.
When the Sampling behavior is
Sample frame range, this parameter controls the number and spacing of base time samples to be generated by this node. The default values of this parameter are
@finc. These values correspond to the start, end, and step size of the global Houdini animation settings when interacting with Houdini. When using a ROP node to generate a range of frames, these values correspond to the start, end, and increment values specified on the ROP node being executed. This default ensures that a USD file written to disk will contain time samples for exactly the frame range requested by the ROP (regardless of the Houdini animation settings).
For each primary sample generated by this node, these parameters can cause additional samples to be generated aroudn that primary sample time. This is most often used to ensure that accurate data exists at exactly the camera shutter open and close times, as well as at the primary sample time.
Controls the method used to specify the shutter open and close times relative to the primary sample times.
The Shutter open/close parameter values provide exact offset values relative to the primary sample time.
Use Camera Prim
The Camera prim parameter provides the scene graph path of a camera primitive from which the shutter open and close times are extracted to provide the offset values relative to the primary time sample.
When the Shutter mode is
Specify Manually, these two offset values are added to the primary sample time to indicate the shutter open and close times. The open time should be less than or equal to zero, and the close time should be greater than or equal to zero.
Scene graph path of a camera prim on the input node’s stage. The shutter open and close attribute values are read from this primitive.
The number of subframe samples to create for each primary sample. These samples are evenly distributed between the shutter open and close times. Note that such an even distribution may or may not create a sample at exactly the primary sample time.
Always Include Frame Sample
Enable this option to force a sample to be created at exactly the primary sample time. If the Samples values together with the shutter open and close times already place a sample at the primary sample time, turning on this option will have no effect. Otherwise, this option will cause an addition sample to be added. This means that the actual number of samples per primary sample may in fact be one more than the number specified in the Samples parameter.
The primitive(s) the node should operate on. You can drag primitives from the scene graph tree pane into this textbox to add their paths, or click the Reselect button beside the text box to select the primitives in the viewer, or ⌃ Ctrl-click the Reselect button to choose prims from a pop-up tree window. You can also use primitive patterns for advanced matching, including matching all prims in a collection (using
Allow Instance Proxy Primitives
When this is on, the pattern in the Primitives parameter will be allowed to match instance proxy primitives (instanced ancestors of a primitive marked as instanceable). Since instance proxy primitives cannot be directly modified in USD, this mode is primarily used to allow the VEX code to pull data from the instance proxy primitives, and apply values to some non-instanced ancestor primitive.
Run On Elements of Array Attributes
When this is on, the node evaluates the snippet for each array element of array attributes, on each prim. In this mode, the built-in
elemnum refers to the array index, and
numelem refers to the length of the largest array. (When this is off, array attributes are available in the snippet as array-type variables.)
If some array attributes have shorter length, their elements are padded with the last element.
This mode may be useful for running over geometry-related attributes such as
In the snippet, the path to the current prim is available as
@primpath. You can read current attribute values using
@name, and create/update attribute values by writing to variables with the same name as the attribute. You can also use VEX USD functions to manipulate the primitive. See VEX snippets for more information.
Attributes to Create
When the snippet creates a new variable, only create a corresponding attribute if the variable name matches this pattern. The default is
*, which creates an attribute from any VEX variable created in the snippet.
Automatic creation of attributes from
@ variables is convenience, but there’s a risk a type will bind or create the wrong attribute. When this is on, binding only works if you explicitly declare the
@ variable before use.
Autobind by Name
@ variables corresponding to existing attributes (default is on). If this is off, only attributes explicitly bound using the multi-parm below are available as
@ variables in the snippet.
Number of Bindings
The number of USD attributes to bind to VEX variables.
The name of the USD attribute to bind to a VEX variable. Note that this attribute does not need to exist yet. You can bind it to a VEX variable, and if the VEX writes to the variable, the node will create the attribute.
The USD datatype of the attribute. You should usually leave this set to
Auto, so the node will use the known type of an existing attribute. If you are going to create the attribute, and node doesn’t translate the VEX type into the correct USD type (for example, it becomes
string but you want a
token), you can change this to the type you want.
The name of the VEX parameter bound to the attribute.
Evaluation Node Path
Certain VEX functions, like
ch(), evaluate parameters on this node.
In some cases you want these functions to be relative to a different node (for example, with nodes inside a digital asset, you often want to evaluate functions relative to the parent asset). This is a relative node path to the node to use as “the current node” in the program.
When a VEX parameter is exported, the bound attribute will be created if it doesn’t exist. This pattern can be used to override this option to avoid writing to or creating certain attributes. The pattern matches the VEX parameter, not the bound attribute. The attribute will still be bound for reading.