Author Topic: switch / case function  (Read 1578 times)

User Voice:  http://allegorithmic.uservoice.com/forums/257908-substance-designer/suggestions/8100324-switch-case-function

Would be great if we had a switch/case style function for doing value comparisons against Floats or Integers.

The input to the node could be either Float or Integer, with case value output of type Float or Integer (optional, but persistent to the function node).

Say I have a drop-down, with 4 options (0,1,2,3) and I need to be able to feed a particular value into an Instance Parameter based on that selection.

I'm currently attempting to do this with a function that gets the input integer and cascade the results of comparisons between those options (returning a final value which will set that Instance Parameter).

I'm finding that creating a cascaded "if... else" that can evaluate an integer and either transcend the input integer or the result for a Float value to be ... difficult.

A simple switch/case function would fit this perfectly