If VEX node

Contains other VOP operators.

All Parameters Inputs Example files

See also: And, Compare, For Loop, Or 6 more , Subnet, Subnet Input, Subnet Output, Switch, Two Way Switch, While

This operator contains other VOP operators. The code for the contained operators is executed only if the value fed into the first input matches the criterion specified by the Condition parameter. At least one input must be connected to this operator.

Use this operator when you want something to happen only if a certain condition is met. The Condition Value is usually the output of a Compare operator, but any integer value can be used.

Any value that you wish to modify inside the If operator must be provided as an input. The outputs of the If operator will contain the modified versions of the inputs (if the condition was met) or the unmodified version of the inputs (if the condition was not met). The actual values wired into the If operator inputs are never modified, and so can be connected to other operators in the network, but remember that the values from these operators will always be the values unmodified by the If operator.

There is no place in this operator to specify what should happen if the condition is not met (i.e. an Else block). To achieve the same effect as an if-then-else statement, use two If operators. Connect the same output value to both Condition Value inputs of the two If operators. Then set the Condition parameters of the two If operators to be different. At this point one If operator represents the “if” block, and the other represents the “else” block. Then connect your inputs to the “if” block operator. Then connect all but the Condition Value output from the “if” block into the inputs of the “else” block. Now the outputs of the “else” block are going to be what you would expect from an if-then-else statement. For simple if-then-else constructs, use the Two Way Switch operator instead.

Inputs

Condition Value

This integer input must be connected. The value connected to this input is compared to the requirements of the Condition parameter. Usually this input will be connected to the output of a Compare operator, or one of the logical operators (And and Or).

Next Input

Any number of inputs can be connected here. Each time an input is connected, a new input slot is added. All connected inputs mimic the properties of the output wired into them. They adopt the same help label and name as the output connected to them. If multiple outputs with the same name are connected, the names of the inputs are automatically incremented to make them unique.

Outputs

The list of outputs depends on the inputs connected to the Subnet Output operator contained in this operator. The data type and name of each output will match the corresponding input of the Subnet Output operator.

Parameters

Condition

Specifies the condition that must be met by the first input for the contained code to be executed. Either the input value must be False (equal to 0) or True (not equal to zero).

Inputs

Condition Value

This integer input must be connected. The value connected to this input is compared to the requirements of the Condition parameter. Usually this input will be connected to the output of a Compare operator, or one of the logical operators (And and Or).

Next Input

Up to 64 inputs can be connected here. Each time an input is connected, a new input slot is added.

Example files

ST_Colour

$HFS/houdini/help/examples/nodes/vop/if/ST_Colour.cmd

Load | Launch

This is a simple example of using the If-Then Block VOP with the “true” value coming from outside the If-Then subnet, and the “false” value also coming from outside the If-Then subnet.

A Condition VOP is used based on the “t” Global Variable. When “t” is less then .5, the If-Then gets a “false” Condition, and when “t” is equal to or greater than .5, the If-Then gets a “true” Condition.

In this example, the red color is used if the value fed into the condition is not True, and blue if the condition being fed in is True.

SimpleInsideSubnet

$HFS/houdini/help/examples/nodes/vop/if/SimpleInsideSubnet.cmd

Load | Launch

This is a very simple example of using the If-Then Block VOP with the “true” value coming from outside the If-Then subnet, and the “false” value coming from inside the If-Then subnet.

In this example, the red color is used if the value fed into the condition is not True, and blue if the condition being fed in is True.

SimpleOutsideSubnet

$HFS/houdini/help/examples/nodes/vop/if/SimpleOutsideSubnet.cmd

Load | Launch

This is a very simple example of using the If-Then Block VOP with the “true” value coming from outside the If-Then subnet, and the “false” value also coming from outside the If-Then subnet.

In this example, the red color is used if the value fed into the condition is not True, and blue if the condition being fed in is True.

Usages in other examples

Example name Example for

Material shader

Load | Launch

Material shader

Load | Launch

Meta-Loop Import VEX node

Load | Launch

Fur surface node

Load | Launch

Fur surface node

Load | Launch

Fur surface node

Load | Launch

Smoke Object dynamics node

Load | Launch