Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Finding specific effect name in each layer

  • Finding specific effect name in each layer

  • Ilya Sire

    October 24, 2021 at 12:01 pm

    Hi forum,

    i tried this code to loop each layer to find specific effect name, and i got effects() out of range, is there something did i missed?

    for (i = 1; i <= thisComp.numLayers; i++){
    var curFX = thisComp.layer(i).effect(1);
    if(curFX.name == "somefx"){
    thisComp.layer(i).index
    break
    }
    }
  • Dan Ebberts

    October 24, 2021 at 12:49 pm

    Try it this way:

    idx = 0;

    for (i = 1; i <= thisComp.numLayers; i++){

    if (thisComp.layer(i)("Effects").numProperties > 0){

    curFX = thisComp.layer(i).effect(1);

    if(curFX.name == "somefx"){

    idx = i;

    break;

    }

    }

    }

    idx

  • Ilya Sire

    October 25, 2021 at 5:41 am

    Thank you! it worked 🙂

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