Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Need Assistance Again!

  • Need Assistance Again!

    Posted by John Madison on January 26, 2012 at 9:30 pm

    Hi guys,

    This is particularly intended for Dab who helped me on this before.

    Here is the thread: https://forums.creativecow.net/thread/227/19650

    I have slightly changed my setup so the expression which Dan so brilliant formulated needs to be changed and I dont know how.

    The idea is this: A slider is controlling the visibility of the last layer in a stack of layers in a composition. So suppose there are 10 layers (boxes) arranged across the screen the slider value corresponds to how many are visible. If slider is 10 then 10 and if 5 then 5 and so on.
    I am adding an effect which can be turned on/off such as the glow effect on the last visible layer of the stack. So for example, If there are 5 layers visible, then the effect would be turned on the 5th one. The reason I am using expressions is that I want to be able to duplicate these layers without writing an expression on each one.

    Dan gave me an expression which worked fine for the setup I had before, but now the basic setup is this:

    Layer A (index 1)
    Layer B (index 2)
    Layer C (index 3)

    I am duplicating ALL these layers but it is only on Layer C that I want to add the effect as described above. The other two layers are not always visible, but have to be there which poses a problem for my expression.

    Any ideas?

    Dan Ebberts replied 14 years, 3 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    January 26, 2012 at 10:49 pm

    OK – I’m lost. When you duplicate your layers, what does your layer stack look like, and what do you want to happen?

    Dan

  • John Madison

    January 26, 2012 at 11:20 pm

    Ok, perhaps i am explaining in more complex terms than it needs to be.

    Layer A
    Layer B
    Layer C

    duplicated once

    Layer A2
    Layer B2
    Layer C2 and so on

    In the above schema I now have 6 layers altogether. You may ignore all instances of Layer A and B but they have to be there so they still affect Layer C and its subsequent duplications index value.

    I can write a simple expression on Layer C to turn on the effect based on the value of the slider, so if slider value is 1 i want the effect to be on, but Layer C2 should still be off. If slider value is 2, now only Layer C2 is on and Layer C is off. Do you get the idea? I want to write the expression once in Layer C as it is possible that there may be up to 100 duplications.

  • Dan Ebberts

    January 27, 2012 at 12:32 am

    I think the expression either has to know how many layers there are per duplicated set (three in your example) or it has to be able to figure out which set it’s in based on its own layer name. Are either of those available?

    Dan

  • John Madison

    January 27, 2012 at 1:00 am

    Yes its always three. Thus with each duplication the layer which would have the expression would go up by three.

    A1
    B1
    C1 (Layer with expression)

    After 1st Duplication
    A2
    B2
    C2 (layer with expression)

    After 2nd Duplication
    A3
    B3
    C3 (layer with expression)

  • Dan Ebberts

    January 27, 2012 at 1:15 am

    OK – I think I get it. Just change:

    index – 1

    to:

    index/3 – 1

    Dan

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