Page 1 of 1

Animation between markers

Posted: May 3rd, 2022, 2:17 am
by filipsbaumanis

I've always been more of a design/creative type of guy rather than a mathematics/logics/coding type of a guy. This seams like a basic thing to solve, but I've spent several hours and still couldn't come up with solution. I'm working on a project where i'd like animation to happen between markers. It should work regardless how many markers there are (obviously more than 2)
- it should animate from 0 to 100 in between the markers
- reset to 0 and start all over again as the play head reaches next marker.
- continue like that until the last marker is reached

here is a quick example i created with keyframes, but would be great if the same thing could be achieved by expressions. Can you help?

Re: Animation between markers

Posted: August 24th, 2022, 12:58 pm
by filipsbaumanis

Ok. Zero responses. Looks like this forum is dead. 4 months later I figured this out myself. Just in case anyone else finds it useful - here is the Expression code for the scale parameter:

n = 0;
if (thisLayer.marker.numKeys > 0){
n = thisLayer.marker.nearestKey(time).index;

if (thisLayer.marker.key(n).time > time){ n--; }

if (n == 0){


animIn = thisLayer.marker.key(n).time;
animOut = thisLayer.marker.key(n+1).time;

w = linear(time, animIn, animOut, 0, 100);


}catch (err){