AE弄了个模板,发现正计时和倒计时不统一,请高手看下,是表达式问题吗?
发布网友
发布时间:2022-04-30 16:16
我来回答
共1个回答
热心网友
时间:2023-10-08 22:59
我试了一下,倒计时“秒”比正计时快了0.5s,在每秒的0.5s处倒计时就动了,这个问题不难看出来,并且这么计时肯定是有错误的,问题很好改,正计时没问题,倒计时问题出在了这句:seconds = Math.round(countdownerFrame / framebase)%60;你只要将:
Math.round(countdownerFrame / framebase)%60的Math.round改为Math.ceil就好,不让它四舍五入,让它向上取值就好了。为了确保安全,你最好也把下面的minutes = Math.round(((countdownerFrame / framebase)/60-0.5)%60);
也改成ceil。
把下面我改好的复制粘上去行了。
倒计时:
framebase = 1.0/comp("Music Visualizator 05").frameDuration;
totalDuration = Math.round(comp("Music Visualizator 05").ration)*framebase;
frameAtTime = timeToFrames(t = time + comp("Music Visualizator 05").displayStartTime, fps = 1.0 / comp("Music Visualizator 05").frameDuration, isDuration = false);
countdownerFrame = totalDuration - frameAtTime;
seconds = Math.ceil(countdownerFrame / framebase)%60;
seconds < 10 ? secondsString = "0" + seconds : secondsString = "" + seconds;
minutes = Math.ceil(((countdownerFrame / framebase)/60-0.5)%60);
minutes < 10 ? minutesString = "0" + minutes : minutesString = "" + minutes;
timecodeDisplay = minutesString + ":" + secondsString;