-
trigger KF animation from a marker on a different layer + preroll + ignore first marker
Hi,
I am trying to trigger a property with keyframe animation of a layer from a marker on a controller layer, the expression works but I need 2 more things:
1. to have a preroll to the marker time of my choosing. this way the marker will start at the peak of the animation and the start will be prerolled before the marker (let’s say 1 sec before the marker the animation should start).
2. ignore the first marker. I want to set a comment on the first marker as instructions so I don’t want the 1st marker to trigger the animationif possible, I’d like an explanation on what each string does …. like this // so that I won’t come back each time I got a question :/
this is how a basic setup looks:
L= thisComp.layer("Controller");
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(t);
}else{
t = time - L.marker.key(n).time;
valueAtTime(t)
}Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com