Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions turn off light layers via scripting?

  • turn off light layers via scripting?

    Posted by Santi Agustí on September 10, 2014 at 1:04 am

    Hi!

    I’d need to turn off all light layers on an entire project (or maybe the option to switch them on/off), and this is not possible via expressions, right? (via expressions using a checkbox would be perfect, but not possible I think)
    Is it possible to be done via scripting?

    Many thanks!!

    Santi Agustí replied 11 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 10, 2014 at 4:02 am

    You can’t do it with an expression, but you could turn them off with a script like this:


    var myComp;
    for (var i = 1; i <= app.project.numItems; i++){
    if (app.project.item(i) instanceof CompItem){
    myComp = app.project.item(i);
    for (var j = 1; j <= myComp.numLayers; j++){
    if (myComp.layer(j) instanceof LightLayer) myComp.layer(j).enabled = false;
    }
    }
    }

    Dan

  • Santi Agustí

    September 10, 2014 at 5:58 pm

    thanks!!

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