Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Can i select layers from the index in a comp via expression even if i replace the comp?

  • Can i select layers from the index in a comp via expression even if i replace the comp?

    Posted by Emre Mutlu on May 25, 2020 at 4:31 pm

    Hi there,

    Here’s my situation :

    – I got comps with multiple layers in it.
    – I need to make visible those layers independently.
    – I need to control them with checkbox control (from another layer or on that comp).

    The problem is, i need to replace the comp with another. It’s got the same structure but different number of layers in it. Is there a way to do it?

    Also i wonder if there’s a way to rename the checkbox control using layers names?

    Emre Mutlu replied 5 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Robert Müller

    May 26, 2020 at 9:19 am

    First of all you can’t have the expression control name depend on layer names. And as I understand it you want the checkbox to drive the transparency but switch the layers underneath? That is possible but you would have to copy the expression, since the expression needs to be on the transparency property of your layer. But if you use numbers as names for your checkboxes you can work with indexes. Like this:
    thisComp.layer("ctrl").effect(index-1)(1)*100
    And this is the controll layout

  • Emre Mutlu

    May 26, 2020 at 9:35 am

    Thanks for your time and reply Robert. I’ve used a similar method for this.

    On opacity :

    reveal = thisComp..layer(“reveal”).effect(index-1)(“Checkbox”);
    if (mask == 1) {100} else {0};

    I still wonder if there is way for renaming effects via script, plug-in or something else?

  • Robert Müller

    May 26, 2020 at 9:39 am

    I guess with scripts it should be possible, but sadly im not that good at writing scripts. Sorry

  • Emre Mutlu

    May 26, 2020 at 9:49 am

    Thank you anyway. If i find a solution for this i’ll post here 🙂

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