Add a boolean value to check if Input Socket of a Node Group is connected
At the current state of Blender developpement in Geometry nodes (and other nodes), when creating input sockets for a Node Group, there is an option to pick a "Default Input" which lets you have the input socket already be set to a specific attribute, like Position for example if you have a Vector input socket, or Index with an Integer
This works great, and I honestly use it all the time! But there is a limitation to this I'd like to adress and offer a solution to it in the post: It can't get more complex than that. What if you'd like your default input to be a more complex operation ? Let's say you need the Vector default input as Position mulitplied by 0 on the Z axis (This is just for an example), but you don't want the input of the user outside the node group to be multiplied by 0.
This is currently not possible, there is a workaround : Have a boolean input next to it, the user is free to check it, but it feels like an unnecessary step.
Of course my example is a simple operation, but with the upcoming Closures for 5.0, this can prove very useful, especially because closures are whole functions, and geo-nodes users, like me, might be tempted to have generic closures as default before the users of the node groups inputs their own closures.
This is why we come to my solution : Add the possibility to create a secondary Input, a boolean input, that resembles the "Panel Toggle" for a Panel, but this one would not be a toggle, the boolean would not look like a checkbox outside the node group, but it only adds a new input inside the node group, tied to the original Input it is added onto. The new boolean input returns 0 if nothing is plugged in, and 1 if something is plugged in.
Thank you for reading, I'm quite confident other Geonodes users (and nodes in general in Blender) will agree something like this should be implemented, maybe the UI design idea I offered is not perfect or in line with Blender's vision, maybe a better/ more effective idea is possible as well, I'd love to discuss this!
0 Comments