Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding all checkboxes on a layer to an array

  • Adding all checkboxes on a layer to an array

    Posted by Robin De man on February 10, 2020 at 11:04 am

    I have a null layer with multiple control effects like checkboxes and sliders.
    What I like to do is collect all checkboxes in an array and loop through them to see which one is true.

    I’m using those checkboxes to change the language of all text in my animation, which are stored in a json file.
    Now i’m collecting those checkboxes by adding them with the pickwhip. It works fine as long as the list of languages aint to long.

    Can anyone help?

    Robin De man replied 6 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Alex Printz

    February 11, 2020 at 6:22 pm

    it would be something like this:

    L = thisComp.layer("target_layer_with_checkboxes");
    i = 1;
    output = undefined;
    while(i <= L(4).numProperties){
    if (L.effect(i)(1).name == "Checkbox" && L.effect(i)(1) == 1){
    output = i;
    break;
    }else i++;
    }
    output

    Alex Printz
    Mograph Designer

  • Robin De man

    February 12, 2020 at 10:02 am

    Thanks, this helped a lot.

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