Author Topic: [Solved] Using the $TIME variable - Help!!! - Examples, tutorials, etc.  (Read 4215 times)

This is probably WAY over my head, but I'd like to try to make an animated substance using the $TIME variable.

Hopefully someone can direct me to a nice tutorial or some documentation that is noob-friendly.  A very small *.sbs file would also be great.

For example, consider the "Caustics.sbsar" file that comes with Substance Player.  When you press "Play" it animates.

I wanted to try to make something as simple as a light that pulsates bright/dim/bright/dim.

Maybe an easier start would be a spot that moves side-to-side a bit.  I'm thinking you'd control the "X Offset" on a "Transform" node.

My time spent with Substance Designer is minimal, usually little bits sandwiched in between family responsibilities, and I've only exposed a parameter once (yeah, that much of a beginner), so please type slowly.
Last Edit: November 10, 2015, 02:37:45 pm
Hobbyist
----------
Common "Help" suggestions:
- LOG FILE tips - https://forum.allegorithmic.com/index.php/topic,22451.0.html
- LICENSING issues https://www.allegorithmic.com/contact
- ATTACH files and pictures to posts: https://forum.allegorithmic.com/index.php/topic,23670.0.html

Hey justaviking,

the $time variable is quite easy to use, actually. I attached a very basic substance which will make the shape rotate based on the time elapsed.
If you open it in Substance Player (just click the small Play-button in the explorer window, just above the Substance package or publish the sbsar) you'll get a time slider. Dragging it will rotate the shape.

To view what I did you can go to the transform 2D node and inspect the exposed parameter by clicking on the small icon shown in the screenshot below.
I hope that helps :)


Best Regards
Environment Artist - Twitter

I've also never done this before and am very interested. Someone should do a formal tutorial that shows some fancy ways of using functions with it (similar to animation curves). I'd especially like to see ways of using it in game engines. I'll study this. Thanks for sharing.
3D art is magic.

Thanks, Fabian.   :)

I'll study it right away (as soon as I grab a fresh cup of coffee to improve my brain function).

Hobbyist
----------
Common "Help" suggestions:
- LOG FILE tips - https://forum.allegorithmic.com/index.php/topic,22451.0.html
- LICENSING issues https://www.allegorithmic.com/contact
- ATTACH files and pictures to posts: https://forum.allegorithmic.com/index.php/topic,23670.0.html

I'm back already.  I was too excited to go make the coffee (maybe that was a mistake) and started exploring this right away.

Good news 1 = I was headed in the right direction even before I posted.
Good news 2 = I'm even closer now.  I almost got it to work.

I tried to adjust the OPACITY on a BLEND NODE using $TIME to make an item fade in and out.

My function is:  $TIME --> COSINE  -->  ABSOLUTE_VALUE

I figured I should avoid negative values for opacity.

RESULT:
In Substance Player, the item starts invisible, and gradually fades in until the 1-second mark.
Then stays fully visible.  It never fades out.

QUESTIONS:
Cosine(0) = 1  so my opacity really should start fully visible, not invisible.
Why does it remain visible, even when I change move the slider all the way to 6 seconds?
The trig functions use radians, I assume, not degrees.  But if I'm wrong, that still doesn't explain the behavior.

Any idea what I might have missed?



ADDED a few minutes later...

1) Ah ha!
2) A new mystery.

I just realized the behavior is as if the Cosine function isn't working.

That would explain why it fades in from Invisible (Opacity=0) to Visible (Opacity=1) over the first one second on the timeline.  And once it exceeds 1 second, it just gets clamped to "1" because it can't get more visible than that.

Now to figure out why it's not behaving like a Cosine wave...
Last Edit: November 07, 2015, 07:12:39 pm
Hobbyist
----------
Common "Help" suggestions:
- LOG FILE tips - https://forum.allegorithmic.com/index.php/topic,22451.0.html
- LICENSING issues https://www.allegorithmic.com/contact
- ATTACH files and pictures to posts: https://forum.allegorithmic.com/index.php/topic,23670.0.html

Your screenshot shows that the function output is the "get float" / $time node (it's yellow).
If you want the "Absolute" node to be the output, right click on it and select / set as output.
Product Manager - Allegorithmic

@Nicolas,

Yes, that is exactly what the problem was.  Thank you.

Believe it or not, I actually started to think about that when I was working on another function for a different project.  I looked at the color of the node, and wondered if that was significant.  But somehow I convinced myself the color was simply the one that was selected last.  I'm not sure what lead me to think that.  But I did rediscover the "Set as Output Node" click while working on that other project last night, and wondered about it again.

Strange, though, that the last of the chain isn't automatically the Output node.

SOLUTION:  In this case, all I was missing was to right-click on my Absolute Value node and "Set as Output Node."


Last Edit: November 09, 2015, 02:13:12 pm
Hobbyist
----------
Common "Help" suggestions:
- LOG FILE tips - https://forum.allegorithmic.com/index.php/topic,22451.0.html
- LICENSING issues https://www.allegorithmic.com/contact
- ATTACH files and pictures to posts: https://forum.allegorithmic.com/index.php/topic,23670.0.html

Quote
Strange, though, that the last of the chain isn't automatically the Output node.

You could duplicate the three nodes and in this case the "last node" is not defined.
Product Manager - Allegorithmic

Hmm, I suppose you could have "extra" nodes hanging around, and it wouldn't know which one is the output.

It didn't occur to me that a node in the middle (or beginning) of a function could be the active output node.

When you have a simple, straight line like mine, it seems so obvious that the last one (that says "Output" on the connector) would naturally be where the output is.

I do now remember seeing this when I was following a tutorial several months ago.  And I sort of figured it out while working on my "Binary Opacity" problem, but your response solidified that half-formed thought in my head, and I got it running on the first try now.

Asking the user the right-click and set the output node is not unreasonable.  Hopefully I'll remember it sooner next time.

Thanks again for helping.   :)
Hobbyist
----------
Common "Help" suggestions:
- LOG FILE tips - https://forum.allegorithmic.com/index.php/topic,22451.0.html
- LICENSING issues https://www.allegorithmic.com/contact
- ATTACH files and pictures to posts: https://forum.allegorithmic.com/index.php/topic,23670.0.html

I know this is such an old chain but there's just not that much out there about the $time variable and I'm losing my mind. I guess you could say I am still a bit of a novice at Designer. I mainly just don't understand how you apply these functions to the actual parameter/attribute you want them affecting. How do you open up the function graph view. How does the normal graph view connect to the function graph etc.... any info at all about this would be amazing. thank you

I know this is such an old chain but there's just not that much out there about the $time variable and I'm losing my mind. I guess you could say I am still a bit of a novice at Designer. I mainly just don't understand how you apply these functions to the actual parameter/attribute you want them affecting. How do you open up the function graph view. How does the normal graph view connect to the function graph etc.... any info at all about this would be amazing. thank you

Check this out, it's quite basic https://m.youtube.com/watch?v=byOH2rG4fMg

I know this is such an old chain but there's just not that much out there about the $time variable and I'm losing my mind. I guess you could say I am still a bit of a novice at Designer. I mainly just don't understand how you apply these functions to the actual parameter/attribute you want them affecting. How do you open up the function graph view. How does the normal graph view connect to the function graph etc.... any info at all about this would be amazing. thank you

Wow, I'm happy so see this old thread of mine get a second life.

I think the key to your question is the target application needs to feed the $TIME variable when you use the Substance.

In my case, I was using the iClone animation software from Reallusion.  I actually had to submit an enhancement request for them to add that feature to their Substance support, and they did it.  Yay!

You should also be able to see it in Substand Player.  I'm pretty sure that has a "Play" button in it.  (I'm wrapping up my lunch break at work, and am not at home with my "fun" computer right now.)

I hope that helps.  Good luck, and have fun.
Hobbyist
----------
Common "Help" suggestions:
- LOG FILE tips - https://forum.allegorithmic.com/index.php/topic,22451.0.html
- LICENSING issues https://www.allegorithmic.com/contact
- ATTACH files and pictures to posts: https://forum.allegorithmic.com/index.php/topic,23670.0.html

will i work on unreal engine? or do i need to drive the animation via the engine tick?
thx!