Use AbsTime Class - Tip in TouchDesigner#1
AbsTime means “absolute time”.
According to the TouchDesigner official wiki, AbsTime means “absolute time”. The time TouchDesigner has been running since the process started.
When you open TouchDesigner, it will keep running until closing it. And you cannot control it any more. AbsTime is Read Only class.
AbsTime is Read Only.
AbsTime Class Members
It contains 4 members,
- frame
- seconds
- step
- stepSeconds
Let’s explore all of them.
1. frame
AbsTime.frame
“frame” will show the total number of frames played since touchdesigner started.
You can see the picture, the “frame” value is higher and higher.
2. seconds
AbsTime.seconds
“seconds” will show the total number of seconds played since touchdesigner started.
Also, the “seconds” value is higher and higher.
But it’s lower than “frame”.
The reason is in the default setup. FPS is 60.
You can find the information at the bottom of the interface.
3. step
4. stepSeconds
AbsTime.stepAbsTime.stepSeconds
Let’s put “step” and “stepSeconds” together.
According to the definition of wiki.
“step” is the number of absolute frames elapsed between start of previous and current frame.
“stepSeconds” is absolute time elapsed between start of previous and current frame.
In the picture, “step” is 1, “stepSeconds” is 0.01667.
We can count “stepSeconds” manually.
Our FPS is 60, it means it will play 60 frames in 1 second.
1 / 60 = 0.016666666666667
Yes, that’s what we expect.
So, you can do something like this. They’ll almost be the same.
absTime.frame * absTime.stepSeconds
The “step” and “stepSeconds” look like constants. Thats a good thing for us, you definitely don’t want to see it like using an old computer to play online FPS game.