Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Checkbox controlled Keyframe value

  • Checkbox controlled Keyframe value

    Posted by Gerben Greuliker on May 20, 2025 at 1:53 pm

    Hi There,

    I’m trying to make a checkbox controlled blur on a layer. I want the option to switch of the blur in an Essential Graphic if it is desired.

    So I found this script and it (almost) does the trick. But when the checkbox is unchecked the blur ramps up to its 2nd keyframe value to drop to zero when on key. I think that the problem lies between the parentheses of the ‘ease’ part but don’t know how to solve this. To make it more complex, I also want it to be keyframed in reverse on the same layer…

    checkboxOn=thisComp.layer("CHECKBOX-CTRL").effect("BLUR-ON_OFF")("Checkbox")[0];

    keyframeValue=15;

    k1 = key(1).time;

    k2 = key(2).time;

    if (time<=k1) value;

    else

    if (time>k1 & time<k2) ease(time,k1,k2,value,keyframeValue)

    else

    if (checkboxOn)(keyframeValue)

    else

    value

    Gerben Greuliker replied 12 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    May 20, 2025 at 3:10 pm

    So what is it that you want the checkbox to do, exactly?

  • Dan Ebberts

    May 20, 2025 at 7:02 pm

    Maybe start with something like this:

    checkboxOn=thisComp.layer("CHECKBOX-CTRL").effect("BLUR-ON_OFF")("Checkbox").value;
    keyframeValue=15;
    k1 = key(1).time;
    k2 = key(2).time;
    if (checkboxOn){
    ease(time,k1,k2,valueAtTime(k1),keyframeValue);
    }else
    value
  • Gerben Greuliker

    May 20, 2025 at 9:45 pm

    Hi Dan,

    The idea is to control the value of key(2) to 0 or 15.
    The expression you posted definitely does solve the problem! Many Thanx!
    Good to see that I was looking in the right direction with the valueAtTime, just didn’t know how to implement it correctly.

    If I could ask for one more thing; I also would like the expression to reverse at the end of the clip.
    So there would be an key(3) and Key(4). Where key(3) would get its value from the checkbox and key(4) would be 0. Or is there a more simple solution?

    Gr Gerben

  • Brie Clayton

    May 21, 2025 at 1:04 am

    Thanks for solving this, Dan!

  • Dan Ebberts

    May 21, 2025 at 3:46 am

    This would be one way:

    checkboxOn=thisComp.layer("CHECKBOX-CTRL").effect("BLUR-ON_OFF")("Checkbox").value;
    keyframeValue=15;
    k1 = key(1).time;
    k2 = key(2).time;
    k3 = key(3).time;
    k4 = key(4).time
    if (checkboxOn){
    if (time < (k2 + k3)/2){
    ease(time,k1,k2,valueAtTime(k1),keyframeValue);
    }else{
    ease(time,k3,k4,keyframeValue,valueAtTime(k4));
    }
    }else
    value
  • Gerben Greuliker

    May 21, 2025 at 9:43 am

    Works like a charm!
    Many thanks for your time and help, very much appreciated!

    Gr Gerben

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