Copy link to clipboard
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
Copy link to clipboard
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;
Copy link to clipboard
Copied
Thank you very much! It works perfectly 🙂