Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change specific keyfame’s value by expression

  • Change specific keyfame’s value by expression

    Posted by Hung Nguyendac on October 1, 2018 at 8:31 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.

    Hung Nguyendac replied 7 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 1, 2018 at 3:50 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

  • Hung Nguyendac

    October 2, 2018 at 1:58 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.

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