Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions AE recursive check through layers

  • AE recursive check through layers

    Posted by Boris Wilmot on September 9, 2024 at 12:13 pm

    Hi everyone,

    I’m looking for a recursive expression that would go through layers and return the index of the first layer with a specific name.

    The exact idea for the expression would be to find the first layer above the expression layer, with the name “column”. Then to return its index.

    Thx

    Brie Clayton
    replied 1 month ago
    3 Members · 3 Replies
  • 3 Replies
  • Andrei Popa

    September 9, 2024 at 12:48 pm

    This should work(if no “column” layer is found, it will return 0):

    idx = index;

    layerIdx = 0;

    while (idx >=1 && layerIdx == 0){

    if(thisComp.layer(idx).name == "column") layerIdx = idx;

    idx--;

    }

    layerIdx

  • Boris Wilmot

    September 10, 2024 at 12:21 pm

    It works like a charm !

    Thanks a lot Andrei

  • Brie Clayton

    September 10, 2024 at 2:44 pm

    Thank you for solving this, Andrei!

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