Author Topic: Hiding inputs  (Read 2267 times)

I know it's possible to have parameters control the visibility of inputs in a substance, like having an integer that controls the number of inputs in a multiple blend node.
I absolutely cannot figure out how to get it to work though. I've tried inputting information to the Input node's "Visible if" section just like a parameter, which is what the documentation says to do, but it does nothing.
Let's say that I create a Boolean parameter called ExtraInput, and inside the input's "Visible if" section I type "input["ExtraInput"]". No matter what that Boolean is set to, the input will always show when using that node in another graph.
I've tried searching everywhere online for instructions on how to do this, and found nothing other than the seemingly inaccurate official documentation.

You have to add whether it displays when the bool is set to 1 or 0. So like this:

It can be done a number of ways.
It could look like input["ExtraInput"]==1
It could also look like input["ExtraInput"]==true
Or it could look like input["ExtraInput"]
it doesn't work when I use any parameter, including floats or integers, not just the boolean example.

It works for me in SD 6.0.3 with input["ExtraInput"]==1, input["ExtraInput"]==true and input["ExtraInput"]. Can you post your substance so that we can offer further help ?
If you look at the field where you entered the Visible If condition, does it display a warning sign icon ? If yes, what's the content of the error message in the tooltip if you hover your mouse cursor over it ?
Last Edit: June 09, 2017, 06:23:27 pm

Here it is. The "Paint mask" input should only be visible if the "Painted" parameter is true, but it always shows up for me.
-Removed link-
Last Edit: June 12, 2017, 10:39:26 pm

Is this still being looked into? There's no warning sign given; by all rights it seems like it should be working fine, but it doesn't

I tried your graph and it works for me in SD 6.0.3 : if I paste your Stylized_Metal node in another graph, when I uncheck the "Painted" button, the "Paint Mask" input pin is removed. Also, the related parameters are removed ("Use Paint Mask", "Paint Roughness").
Which version of SD are you using ?
PS : sorry if that sounds obvious, but if there is something plugged in that input, it won't be hidden, so make sure it is unplugged when testing.
Last Edit: June 12, 2017, 06:08:21 pm

Huh... I just tried it, and it's working for me too now. I don't know what I changed.
Thanks for looking into it.

I want to just chip in that it seems like the behavior for .sbs and .sbsar is different. I'm on 2017.1.2

input["extraInput"] will suffice for .sbs but will do nothing for an .sbsar (input stays visible for both conditions)

input["extraInput"]==1 and input["extraInput"]==true give expected results in both formats