Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using Layer numbers to set effect parameters. “name.split” Help

  • Using Layer numbers to set effect parameters. “name.split” Help

    Posted by Joe Wood on April 6, 2021 at 3:30 am

    Hello all,

    I am in need of some expression help using the name.split expression. I have tons of circles in individual shape layers that are all labeled “CD_01”, “CD_02” and so on. I’m connecting them all with beam effect to draw lines between them. Each beam layer is labeled “CL_01”, “CL_02”.

    I’d like it so the position expression of the beam effect updates each time I duplicate the layer, to follow the next numbered circle that matches the number on the beam layer’s name.

    This is where I’m at right now, but I’m getting a Sytex error

    n = thisComp.layer(“CL_01”).name.split(“_”)[1];

    CD = thisComp.layer(“CD_” + n);

    CD.position;

    Joe Wood replied 5 years, 1 month ago 1 Member · 1 Reply
  • 1 Reply
  • Joe Wood

    April 6, 2021 at 12:58 pm

    Got it to work like this:

    var num = thisLayer.name.split("_")[1];

    var nam = thisComp.layer("CD_01").name.split("_")[0];

    var CD = thisComp.layer(nam +"_"+ num);

    CD.toComp(CD.anchorPoint);

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