0
$\begingroup$

I'd like to create node groups which behave a little differently depending on whether particular input nodes are wired or not. Is there a way to test if they are wired or not?

I'd prefer not to use the "sentinel value" method, because I want to use the defaults as reasonable values that are set when I first place the group node, before I wire anything up, and also as a reasonable value to reset the input to when I need to. If I set the default to a sentinel value, then I have to make that value something outside of the expected input range in order to avoid accidentally tripping it during normal use.

I'd like a Is Input Wired(InputName:str) -> Boolean node. Does such a thing exist?

$\endgroup$
1
  • $\begingroup$ You might want to try your luck with python scripting, I don't think what you're after is available to vanilla Blender $\endgroup$
    – Gorgious
    Feb 22, 2023 at 18:52

1 Answer 1

0
$\begingroup$

Reroute thingie can be connected to multiple other nodes and if nothing is connected to it, whatever it is connected to retains default value. If you use a Compare node with both compared values set to equal unrealistic value like 9999 it will detect the difference when something else is connected to it.

enter image description here

It doesn't work with all available kinds of nodes, but it might be useful for some things.

$\endgroup$
3
  • $\begingroup$ thanks for the answer, but I think this is the same as the "sentinel value" method, which I said I'd not like to use. $\endgroup$
    – rothloup
    Feb 23, 2023 at 2:03
  • $\begingroup$ OK, this doesn't work with Cycles, just with EEVEE on further testing. so you cannot do anything like that with nodes alone. Do you want a Python solution? $\endgroup$ Feb 23, 2023 at 7:24
  • $\begingroup$ You can use Python with app handler same as here $\endgroup$ Feb 23, 2023 at 7:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .