Activity › Forums › Adobe After Effects Expressions › Add to a value every n frames
-
Add to a value every n frames
Posted by Samuli Alapuranen on November 11, 2023 at 5:18 pmHi!
I want to add +1 to the value of a time remap every 60 frames and hold. How to proceed?
Samuli Alapuranen replied 10 months ago 2 Members · 4 Replies -
4 Replies
-
Dan Ebberts
November 11, 2023 at 5:22 pmDepending on where you want it to start, it might be as simple as this:
Math.floor(timeToFrames(time)/60)
-
Samuli Alapuranen
November 11, 2023 at 5:41 pmThanks!
Works otherwise, but for some reason this expression adds +50 to the value every 60frames instead of +1.
May this has got to do with the composition where the time remapped layer is placed in is 50 fps?
EDIT: did a little editing for clarification
-
Dan Ebberts
November 11, 2023 at 5:55 pmTime remap values are in seconds, so if you add 1, that will amount to a 50 frame bump each increment. Maybe you want something like this:
framesToTime(Math.floor(timeToFrames(time)/60))
-
Samuli Alapuranen
November 11, 2023 at 6:01 pmI think I got this!
(Math.floor(timeToFrames(time)/60))/50
Reply to this Discussion! Login or Sign Up