Author Topic: Need help with Visible If and some stuff.  (Read 2088 times)

Hi

I have two Shapes. Lets call it Form A and Form B.
Both are connected via BlendNode and Switch as Blending Mode.
They are Exposed with Integer1 and a Dropdown List.

I want to choose between From A and B with a dropdown list.
Because, maybe i want to create more shapes.

Then i have several other shapes that i want to mix with Form A and B.
Lets Name it A1, A2 ... and B1, B2 ...
Same as above, they are exposed and have integer1 and use a DrpdownList in the menu.

When i choose From A i could only use A1 and A2 as second shape, but not B1 and B2.
Same on the other side, if i choose From B i could only use B1 and B2 as second shape.
As far as i see, in my substance, it works fine so far with visible if.

If i choose From A, the dropdown list for B1 and B2 gets disabled as it should.
Some in the other way, if i choose From B, the dropdown list for A1 and A2 gets disabled.

Now the problem.
If i choose Form A and Form A1 as second shape, everything is fine.
If i choose Form B, the dropdown list for A1 and A2 gets disabled, and the List for B1 and B2 gets enabled as ist should
But as far as i see the A1 shape from the former List is still active in my substance.
How could i reset or disable the A1 and A2 inputs?

I hope you understand what i am trying to explain.
Any help would be nice.

Cheers
Malo

Hey Malo,

Why do you think it is still 'active'? How does it represent itself as being active or somehow not disabled/blended correctly?
Isn't everything fine if the correct type is shown in your Substance and the switch works? I'm kinda confused, sorry.
Can you show a graph screenshot or so?


Best regards
Environment Artist - Twitter

Hey Fabian

Take a look at the attached sbs file.

Move it into a new Graph and klick on it.
There is a drop down list with Forms and A is active.
And the second dropdown list is Shape CornerA with None

Now choose in Shape CornerA A or B makes no difference.
Then switch in Forms to B.

You will see, the Shape CornerB will enabled with None, because of the Visible If value.
But the former Shape CornerA is still active, you see it in the preview window.

How could i disable/reset the Shape CornerA value back to None, if i switch from From A to B?

Best regards
Last Edit: October 17, 2015, 05:32:18 pm

Hi Malo,

I have edited your graph and attached.  It was easier than trying to explain how to fix it.  I have tried to layout everything to make it easy for you to study the flow and how the switches work.

Comments:
Your visibleIf statements were perfectly fine.  The issues where in the way your graph Blend nodes were constructed and the functions inside them.  You had Integer nodes plugged into your If Else function nodes where you should have used Floats. 
Try to stick with a standard for your Blend nodes else it will become confusing which way your switches are working.  Your base (default) style should always feed into the Background slot of your Blend nodes and your changes/additions to the Foreground slot.
For your If Else nodes in your functions, always have your 0 Float plug into the "else" (your default) slot.  This just makes it a lot easy to follow how your switches are working and make it much easier to add more shapes to your graph in the future. 
I also removed some of your Normal/Combine nodes.  These are expensive nodes so I have pushed this blending switch function to your lighter weight grayscale Blend nodes so only one Normal Combine node is now required.

Hope this helps.
Last Edit: October 19, 2015, 01:13:07 am

Hi artzfx

Thanks a lot for your time.
Looks fine so far.