ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: After Effects script to hide and show layer styles.

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Toms Burāns
Re: After Effects script to hide and show layer styles.
on Jul 7, 2017 at 12:52:17 pm

Managed to do this myself.
This script toggles layer styles on and off for all layers in the currently active composition as well as in all compositions nested inside it.

var activeComp = app.project.activeItem;

if (activeComp == null) {
alert("Select a composition.");
} else {
toggleLayerStyles(activeComp);
}

function toggleLayerStyles(curComp) {
for (var i = 1; i <= curComp.layers.length; i++) {
curL = curComp.layer(i);

if (curL.layerStyle.canSetEnabled == true) {
if (curL.layerStyle.enabled == true) {
curL.layerStyle.enabled = false;
} else {
curL.layerStyle.enabled = true;
}
}
if (curL.source instanceof CompItem) {
toggleLayerStyles(curL.source);
}
}
}


Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]