How would I use If Statements to control Material parameters? I wish to manually animate the position of UVs.
-
If a variable has a value of 0, offset the UV tile to these U and V parameter values.
-
If the same variable has a value of 1, offset the UV tile to these different U and V parameter values?
-
If the same variable has a value of 2, offset the UV tile to these different U and V parameter values?
There is a node for that:
It works similar to the “select” node in blueprints. You can chain them into a final output.
Hello Roy, may I ask a few more questions?
-
Does this screen grab of “If statements” look correct?
a. Did I set up the If “A” and “B” values correctly?
-
Would I use a Dynamic Material Instance to connect the variable to the Material Parameters?
-
What node may I use to chain all the If Statements to the Flipbook?
Why are there multiple parameters for the UV offset though? Wouldn’t it make sense to have 1 parameter to offset the UV and take the logic to set the parameter out of the material?
I have never done this sort of thing before; just feeling my way to a solution; trying to learn.
I don’t know how to use 1 parameter to offset the UV and take the logic to set the parameter out of the material.
As a Newby, it just made sense to itemize each Offset out into separate params. To make it easy for a Newby to understand.
Hello Roy, I think I got most of it.
-
I’m using a Dynamic Material Instance to provide the value to the material.
-
Question: About the last If Statement in the chain. What would I plug into the A>B to make the error go away? I want the UV to stay where it is “OffsetU IF 2 = 1.5” and “OffsetV IF 2 = 0.0”
a. If I wire the same Append into A>B, I get an additional Error in the If Statement chain above the current if statement.
b. Question: How would I make the if A>B do nothing; don’t move the UV to other param coordinates?
I think you don’t yet understand the IF node.
the node on the screenshot says:
if A > B then nothing.
if A == B (3) then append param 1 with param 2.
if A < B (3) then append param 1 with param 2.
“Nothing” is not a valid input for a pin. If you don’t want to add an offset if A > B then add a constant of 0 to the A > B pin.
Correct, I do not know how to properly use an If Statement in a Material…trying to learn.
I used a constant with a value of 0, but I then discovered an error in the If Statement above the current If Statement.
I probably built the If Statement chain wrong, too.
The if nodes generating the same errors also need an input value for the input pins