Expressions/Scripts/Presets

 
sjj
Topic Author
Posts: 1
Joined: Wed Jan 11, 2012 2:56 am

effect>text>numbers (how to step the numbers over 9 frames)

Wed May 08, 2013 6:15 am

Hi,

I'm using the numbers effect to generate an avi for a list of numbers from 1 to 80, problem is i need each number to display for 9 frames? Could anyone explain how to do this with an expression and a brief explanation?

I'm using it as a texture in a 3d animation, i did one by hand but now my client wants to change the font!

Thanks in advance.

SJJ
 
Paul Tuersley
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Re: effect>text>numbers (how to step the numbers over 9 fram

Wed May 08, 2013 11:45 am

You can do this with an expression on the Numbers effect's Value property or the Source Text property of a text layer.
time returns the current comp time in seconds, so time divided by the duration of one frame (in seconds) gives you the time in frames:
time / thisComp.frameDuration;

you want each to last 9 frames so you could divide that by 9:
(time / thisComp.frameDuration)/9;

but you also want the result of this to be rounded down to the nearest integer (whole number):
Math.floor((thisComp.frameDuration)/9);

but as this starts from 0, you also need to add 1 to make it start from 1:
Math.floor((time / thisComp.frameDuration)/9)+1;

Who is online

Users browsing this forum: No registered users and 1 guest