ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

timeToFrames "layer index out of range" error

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Oliver Watson
timeToFrames "layer index out of range" error
on Jan 20, 2020 at 9:32:44 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


Return to posts index

Dan Ebberts
Re: timeToFrames "layer index out of range" error
on Jan 20, 2020 at 10:36:23 pm

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

(thisComp.numLayers < idx)


Dan



Return to posts index

Oliver Watson
Re: timeToFrames "layer index out of range" error
on Jan 20, 2020 at 10:52:40 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]