Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions (Scripting) – Is there a way to determine if a layer style exists?

  • (Scripting) – Is there a way to determine if a layer style exists?

    Posted by Scott Higgs on February 4, 2010 at 12:15 am

    Sorry if this is not the right forum for AE scripting questions – it’s the closest I could find.

    When I try to determine whether or not a layer has a drop shadow layer style applied using the code below, I always get TRUE, even if the layer in question has no drop shadow applied. Likewise checking its distance value always gives the default 5 (unless a drop shadow has actually been applied, in which case I get the correct distance value).

    Do the propertyGroup objects for Layer Styles and Drop Shadow always exist somewhere behind the scenes? I just need to determine if a layer has a visible drop shadow or not. I feel like I must be missing something obvious…

    Thanks in advance.

    alert(curLayer.layerStyle.property("Drop Shadow").enabled);//yields true
    alert(curLayer.layerStyle.property("Drop Shadow").property("Distance").value); //yields 5 if no D.S. applied

    -Scott

    Dan Ebberts replied 16 years, 6 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    February 4, 2010 at 4:15 am

    I don’t know of any way to detect that, sorry.

    Dan

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