Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Get Layer of a property via expression

  • Get Layer of a property via expression

  • Arne Münch

    July 8, 2021 at 12:20 pm

    Hi there.
    In Scripting there is this elegant method to find a layer of a property by

    property.propertyGroup(property.propertyDepth)

    I dont find anything like this for the usage in expressions, because propertyDepth doesnt seem to work here. Any solutions?

  • Dan Ebberts

    July 8, 2021 at 6:21 pm

    It’s not elegant, but you can do something like this:

    p = thisProperty;

    while(!(p instanceof Layer)){

    p = p.propertyGroup(1);

    }

  • Arne Münch

    July 9, 2021 at 8:16 am

    Hallo Dan

    Thanks so much, works perfect again.

    Meanwhile I had figured out this far less elegant way;)

    I used try{} and ended with the index of the layer.

    p = thisProperty;
    for (i=0; typeof(layerIndex) != "number"; i++){
    try{layerIndex = p.propertyGroup(i).index;
    }catch(e){};
    }

    I will change my expression to your way…

Viewing 1 - 3 of 3 posts

Log in to reply.

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