More input sockets for Node Groups in Shader Editor.
I would like to propose an addition to Shader Nodes that should not be a big hassle to implement and would greatly benefit the visual side of Node Groups, similar to how Geometry Nodes have their own clean look.
Starting off with very simple ones that could be implemented in seconds.
Integer :
Integer already works perfectly fine when added with Python, it gives the value it's supposed to so the only change needed here is to expose it in the socket type over in the Group side menu.
Boolean :
As seen above, visually it is already set up and ready to work, unfortunately it does not output a correct value, it is stuck on 0.5 value no matter the True or False state, pretty simple to fix, just make it output either 1 or 0 depending on the state. If we really need a node that specifically supports Booleans then why not and just copy over the Switch node from Geometry nodes, it would perfectly fit in the Shader Nodes.
Those changes alone would hugely improve the visual presentation of node groups, being able to use Integers for rounded numbers and Booleans for switches.
Simple example of how much nicer this Node Group looks with those changes.
Now for the inputs that would need changes in the current nodes.
Image/Texture :
Both of these would need the current nodes to be altered or just copied over from Geometry nodes.
Image Texture node really needs a socket for the Image itself, it is something that will allow for way more options when working with complex node setups, everyone that ever used a Paralax setup knows that those groups either need you to dig inside the actual group to insert the Height image or just use python to do it automatically. We already have a variant of this node in Geometry Nodes, ready to be pretty much copied over.
Last and probably the hardest inputs to implement.
Object & Collection Info :
The current Object info node does not offer much flexibility when it comes to working with objects outside of the main one. Being able to get transforms of empties or just other objects would prove extremely useful, right now the only workaround for that is to use drivers.
I would suggest implementing 2 nodes very similar to the ones we already have in Geometry nodes.
Of course it would take time to implement , that's why i separated this topic to 3 types of implementations that could be done gradually. Starting off simply with the Integer and Boolean would already improve the visual quality of the Node Groups a ton so i hope that at least that part of my proposal could be implemented.
To consider:
Given that we also have a String Input, i don't think it would hurt if we could have that exposed along side the Name socket in the Attribute node being accessible.
Also for people interested about how i added those extra sockets.
Simply paste this in your text editor and run this line of code.
import bpy
bpy.data.node_groups['NODE_GROUP_NAME'].inputs.new('NodeSocketBool', 'SOCKET_NAME')
All the possible sockets :
[‘Value’, ‘Int’, ‘Bool’, ‘Vector’, ‘String’, ‘Rgba’, ‘Shader’, ‘Object’, ‘Image’, ‘Geometry’, ‘Collection’, ‘Texture’, ‘Material’]
Simply replace the Bool in NodeSocketBool
7 Comments
The most important suggestion here is to add a texture socket to the texture image node itself. This is severely lacking, which makes it necessary to go into the node groups themselves to change the texture, which causes confusion.
exposed curves and color ramps would also be nice
This is already planned for blender 5, using the closure socket and adding subtypes for different curve types and the color ramp.
Image Tx Node | Width & Height | info input - would be awesome to.
( I mean - Image gives you its W&H ) useful.. :)
Love idea. I wanted it too.
I dream with such feature for Shader Editor every night!! Hope the devs consider it for the next realease.
How to implement image socket to texture node???