Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions thisLayer.index For Specific Parameter

  • thisLayer.index For Specific Parameter

    Posted by Mike LeBel on September 11, 2020 at 9:21 pm

    I’m trying to so something fairly basic but am coming across a repeated issue. I’d like to refer scaling in another Comp, but not choose a specific layer name. Instead I’d like to use the same layer number where I’m calling it from. The error is the same each time “BAD ARGUMENT. LAYER INDEX OUT OF RANGE EXPRESSION DISABLED”

    ReadScale=comp(“MyComp”).layer(4).transform.scale[0] //**Works well

    ReadScale=comp(“MyComp”).layer(“RefLayer”).transform.scale[0] //**Works well

    ReadScale=comp(“MyComp”).layer(thisLayer.index).transform.scale[0] //**Does not work

    ReadScale=comp(“MyComp”).layer(x).transform.scale[0] //**Does not work (where “x=5”)

    It seems as though no variable can be inserted into this location. I am able to use the following in another expression for a different parameter. But when I put it all together it still does not work.

    parseInt((thisLayer.index)-2 //**Works correctly

    Any feedback or food for thought would be greatly appreciated!

    -Thanks!

    Brendon Murphy replied 5 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Brendon Murphy

    September 11, 2020 at 9:27 pm

    Sent you a reply in the expressions forum.

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