Houdini 20.5 Nodes APEX nodes

RunVex

Executes a VEX snippet.

On this page
Since 20.0

This node empowers users to implement their own callbacks using the VEX language. Each input and output port is accessible as a variable in the VEX snippet. The port names dictate the names of the bound variables. In the VEX snippet, users should read from the input variables, perform the user-defined calculations, and write the results to the output variables.

The example VEX snippet below calculates various properties of a circle:

diameter = 2*radius;
circumference = 2*M_PI*radius;
area = M_PI*radius*radius;

A few notes about this snippet:

The graph below reads the radius from the graph input node, calculates the circle statistics, and writes the results to the output.

In order for the RunVex node to function, it needs to know the type of its input and output data. When the ports on the RunVex node are connected, it uses the connection to determine the data type of its input and output ports. The ports will also change color to reflect the type of the connected data.

However, there are nodes like the graph input and output nodes that have variadic ports that accept or produce different types of data (these ports have a gray color). When such a gray port is connected to the inputs and outputs ports on the RunVex node, RunVex does not have enough information to know the type of variable to produce in the VEX context. In this scenario, the type information needs to be made explicit with the use of a Value node. In the example above, the Value<Float> nodes in the graph allow the RunVex node to recognize the data type of the variable it is binding.

Tip

On the APEX Edit Graph SOP, set the Error Handling parameter to Report as Warnings to more easily identify errors when using the RunVex graph node.

Supported APEX Types In VEX

APEX Type

VEX Type

Int

int

Float

float

Vector2

vector2

Vector3

vector

Vector4

vector4

Matrix3

matrix3

Matrix4

matrix

String

string

Dict

dict

IntArray

int[]

FloatArray

float[]

Vector2Array

vector2[]

Vector3Array

vector[]

Vector4Array

vector4[]

Matrix3Array

matrix3[]

Matrix4Array

matrix[]

StringArray

string[]

DictArray

dict[]

Inputs

snippet: String

VEX code implementing the user-defined callback behavior.

inputs: VariadicArg<void>

Each connected input is bound to a read-only variable in VEX. The port name dictates the name of the bound variable.

Outputs

outputs: VariadicArg<void>

Each connected output is bound to an assignable variable in VEX. The port name dictates the name of the bound variable.

APEX nodes