ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dennis Cheung
Using a marker to control timing of specific set of keyframes.
on Mar 25, 2019 at 5:26:57 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>


Return to posts index

Dan Ebberts
Re: Using a marker to control timing of specific set of keyframes.
on Mar 25, 2019 at 6:19:40 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



Return to posts index

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