ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Triggering animation with layer marks

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marcelo Cabral
Triggering animation with layer marks
on Oct 21, 2017 at 1:03:00 pm

Hi, I´m using this expression to trigger the last keyframe of three simple keyframes. 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!

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


Return to posts index

Dan Ebberts
Re: Triggering animation with layer marks
on Oct 21, 2017 at 2:50:03 pm

Is the time from keyframe 1 to keyframe 2 fixed, or does the whole animation stretch/compress?

Dan



Return to posts index

Marcelo Cabral
Re: Triggering animation with layer marks
on Oct 21, 2017 at 10:42:56 pm

Hi Dan
What I need is the whole animation. The current expression is stretching the time between keyframe 2 and 3.


Return to posts index


Dan Ebberts
Re: Triggering animation with layer marks
on Oct 21, 2017 at 11:08:56 pm

I think this is what you're asking for, but I'm not sure:


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



Dan



Return to posts index

Dan Ebberts
Re: Triggering animation with layer marks
on Oct 22, 2017 at 12:01:18 am

That wasn't right. Maybe this is closer:


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



Dan



Return to posts index

Marcelo Cabral
Re: Triggering animation with layer marks
on Oct 22, 2017 at 3:04:00 am

Thank you, Dan! I will give it a try. Sure is fine :)


Return to posts index


Marcelo Cabral
Re: Triggering animation with layer marks
on Oct 26, 2017 at 11:45:45 am

Hi Dan
The expression works perfectly! Thank you. :)


Return to posts index

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