【发布时间】:2022-12-03 17:29:51
【问题描述】:
Adobe After Effects supports Javascript and provides a hany method of time.
It provides a floating point number of current time of the composition and can be used in numerous ways.
60 - time // Starts the countdown timer from 60.
I\'m trying to create countdown timer that starts from a random number and resets to 59 once it hits 0.
There are few ways to achieve it but I need a expressions-only solution as I want multiple repetitions and want to avoid multiple comps and layers.
seedRandom(45, timeless=true) // Random shouldn\'t generate at every frame.
r = random(1, 59)
sec = r - time
if (sec < 0) {
sec = 60 - (time%60);
}
Math.floor(sec);
Problem:
The above code works but repeats from the random number for the first two iterations rather than start from first time only.
Any help is much appreciated.
标签: javascript extendscript after-effects
sec.