Houdini 20.5 Nodes Copernicus nodes

Wrangle Copernicus node

Runs a VEX snippet to modify layer values.

On this page

This is a very powerful, low-level node that lets experts who are familiar with VEX tweak pixel values using code.

This node corresponds to the Volume Wrangle SOP, but automatically converts the incoming layers to bound volumes.

All of the layers are bound into a single geometry input 0. Additional geometry thus needs to use higher input numbers.

@P can be used to get the current world position of the processed pixel.

Note

While VEX is considerably more accessible than OpenCL, it is still encouraged to use the OpenCL COP rather than a Wrangle. A wrangle should be used where you need access to high-level geometry functions. Wrangles are CPU nodes so can considerably slow down networks.

Syntax

Reading and modifying the pixel value

The current pixel value in a layer is available as @‹layer_name. You can read this variable to get the current value, and assign it to change the value.

These will have the same VEX type as the layer - so a UV layer will be of type vector2 and have a .x and .y

Parameters

Volumes to Write to

Only modify layers if their names match this pattern. The default pattern allows any layer to be modified. You can speed up the node by only listing layers that are actually modified by the snippet.

For example, in the following snippet, only the density layer is modified. The temperature layer is not modified, only read.

@density = @temperature;

However, for obscure reasons, the node will both modify density and copy temperature. This uses time and memory. To prevent this, you could set this parameter to density to prevent the node from copying temperature. Of course, this requires that you explicitly manage the list of writable layers.

Enforce Prototypes

Requires that you declare @ bindings in snippets as prototypes before using them. This applies to both attributes (for example @Cd) and “convenience” bindings such as @ptnum and @Frame. For example:

// Declare bindings
int @ptnum;
float @Frame;
vector @Cd;

// Use bindings after declaration
int pointnum = @ptnum;
float red = @Cd[0] / @Frame;

Automatic binding with the @ syntax can be convenient, but as your scene becomes more complex there is the risk that a typo in an @ binding will silently just bind a non-existent attribute.

Evaluation Node Path

VEX functions like ch() usually evaluate with respect to this node. Providing a path here can override where the path search starts from. This is useful for embedding in a digital asset where you would like the top level digital asset to be the search root.

Export Parameters

This pattern can be used to override the export option on the VEX shader to avoid writing to certain volumes. The pattern matches the VEX parameter, not the bound volume. The volume will still be bound for reading.

Number of Inputs

Type

The type of the input. Layer inputs will be bound to a volume of the provided name. Geometry inputs will become extra geometry inputs accessible by the Input Index.

Mono

A Mono layer corresponding to a float volume.

UV

A UV layer corresponding to a vector2 volume.

RGB

An RGB layer corresponding to a vector volume.

RGBA

An RGBA layer corresponding to a vector4 volume.

ID

An ID layer corresponding to a int volume.

Geometry

A geoemtry input that will be bound to a given internal input.

Binding Name

The name of the layer. This is the name it is given in the binding and how it can be referred to from the VEX snippet.

Input Index

Geometry inputs can be referred to by this index. For example, if it is 2, then to read the number of points npoints(2) would be used. 0 is reserved for the implicit layer input.

Inputs

input1

Inputs to send into the wrangle.

Outputs

output1

The inputs as processed by the wrangle.

See also

Copernicus nodes