• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit
• An expression that adds up

New Here ,
Jan 26, 2024 Jan 26, 2024

Copied

Hello,

I'm trying to find out if there's an expression that adds up every X images?

The problem:
A machine that 2 times per second will increase its value by 88kg.
In other words, a calculation that would add the imposed figure of 23604 by 88 every 12 images.

As I couldn't find this calculation, I did it by hand ^^, but I'd still like to find a less restrictive solution.

Thanks

TOPICS
Expressions

Views

80

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
2 Replies 2
Community Expert ,
Jan 26, 2024 Jan 26, 2024

Copied

If you start by subtracting the layer's inPoint from the time, then divide that number by the interval and use Math.floor() to keep the value a whole number, you will get an even number multiplier you can use to add that value to a starting number. The expression is fairly simple. Add it to a text layer/Text property and you have your counter.

``````t = time - inPoint;
count = t / .5; // interval time in seconda
num = Math.floor(count);
step = 88 * num; // value increase
strt = 23604 + step; // starting Number
result = strt + "kg"``````

To keep the numbers from bouncing around, you will need to use a monospaced font like Courier;

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jan 26, 2024 Jan 26, 2024

Copied

LATEST

Thank you very much! It works perfectly ðŸ™‚