Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Three checkboxes

  • Dan Ebberts

    March 8, 2015 at 7:20 am

    I don’t believe it can be done in a reliable way. Each of the three expressions feeds into the other two and I don’t think you can set it up so that it will work correctly in all situations.

    Dan

  • Kevin Camp

    March 9, 2015 at 8:12 pm

    i’ve had some success by adding an addition slider control and using that to hold a value that would be used to help control the checkboxes…

    try adding a slider to the same layer as your checkboxes, and manually set the value to 4 (or a value higher than the number of checkbox controls — for some reason this seems to make it work). then add an expression like this to the slider value (set checkbox names as needed for your setup):

    if ( effect("Checkbox Control")("Checkbox") == true ) 0;
    else if ( effect("Checkbox Control 2")("Checkbox") == true ) 1;
    else if ( effect("Checkbox Control 3")("Checkbox") == true ) 2;
    else 0;

    then use an expression like this on the first checkbox:

    if ( effect("Slider Control")("Slider") == 0 ) true else false;

    and the second:

    if ( effect("Slider Control")("Slider") == 1 ) true else false;

    and the third:

    if ( effect("Slider Control")("Slider") == 3 ) true else false;

    i put the slider at the bottom of the effects stack, but i’m not sure that matters.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Chris Scalzo

    March 16, 2015 at 7:17 pm

    Depending on what you are switching, you can create a precomp with solids labeled for choices and read the results of a layer control. Then you’d only get one of your three choices.

    As an example, I made a precomp named “Pre-comp 1” and three layers named “OPT-1″,”OPT-2” and “OPT-3”.

    With the following expression I can return the value 1, 2 or 3 to change whatever else.

    if (comp(“Pre-comp 1”).layer(“OPT-1”).effect(“Layer Control”)(“Layer”) == comp(“Pre-comp 1”).layer(“OPT-1”)){1};
    if (comp(“Pre-comp 1”).layer(“OPT-1”).effect(“Layer Control”)(“Layer”) == comp(“Pre-comp 1”).layer(“OPT-2”)){2};
    if (comp(“Pre-comp 1”).layer(“OPT-1”).effect(“Layer Control”)(“Layer”) == comp(“Pre-comp 1”).layer(“OPT-3”)){3};

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