ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Use Slider Control to drive layer Index number

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tim Horvatich
Use Slider Control to drive layer Index number
on Jul 26, 2018 at 2:29:34 pm

Hey guys, I am trying to use a slider control to dictate which index number I want a layer to reference. I have tried the setup below, but I get "layer index 1812200848 is out of range".

x=effect("Slider Control")("Slider")
comp("comp name").layer(index=x).text.sourceText

I read one where someone said to use the Layer control, but I am referencing layers in a completely different comp. When I use the the second line alone and manually input a number for the "x", the expression does what I want, just trying to not have to go in and change the number in the expression editor every time.

Can someone help?? Is this even possible?

Thanks!
Tim

x=effect("Slider Control")("Slider")
comp("comp name").layer(index=x).text.sourceText


Return to posts index

Dan Ebberts
Re: Use Slider Control to drive layer Index number
on Jul 26, 2018 at 3:44:28 pm

Try changing the first line to:

x=effect("Slider Control")("Slider").value;


Dan



Return to posts index

Tim Horvatich
Re: Use Slider Control to drive layer Index number
on Jul 26, 2018 at 3:50:56 pm

That worked perfectly!

Thank you very much!!


Return to posts index

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