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 pmHi 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 pmHi 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
Reply to this Discussion! Login or Sign Up