keyframes control with layer markers

Moderators: Disciple, zlovatt

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

Hello,



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){

n--;

}

}if (n == 0){

valueAtTime(0);

}else{

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

valueAtTime(t)

}



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!

Thanks
Attachments
test_slider.zip
AE CS4 project file
(16.67 KiB) Downloaded 865 times
themessers
Posts: 4
Joined: March 6th, 2015, 6:33 am

Hello,
i think your problem is to understand what this block of code does, please check the last bullet point of this topic:
https://aexpr.wordpress.com/2015/04/23/ ... f-the-box/

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