Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
baab_aeenhancers
Topic Author
Posts: 1
Joined: Thu Apr 09, 2015 8:04 am

keyframes control with layer markers

Thu Apr 09, 2015 8:29 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 183 times
 
themessers
Posts: 4
Joined: Fri Mar 06, 2015 6:33 am

Re: keyframes control with layer markers

Sun May 03, 2015 7:35 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest