Can I make a boolean node?

  1. I would like to know if I can make a custom node that will act as a boolean node.

It will accept two “input values” and two “data values” but based on a specific condition (e.g. a < b) it will allow only one value to pass.

I have managed so far with some Converter>Math nodes to achieve various cool multi-purpose materials, but it always looks like is more hackish that it should.

  1. In Cycles renderer, there is a “Script” node. However it seems like it’s exclusively for Shading Programming. Right?

Funny because I was going to post a request for exctly this type of node and I saw this post. I totally agree that this wodlbe very useful I recently posted an idea for a text node and within one day someone had writteh an addon for one. So hopefully some clever coder will pick this up as well. Too much to hope for?

Good to post your response here to let this thread live more.

Yep, boolean node is very useful to have, in the beginning I used nodes only for simply juggling values to create materials, but now after a couple of months I use these hacks all of the time to create clever materials. Imagine that the Blender node system is almost as good as a visual programming language (VSL) so given this, the vision is that can become a proper VSL. At least in the beginning gaining a boolean node is much essential because you need to redirect flows in more dynamic ways.

Also this idea of a text node is also very good as well, I use empty join frames with titles mostly to write some “comments” in the nodes, however a text node would be much preferred.

That’s a very interesting idea.

In fact, it would be cool if all modifiers were eventually node-based.

Yes I have heard that Blender developers want to make modifiers node based, so in the future we will see more updates on this subject.

J the Ninja -
You say that a boolean node is only going to be useful if there is a boolean shader. Im not sure I agree.
Let me pose you a simple situation. You set up a material which has two “states” ea ch of which is useful for you at a certain stage of doing a render out. Lets say , for example , that one branch of this material renders AO, or dirty vertex and some processing of that and the other branch makes the material do a diffuse etc render.

All you would need woudl be two nodes - a Boolean “state” node whihc would give a True /False switch ( On /off) and a node whoich could detect that and reroute output based on the boolean state. On enode could probably do both these things actually.

If I remember my basic computer science stuff right ( I almost certainly don’t) almost any logic circuit can be built from basic boolean states. If thats so then sophisticated switching mechanisms could potentially be built into shader noodles.

Logic nodes AND, OR, NOR etc. would really make the node system incredibly flexible

The point is you can’t evaluate a Cycles node in Blender. If you want the operator to be able to evaluate things like textures, it has to happen during the shader call because the source data doesn’t exist in Blender. Cycles generates it on the fly while calculating the shader.

You could certainly add a switch node that only exports the active part of the node tree, and never touch Cycles’ internals. Although I’m not sure Cycles’ shader export routine is set up for this yet, you might need to add support for that kind of behavior in general too. But if you want a node input for the condition itself, that needs be done as a shader.

Hi there .
I am not sure if this is what you are looking for , but I found it usefull, so I post the video link :
Hope it helps.