Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression Experts! Count Number of Groups within Shape Layer

  • Expression Experts! Count Number of Groups within Shape Layer

    Posted by Brayden Blythe on October 3, 2024 at 8:52 pm

    Hello all, I need some expression help.

    I have a shape layer that has multiple shapes within the “Contents” group.

    I need a variable that is the total number of groups within “Contents”

    This seems like an easy task, but after trying a couple different methods… no luck. How can I accomplish this? Thank you in advance!

    Brie Clayton replied 1 year, 7 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 3, 2024 at 9:18 pm

    Like this maybe:

    p = thisComp.layer("Shape Layer 1")("Contents");
    nGroups = 0;
    for (i = 1; i <= p.numProperties; i++){
    if (p(i).name.indexOf("Group") == 0) nGroups++;
    }
    nGroups
  • Brayden Blythe

    October 3, 2024 at 9:22 pm

    this did the trick! Thank you Dan!

  • Brie Clayton

    October 3, 2024 at 9:37 pm

    Thanks for solving this, Dan!

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