ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Linking Keyframes To Layer Marker Question

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Quest Rogers
Linking Keyframes To Layer Marker Question
on Oct 17, 2017 at 5:10:42 pm

Hi. I looking for some advice on linking keyframes to a layer marker.

Normally I only do this with two keyframes using the expression seen below. I've seen other examples of this expression linking multiple keyframes to different layer markers. But this isn't what I'm trying to do.

I'm trying to figure how to apply some form of this expression to a layer with three keyframes. Keyframes 1 to 2 are a quick animation in. Keyframes 2 to 3 are a slow movement that continues from keyframe 1. So basically a quick animation in, then slow movement. I'd like to be able to control where the last (3rd) keyframe ends in my comp with a layer marker. Is this possible with some form of the expression below?

L = thisComp.layer("Control");
if ((L.marker.numKeys > 0) && (numKeys > 1)){
t1 = key(1).time;
t2 = L.marker.key(1).time;
val1 = valueAtTime(key(1).time);
val2 = valueAtTime(key(2).time);
linear(time,t1,t2,val1,val2);
} else {
value;
}


Return to posts index

Dan Ebberts
Re: Linking Keyframes To Layer Marker Question
on Oct 17, 2017 at 6:10:38 pm

Try this:


L = thisComp.layer("Control");
if ((L.marker.numKeys > 0) && (numKeys > 2) && (time > key(2).time)){
t2 = key(2).time;
t3 = key(3).time;
tm = L.marker.key(1).time;
t = linear(time,t2,tm,t2,t3);
valueAtTime(t);
}else
value



Dan



Return to posts index

Quest Rogers
Re: Linking Keyframes To Layer Marker Question
on Oct 17, 2017 at 7:50:42 pm

That did the trick. Thanks Dan! Out of curiosity what's the 'tm' for? Time-marker?


Return to posts index


Dan Ebberts
Re: Linking Keyframes To Layer Marker Question
on Oct 17, 2017 at 8:18:45 pm

It's just a variable name for the marker time. I could have used anything. I used 'tm' because it's short and stands out from the variables representing keyframe times.

Dan



Return to posts index

Marcelo Cabral
Re: Linking Keyframes To Layer Marker Question
on Oct 18, 2017 at 12:35:42 pm

Hi Dan
I´m following this post. The expression works awesome! How to modify the expression to trigger the entire animation using two layer marks. I mean, the first mark will trigger the keyframe 1 and the second mark will control when the animation finishes. Thank you!


Return to posts index

Quest Rogers
Re: Linking Keyframes To Layer Marker Question
on Oct 18, 2017 at 1:21:18 pm

Oh ok. Gotcha. Thanks again!


Return to posts index

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