ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change specific keyfame's value by expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Hung NguyenDac
Change specific keyfame's value by expression
on Oct 1, 2018 at 8:31:09 am

Hello folks. Is there any way to make expression control like this image? I know the expression can change the value if I write on Slider, but I want to find another way to make it work on another layer.


Return to posts index

Dan Ebberts
Re: Change specific keyfame's value by expression
on Oct 1, 2018 at 3:50:11 pm

Something like this might work:


s = effect("Slider Control")("Slider");
c = effect("Checkbox Control")("Checkbox");
val = s.value;

if (s.numKeys > 4){
if (c.value){
if (time > s.key(3).time && time < s.key(4).time){
val = linear(time,s.key(3).time,s.key(4).time,s.key(3).value,100);
}else if (time > s.key(4).time && time < s.key(5).time){
val = linear(time,s.key(4).time,s.key(5).time,100,s.key(5).value);
}
}
}
val



Dan



Return to posts index

Hung NguyenDac
Re: Change specific keyfame's value by expression
on Oct 2, 2018 at 1:58:49 am

Thank you very much Dan, it works like a charm.

BTW. With this expression the Opacity Property's value will not get 100 if i don't add the key(5), then i found another way by precomp layer and use simple If function.


Return to posts index

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