ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Scripting (not expressions): Setting the layer's "active" property?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Quba Michalski
Scripting (not expressions): Setting the layer's "active" property?
on Sep 22, 2014 at 11:33:22 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


Return to posts index

Dan Ebberts
Re: Scripting (not expressions): Setting the layer's "active" property?
on Sep 22, 2014 at 11:40:07 pm

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

mypLayer.active = false;

Dan



Return to posts index

Quba Michalski
Re: Scripting (not expressions): Setting the layer's "active" property?
on Sep 22, 2014 at 11:48:57 pm
Last Edited By Quba Michalski on Sep 22, 2014 at 11:55:08 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


Return to posts index


Dan Ebberts
Re: Scripting (not expressions): Setting the layer's "active" property?
on Sep 22, 2014 at 11:59:18 pm

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

Dan



Return to posts index

Quba Michalski
Re: Scripting (not expressions): Setting the layer's "active" property?
on Sep 23, 2014 at 12:07:16 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


Return to posts index

Vishal Jain
Re: Scripting (not expressions): Setting the layer's "active" property?
on Dec 8, 2017 at 11:32:33 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


Return to posts index


Dan Ebberts
Re: Scripting (not expressions): Setting the layer's "active" property?
on Dec 8, 2017 at 7:25:52 pm

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

Dan



Return to posts index

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