Is there some way to select one output from a number of inputs with a Fac, like a Mix shader, but instead of a 0-1 slider, use an integer index (for more than two inputs)?

Example (in Quartz Composer):

Quartz Composer multiplexer

If possible, I would like to use an arbitrary number of inputs (e.g. with Python somehow), but I don't know if that is possible.

  • $\begingroup$ No, I don't think there is any way to do as you describe, at least not directly. Maybe using some python scripting or PyNodes. $\endgroup$ – Duarte Farrajota Ramos Sep 5 '17 at 1:50
  • $\begingroup$ @seaturtle You should add this as an answer rather than an edit to the question - it's a good solution and will be useful to others. You will then be able to mark it as 'accepted'. There is no way currently to do this with an arbitrary number of inputs - I think you've hit upon the optimal solution. $\endgroup$ – Rich Sedman Sep 5 '17 at 16:21
  • $\begingroup$ Thanks, @FarewellStackExchange! And @Duarte, that's what I was wondering (I wasn't asking specifically about node groups). $\endgroup$ – SilverWolf - Reinstate Monica Sep 5 '17 at 17:02
  • $\begingroup$ Thanks for the info, @RichSedman. I was afraid of that—but maybe someone will come by and invent something brilliant. (: $\endgroup$ – SilverWolf - Reinstate Monica Sep 5 '17 at 17:08

I found a way to do this that takes a fixed number of inputs (it also has the useful property of mixing its inputs given a non-integer):


This is extensible, but only by manually editing the node group.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.