|On this page|
This node switches between passing through the first or second input. If you use a single test on an expression, then this is equivalent to a Switch SOP. However, this node also lets you test certain aspects of the incoming geometry, and also combine multiple tests using “All conditions true” (AND) or “Any conditions true” (OR) logic.
See the Test type parameter below for the list of tests you can run on incoming geometry.
This node will pass one of the two inputs through unchanged, it does not apply the switching on a per-point or per-primitive level.
Use “default” geometry if an asset’s input isn’t connected
Report an error in an asset if an input doesn’t have at least one point
If the second input has at least one point, it will flow down. Otherwise, the error will propagate down instead.
To test if the parent asset has an input wired, you can use the expression
opinputpath("..", n)where n is the input number to test (starting at
Passed through if the test returns False (or
Passed through if the test returns True (or non-zero).
(You might intuitively expect True to be first, but this order makes the most sense considering that for expressions and scripting the inputs are numbered
Use Second Input If
How to decide whether to pass through the second input, based on the results of the test(s) below.
All conditions true
Pass through the second input if all tests evaluate to True (or non-zero).
Any condition true
Pass through the second input if any tests evaluate to True (or non-zero).
All conditions false
Pass through the second input if all tests evaluate to False (or
Any condition true
Pass through the second input if any tests evaluate to False (or
For tests below based on geometry, use the geometry from this input. The chosen input always cooks.
Test the geometry wired into the first input.
Test the geometry wired into the second input.
Spare input 0
Test the geometry in the node at a certain node path.
If you choose this option, a script automatically adds a spare node path parameter for you. If you then choose another option, the spare parameter remains (unless you manually delete it), however it will only be used if Test input is set to this option.
Number of tests
This node can run multiple tests (with the results combined using the Use second input if parameter). Set this to the number of tests you want to run, or click the plus and minus buttons to add or remove tests.
What type of test to perform.
Evaluates an HScript expression in the Enable parameter. If the expression returns a value (rounded to the nearest integer) other than
0, it is considered True.
Tests whether the geometry has (or doesn’t have) an attribute with the given name. Configure this test using the Enable when, Class, and Attributes parameters.
Tests based on the number of components (points, primitives, vertices) in the geometry. Configure this test using the Enable when, In group, Is, and Value parameters.
Tests whether a given attribute on the first point, primitive, or vertex† matches a certain value. Configure this test using the Class, Attributes, Of type, Is, and Value parameters.
†Normally, this test only tests against the first attribute value it finds. However, for string attributes, you can use the comparison “Containing Any Element Matching”, which is True if any attribute value in the geometry matches the pattern in Value.
Is True if the input specified in Test input has geometry wired into it. If Test input is “Spare input 0”, this is True if the node at the path in the spare input exists.