keyframes control with layer markers

Moderators: Disciple, zlovatt

Post Reply
Posts: 1
Joined: April 9th, 2015, 8:04 am


I have an animation of a line that has two sets of keyframes of two different properties in CS4.

Basically a line gets generated in the first phase then it gets cleared out in the second phase.

This is done using two slider controls that act on the horizontal size of two rectangles and using merge paths (using the second rectangle as a matte for the first to clear it out)

I've put two layer markers on my layer hoping to link the keyframes to each of them.

Then I have found this script on the web and I put it on the first property :

L= thisComp.layer("ShapeLayer");

n = 0;

if (L.marker.numKeys > 0){

n = L.marker.nearestKey(time).index;

if (L.marker.key(n).time > time){



}if (n == 0){



t = time - L.marker.key(n).time;



This indeed lets me move the whole animation with the layermarker (which is very good) but I can't find a way to link the second set of keyframes to do the output.

I will add the project file

Please help!

AE CS4 project file
(16.67 KiB) Downloaded 467 times
Posts: 4
Joined: March 6th, 2015, 6:33 am

i think your problem is to understand what this block of code does, please check the last bullet point of this topic: ... f-the-box/

with if/else condition you can define the 2 states you want to execute
Post Reply