ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Ho to read layer name from slider control?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Hadi Kot
Ho to read layer name from slider control?
on Feb 11, 2019 at 10:27:59 am

Hi i want to read expression layer name from a slider controller,
it try this but it din't help
txt =effect("Slider Control")("Slider").value);
thisComp.layer("index=txt").effect("TOP")("Checkbox");

so want i need is if i change the slider value from 1 to 2 the expression get the value from the layer (2) and like this

i appreciate your help

txt =effect("Slider Control")("Slider").value);
thisComp.layer("index=txt").effect("TOP")("Checkbox");


Return to posts index

James Ronan
Re: Ho to read layer name from slider control?
on Feb 11, 2019 at 1:32:56 pm

Hey

Try something like this:


layIndex = parseInt(effect("Slider Control")("Slider").value);
thisComp.layer(layIndex).effect("TOP")("Checkbox");


Return to posts index

Hadi Kot
Re: Ho to read layer name from slider control?
on Feb 11, 2019 at 2:46:43 pm

Thanks James,, really it read the layer number and not the layer name, but anyway it help i just need to be sure my layers are in the right order

many thanks ..


Return to posts index


Alex Printz
Re: Ho to read layer name from slider control?
on Feb 11, 2019 at 3:22:27 pm

Try this:

lay = effect("Slider Control")(1).value;
layNam = String(lay.toFixed(0));
thisComp.layer(layNam).effect("TOP")(1);


Alex Printz
Mograph Designer


Return to posts index

Hadi Kot
Re: Ho to read layer name from slider control?
on Feb 11, 2019 at 5:33:08 pm

Thanks Alex it work perfect ☺


Return to posts index

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