GrowFX 2.2.1 User Manual

How to use the Switch node

The Switch node allows routing to different nodes depending on the input value, thereby using different branches of the nodes. There are 5 types of Switch node, depending on where you want to connect this node.


Types of Switch node

1. Modifiers

This type of node is created when you create a Switch node from the bottom left or right connector of the Path node. You can also create this node from the output connector of any modifier.

Thus, you can use one of several modifiers depending on the input value.

In the example below, if the value 1 comes from the Public node named "Input Value", then the Random_dir_01 node will be used, if the value is 2, then Noise_dir_01 node.

If you want to use a checkbox on the command panel that will turned on the Random_dir_01 node, and if it's turned off then the Noise_dir_01 node will be used, then you can configure the graph as follows:

Please note that the Boolean type of Public node provides only 0 or 1, respectively, the Switch node is configured so that if the input value = 0, the Noise_dir_01 node will be used, but if the input value = 1, then the Random_dir_01 node will be used.


An example of a node with 5 outputs:

2. Meshes

This type of node is created when you create a Switch node from the bottom connector of the Path node.

Thus, you can use one of several mesh builders depending on the input value.

In the example below, you can see how to configure the Switch node to be able to switch between Cylinder mesh and Meta mesh.

You can connect this Public node named "Use MetaMesh" to all Switch nodes that are intended for this, in order to be able to switch the mesh builder for all paths with one checkbox.



3. Path Distributors

This type of node is created when you create a Switch node from the Child distributors (the right connector ) of the Path node and the child distributors (Path distributor node or Path position distributor node) to the Parent paths (the left connector ).


An example:

Here you can completely switch between different branches of the graph. For example, you can completely change the tree with one click.



4. Distributors

In this example, you can switch the start of path lines between the GrowFX icon and some other point.

The following example implements the ability to switch between one or many branches. This is useful, for example, if the tree is calculated slowly, and you need to quickly adjust any small branches or flowers.



5. Paths

The Paths type of Switch node allows one or more path distributor nodes to generate different Path nodes depending on the input value.

To create this type of Switch node, create Switch Paths from the output connector of a path distributor. Then connect each output of the Switch node to a different Path node.

For example, the following setup allows one distributor to generate three different Path types:

The Path is selected separately for each generated branch. Therefore, you can connect a Random node to the Input Value parameter to randomly select one of the available Paths.

For example, if the Switch outputs have the values 1, 2 and 3, set the Random node to the Integer type with Min value = 1 and Max value = 3. Each generated branch will then use one of the three Paths randomly.



The selection is evaluated independently for each generated path, including repeated Levels, so different levels can also use different Path nodes.

Besides the Random node, you can also use an Affect node, Math nodes, or any combination of value-processing nodes to control the Input Value. This allows the selected Path to depend on path position, level, other parameters, or more complex procedural conditions.

TOP