Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Ho to read layer name from slider control?

  • Ho to read layer name from slider control?

    Posted by Hadi Kot on February 11, 2019 at 10:27 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");

    Hadi Kot replied 7 years, 3 months ago 3 Members · 4 Replies
  • 4 Replies
  • James Ronan

    February 11, 2019 at 1:32 pm

    Hey

    Try something like this:


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

  • Hadi Kot

    February 11, 2019 at 2:46 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 ..

  • Alex Printz

    February 11, 2019 at 3:22 pm

    Try this:

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

    Alex Printz
    Mograph Designer

  • Hadi Kot

    February 11, 2019 at 5:33 pm

    Thanks Alex it work perfect ☺

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