ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Adding all checkboxes on a layer to an array

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Robin de Man
Adding all checkboxes on a layer to an array
on Feb 10, 2020 at 11:04:24 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?


Return to posts index

Alex Printz
Re: Adding all checkboxes on a layer to an array
on Feb 11, 2020 at 6:22:48 pm

it would be something like this:

L = thisComp.layer("target_layer_with_checkboxes");
i = 1;
output = undefined;
while(i &lt;= 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


Return to posts index

Robin de Man
Re: Adding all checkboxes on a layer to an array
on Feb 12, 2020 at 10:02:51 am

Thanks, this helped a lot.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]