# VFX Logic operators with more than 2 inputs?

I was wondering if there is an easy way to compare more than 2 bools using something like the “and” or operators. I ended up making myself a messy subgraph to deal with it, but I was wondering if I was missing a simpler way.

Thanks.

There is an And logic block that may do what you want.

I think I have a related question which is how do I replicate if (blah) else if (blah) else() in vfxgraph?

I want to link some compare blocks together, but seems awkward

For example:

• if X < 5, do a small effect
• else if 5 < X < 10, do a medium effect
• else X > 10, do a big effect

eranhaas: the sub-graph shouldn’t be too messy, just (N - 1) ‘AND’ operators per N inputs. Unless you’re doing lots of them I’d happily go with sub-graphs for AND3, AND4, etc. Although some operators allow additional inputs, they’re the ones with an unlabelled input at the bottom left of the node - the logic ones do not support this.

AND3 subgraph operator

livealot: I came across a ‘switch’ block recently - depending on your logic that might work quite well (for your example do an integer divide by 5 then switch on the result for 0, 1, 2)

In this example the switch controls the velocity of particles involved in the effect.

2 Likes

Thanks @pjbaron for the switch idea. That would be useful if the switch block could use expressions rather than static values.

Here’s what I meant by an awkward approach to if/else/then using a classic test of where an input is relative to two thresholds (lower, between, above)

I’m hoping there is a much simpler way to do this