ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emre Mutlu
Can i select layers from the index in a comp via expression even if i replace the comp?
on May 25, 2020 at 4:31:27 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?


Return to posts index

Robert Müller
Re: Can i select layers from the index in a comp via expression even if i replace the comp?
on May 26, 2020 at 9:19:01 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


Return to posts index

Emre Mutlu
Re: Can i select layers from the index in a comp via expression even if i replace the comp?
on May 26, 2020 at 9:35:25 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?


Return to posts index


Robert Müller
Re: Can i select layers from the index in a comp via expression even if i replace the comp?
on May 26, 2020 at 9:39:53 am

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


Return to posts index

Emre Mutlu
Re: Can i select layers from the index in a comp via expression even if i replace the comp?
on May 26, 2020 at 9:49:43 am

Thank you anyway. If i find a solution for this i'll post here :)


Return to posts index

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