Python function node editor

you could have boolean operators
and functions like in python
else elif
and or

in the material node

In [animation nodes] there is one.

However in texture / material / compositor the only way is to hack it. I remembered trying something that sometime ago and then some solution with a simple node group. Perhaps now it would be a great opportunity to popularize the idea once again and get a jucy boolean node in the Math category.

Cycles Boolean Node (Not Shader)

thank you very much, such a node would be very useful

I hope I’m not misunderstanding you, but the Math nodes compare functions (=, >, <, compare) return boolean values (a black (0) and white (0) mask). Combining the output of such nodes with some math functions (Maximum, Minimum, etc.) basically gives you logic gates.

Using those masks as factor Input of the Mix RGB or Mix Shader Node will control the Node output with those masks: 0 -> first input, 1 -> second input. This works as the if/elif function to combine textures and shaders.

If that sounds like what you’re looking for, I can make a small breakdown on how to construct the basic logic gates and set them up as convenient Node Groups.