Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Detect Shape Layer Path

  • Detect Shape Layer Path

    Posted by Michael Ponch on July 10, 2024 at 1:30 pm

    Hi everyone!

    I need an AE expression that detects if a layer is a Shape Layer AND has at least a path.

    I appreciate any help.

    Thanks in advance!

    Michael

     

     

     

    Brie Clayton replied 2 years ago 3 Members · 3 Replies
  • 3 Replies
  • Julian Chojnacki

    July 10, 2024 at 2:43 pm

    Hi Michael,

    you can check if a layer is a shape layer like this:

    isShapeLayer = thisLayer.content instanceof Group;

    isShapeLayer; // Returns 1/true or 0/false

    Regarding the path detection: do you explicitly need to check for Bezier Paths, or would it be enough to check for any existing content (groups, primitives, paths)?

    The latter could look like this:

    hasContent = thisLayer.content.numProperties > 0;

    hasContent; // Returns 1/true or 0/false

    Both combined:

    L = thisLayer;

    isShapeLayer = L.content instanceof Group;

    hasContent = L.content.numProperties > 0;

    isShapeLayer && hasContent; // Returns 1/true or 0/false

  • Michael Ponch

    July 11, 2024 at 10:26 am

    Thanks very much! This is what I needed 🙂

  • Brie Clayton

    July 11, 2024 at 1:27 pm

    Thank you, Julian, for providing the answer!

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