Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using a marker to control timing of specific set of keyframes.

  • Using a marker to control timing of specific set of keyframes.

    Posted by Dennis Cheung on March 25, 2019 at 5:26 pm

    Hi

    I’m using the code below to build a toolkit that allows the client to adjust the animation based on where they place the marker “GO.” The layer has two keyframes, the client would adjust the marker to set when the animation would occur. This works great for two keyframes. So for simple motion like fade on, I would have two keyframes on opacity to fade on, they would animate as normal. For fade out, I would place two keyframes in effect>transform>opacity, the client would adjust the fade out keys using a marker. Essentially I’m separating opacity animation between the default opacity and effects>transform>opacity.

    What I want to know is: is there a way to place all four keyframes on opacity and have the marker only controlling the second pair of keyframes?

    Below is the code I’m currently using.

    Thank you all,
    Dennis

    <code>actionMarker=thisComp.marker.key("GO").time;
    delayTime=framesToTime(0);

    valueAtTime(time-actionMarker+delayTime);
    </code>

    Dan Ebberts replied 7 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    March 25, 2019 at 6:19 pm

    Try this:


    actionMarker = thisComp.marker.key("GO").time;
    if (time < key(2).time){
    value;
    }else if (time < actionMarker){
    valueAtTime(key(2).time);
    }else{
    valueAtTime(key(3).time + time - actionMarker);
    }

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy