-
Script to show/hide some layers
Hi,
I’m working on a big multilingual AE project.
So far, I’ve managed the different language thanks to expression: I’ve created a controller layer in my top composition with 3 checkboxes (one per language) to control layers opacity. For instance here’s the expression I have on a typical English title:
if(comp(“Final”).layer(“Language”).effect(“English”)(“Checkbox”) == 1) 100 else 0It works as expected but now this project becomes too big for this method. I’m not sure what’s going on in the background but now the render time for the whole project goes beyond 5 hours. If I manually disable the layers using the eyeball button in the timeline (instead of turning opacity to 0 with the expressions), my render time falls down to 1 hour.
So I’m wondering if a script could do the job.
Basically, I could rename the layers that need to be shown or hidden by adding the language code at the end of their names (EN for English, FR for French…). So the script will have to scan all the layers in the project and disable/enable the layers based on the last 2 characters of their names.First big question: does a script can do that?
I have basic knowledge of javascript but never did any scripting in AE.
The first main problem I have is to find a way to get the script scanning through all the layers in all comps.