Skip to main content
Participant
July 27, 2022
Question

After Effects Trigger Animation By Markers

  • July 27, 2022
  • 1 reply
  • 1218 views

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

This topic has been closed for replies.

1 reply

Mylenium
Legend
July 27, 2022

It's always best to go back to the original source:

 

http://www.motionscript.com/design-guide/marker-sync.html

 

Mylenium