Houdini 20.5 Nodes VOP nodes

Switch VOP node

Switches between network branches based on the value of an input.

On this page

This node’s first input is an integer that specifies which input to pass through to the node’s output. The numbering starts at 0, even though the input labels start at input1 (for example, if the value of the first input is 0, the node will output the value of input1).

The inputs can be of any type, but they must all be of the same type.

You can use this node in front of a Collect node to switch between shader types. When switching between shader types (in front of a Collect node), only the code for the currently selected branch is generated.

Warning

When switching between regular inputs (that is, not between output nodes and a Collect node), all inputs are evaluated (cooked). For networks with long branches feeding into a Switch, this can be very inefficient, so you should only use Switch with short branches. You can use the If subnetwork to switch between big network chunks efficiently.

Inputs

Switcher Index

This integer value selects the input value to pass through to this node’s output. The inputs are numbered starting at 0 even though the inputs are labeled starting with input1, so a value of 0 will select input1, a value of 1 will select input2, and so on.

You will usually connect this input to a Compare node, or a logic node such as the And or Or node.

Input Number N

You can connect up to 64 inputs. New inputs are added as you connect them.

Outputs

Chosen Value

This output will be of the same type as all the inputs.

See also

VOP nodes