Copy link to clipboard
Copied
Hi, guys! I'm a newbie motion designer. And I have difficulties with anderstanding expressions. I have this expression which attached to size property. This ends animation when it hits the nearest marker. But I need to have more markers before my animation ends. Is it possible to trigger only the last marker to end my animation. Thank you a lot for your help.
n = 0;
if (thisComp.marker.numKeys > 0) {
n = thisComp.marker.nearestKey(time).index;
if (thisComp.marker.key(n).time > time) n--;
}
if (n > 0) {
try {
t = time - thisComp.marker.key(n).time;
if (n % 2 == 1) {
lastKeyTime = thisProperty.key(thisProperty.numKeys).time;
thisProperty.valueAtTime(lastKeyTime - t);
} else {
thisProperty.valueAtTime(t + thisProperty.key(1).time);
}
} catch (err) {
value
};
} else value
Copy link to clipboard
Copied
It's always best to go back to the original source:
http://www.motionscript.com/design-guide/marker-sync.html
Mylenium