Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scripting (not expressions): Setting the layer’s “active” property?

  • Scripting (not expressions): Setting the layer’s “active” property?

    Posted by Quba Michalski on September 22, 2014 at 11:33 pm

    I am trying to figure out how can I set the layer’s active property to false (turn off the little eye icon via script). using setValue() and simple =false commands results in either an error or a read-only value prompt.

    Is it possible to do so (and no, if possible I’d like to avoid resorting to just setting opacity to 0).

    mypLayer.active.setValue(false);

    Quba Michalski
    qubahq.com

    Dan Ebberts replied 8 years, 5 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    September 22, 2014 at 11:40 pm

    It’s an attribute, so you can just set the value:

    mypLayer.active = false;

    Dan

  • Quba Michalski

    September 22, 2014 at 11:48 pm

    …it does not seem to work 🙁

    So I have a composition in my project already assigned to the name of “depthMapComp”

    I successfully add it to my current composition (theComp), but get that “read only attribute” error when I try to change its active state

    var depthMapLayer = theComp.layers.add(depthMapComp);
    depthMapLayer.active = false;

    Quba Michalski
    qubahq.com

  • Dan Ebberts

    September 22, 2014 at 11:59 pm

    Ah yes, sorry–that slipped right by me. Try enabled instead of active.

    Dan

  • Quba Michalski

    September 23, 2014 at 12:07 am

    Dan Dan Dan the Man
    Dan’s the Man, da-dan-da-da-dan
    Dan’s the Man, Dan’s the one,
    None gets done sans Dan the Man

    Thank you!

    Quba Michalski
    qubahq.com

  • Vishal Jain

    December 8, 2017 at 11:32 am

    Revisiting this after a long time.

    How can I link this to a checkbox?

    I am trying to make a pseudo effect for After Effects where the user can choose a layer active or not simply clicking the checkbox. Since the number of layer is >20, I will be using shy-layers.

    Please help!

    mypLayer.enabled = false;

    Photoshop
    After Effects
    Cinema4D
    Vizrt

  • Dan Ebberts

    December 8, 2017 at 7:25 pm

    You can’t control the enabled state with expressions. I think the best you could do would be to control the opacity.

    Dan

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