Random Map Node

Hi there!

It is great that we can randomize UV coordinates or various attributes of single map.
But is there a solution if we want randomize which map gets applied to material?
Like, we put multiple maps into material, and depending on input value it chooses one of those maps as output.
I know we can do it with multiple nodes. But is it even possible in blender to develop a single node for this? Like, a node where you can define how many map inputs you want and then the node dynamically changes number of inputs and calculates odds?

Do you mean a node group? I am pretty certain that this is not possible at the moment with node goups unless you script it in python.

I meant with scripting/programming it…
For node group it would require constant number of inputs.
Unless we could calculate ranges somehow with drivers.
But yes, changing inputs dynamically wouldn’t be possible.

Well, since you can build shaders with python it should be possible to create an addon/script which you feed with your textures (assuming you mean textures when you say map). The script would then auomatically build a shader tree in which your textures are applied according to the rules you want.

You could use a value node to decide which texture is used or you could use the object id or the particle Id or something like that.

All objects have the same material but different Object IDs. The math node uses compare to check which texture should be used.

You could use a script to automate setting up the texture node, the compare node and the mix node when adding a new texture or deleting an old one.