Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Disable or Enable an Expression with a Checkbox Control

  • Disable or Enable an Expression with a Checkbox Control

    Posted by Nick Mara on September 29, 2020 at 11:38 pm

    Hi Everybody,

    Is there an expression to Enable/Disable an expression with a Checkbox Control?

    So here is my situation:

    I have an expression on the “End” property of a Trim Path and the same expression on the “Start” property of the same Trim Path.

    I would like to know if there’s a way to turn on the expression of the “End” property while disabling the expression on the “Start” property via a Checkbox Control.

    Here is what I mean:

    https://youtu.be/hxEXAh4qf6w


    I hope everything it’s clear enough.

    I would really appreciate your help.

    Thanksss

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Nick Mara replied 5 years, 7 months ago 3 Members · 5 Replies
  • 5 Replies
  • Brendon Murphy

    September 30, 2020 at 2:58 am

    Add a checkbox effect to Shape_Base, then do this on the start parameter:

    if (effect(“Checkbox Control”)(“Checkbox”)==1){

    //put the original start expression here

    }else{value};

    And then this on the end parameter:

    if (effect(“Checkbox Control”)(“Checkbox”)==0){

    //put the original end expression here

    }else{value};

  • Brendon Murphy

    September 30, 2020 at 3:01 am

    make sure to delete the “//put the original expression here”, including the slashes!

  • Stephen Dixon

    September 30, 2020 at 3:18 am

    Simple, use an if() statement

    let chkbx = [link to checkbox control, use the pickwhip];
    if (chkbx.value){
    [your expression here]
    } else {
    value //returns the keyframed value without the expression
    }

    For the other layer use the boolean not operator: “!

     if (! chkbx.value){
  • Nick Mara

    September 30, 2020 at 7:53 am

    Hey Brendon,

    Thank you so much for providing me this expression.

    It works perfectly Star Struck

  • Nick Mara

    September 30, 2020 at 8:03 am

    Hi Stephen,

    Thanks for your answer !!

    I put the first part of the expression on the “End” property of the Trim Path but I can’ t figure out where to put the boolean not operator: “!”

     if (! chkbx.value){

    You wrote “For the other layer ” but the expressions are on the same layer not on two different layers.

    Am I doing something wrong?

    Thanks


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