ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

trigger KF animation from a marker on a different layer + preroll + ignore first marker

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Roei Tzoref
trigger KF animation from a marker on a different layer + preroll + ignore first marker
on Oct 17, 2017 at 9:14:33 am

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 animation

if 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


Return to posts index

Dan Ebberts
Re: trigger KF animation from a marker on a different layer + preroll + ignore first marker
on Oct 17, 2017 at 1:26:23 pm

Something like this:


preroll = 1;
L= thisComp.layer("Controller");
n = 0;
t0 = time + preroll;
if (L.marker.numKeys > 0){
n = L.marker.nearestKey(t0).index;
if (L.marker.key(n).time > t0) n--;
}
if (n < 2){
t = 0;
}else{
t = t0 - L.marker.key(n).time;
}
valueAtTime(t)



Dan



Return to posts index

Roei Tzoref
Re: trigger KF animation from a marker on a different layer + preroll + ignore first marker
on Oct 17, 2017 at 11:05:07 pm

Thank you Dan. elegant as usual.

Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]