Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression for decreasing a value over time after a keyframe is hit?

  • Expression for decreasing a value over time after a keyframe is hit?

    Posted by William Poor on August 31, 2015 at 7:26 pm

    So here’s a fun one. I have a null with a slider on it, and that slider has a bajillion keyframes. I also have a light layer. What I need to happen is: every time there’s a slider keyframe of a certain value (say 50), I need the light to change to 100% intensity and then fade back to zero over the course of a second or two. Here’s the intensity expression I have so far:

    pitch=thisComp.layer(“midi”).effect(“ch_0_pitch”)(“Slider”);
    if(pitch==82){[100];}
    else{[???];}

    I figure the key is in that else{} field…and something involving “value-“…but I’m stumped! Any ideas?

    Thanks!

    Kalleheikki Kannisto replied 10 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    September 1, 2015 at 11:17 am

    You’ll have to check backwards (with a For loop), as far back as the duration of your intended fade, for any frames that are above the threshold value and calculate the light brightness based on how many frames back it fell back below the threshold.

    BTW: Trapcode Soundkeys does such fade expressions automatically.

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