Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions timeToFrames “layer index out of range” error

  • timeToFrames “layer index out of range” error

    Posted by Oliver Watson on January 20, 2020 at 9:32 pm

    I want a text layer to display a layer name based on the current frame. My Source Text expression is throwing a “layer index 153 out of range” error.

    Can anyone see what I’m doing wrong?

    var idx = timeToFrames() + 4; // +4 for frame 0 and 3 other layers
    (thisComp.numLayers > idx) ? "empty" : thisComp.layer(idx).name

    Oliver Watson replied 6 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 20, 2020 at 10:36 pm

    I think you have your test backwards. Seems like it should be:

    (thisComp.numLayers < idx)

    Dan

  • Oliver Watson

    January 20, 2020 at 10:52 pm

    Oh, man. Dan, you are the best. Thanks.

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