Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How can I reverse layer render order

  • How can I reverse layer render order

    Posted by Russell Birkett on May 23, 2014 at 10:39 am

    Hi
    I have imported a layered photoshop file into After effects. Using a delay slider and expressions, I have the layers’ opacity changing from 0 through to 100%. All is well. However the front-most layers of the image are rendering first whereas I actually want the back-most layers to render first with the front layers rending on top of them. I understood that if you select the layers (select from the bottom to the top) and paste them back in, then the order is reversed. The order is indeed reversed in the layer list, but the order in which they are rendered is unchanged. Could it have anything to do with the expression being used?

    The expression is . . .

    delay = thisComp.layer(“Controls”).effect(“DelayAmt”)(“Slider”);
    d=delay*index;
    t=time-d;
    exp=thisComp.layer(“Controls”).effect(“Opacity”)(“Slider”).valueAtTime(t);
    exp

    Any thoughts gratefully received.
    Russ

    Russell Birkett replied 11 years, 12 months ago 3 Members · 7 Replies
  • 7 Replies
  • George Goodman

    May 23, 2014 at 2:57 pm

    My guess is that it has to do with your use of index and opacity.

    So since you’re using the index in your delay, it is determining the order in which the layers will come in. Since the index of 1 is the top most layer, it will come in first, but it will be on top of all the other layers.

    “|_ (°_0) _|”

    Sincerely,

    George

    http://www.vimeo.com/georgegoodman
    http://www.linkedin.com/in/georgefranklingoodman

  • Russell Birkett

    May 23, 2014 at 3:05 pm

    Thanks for your reply George
    OK, let me see if I have this right. Since AE normally draws the layers from the bottom of the list upwards, by using expressions am I over riding these defaults to draw from the top of the list downwards?
    Regards
    R

  • Walter Soyka

    May 23, 2014 at 3:11 pm

    [George Goodman] “So since you’re using the index in your delay, it is determining the order in which the layers will come in. Since the index of 1 is the top most layer, it will come in first, but it will be on top of all the other layers.”

    Agreed.

    You can “reverse” the index-based delay calculation by subtracting the index from the total number of elements being delayed.

    Something like:
    d=delay*(thisComp.numLayers-index+1);

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Walter Soyka

    May 23, 2014 at 3:15 pm

    [russell birkett] “OK, let me see if I have this right. Since AE normally draws the layers from the bottom of the list upwards, by using expressions am I over riding these defaults to draw from the top of the list downwards?”

    The expressions do not and cannot change the compositing order. Stuff on upper 2D layers are always drawn over stuff on lower 2D layers.

    What the expression controls is the timing of the layer — when it fades in. With your original expression, upper layers receive less delay (assuming a positive delay slider value) than lower layers because their layer indices are lower.

    Let’s assume your delay slider is set to 0.5. The index of layer 1 is 1; its delay is delay*index, or 0.5 * 1 = 0.5. The index of layer 2 is 2; its delay is 0.5 * 2 = 1.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • George Goodman

    May 23, 2014 at 3:16 pm

    Yes, so the top of the layer stack renders on top of anything below it.

    Your expression uses the index of each layer to determine when it is going to come in. The very top layer’s index is 1, so it’s first, then the one below that is 2, so its second. So the way your expression reads, it’s always going to render the top layers first.

    And was just getting to an expression alteration, but looks like Walter just chimed in with a fix.

    “|_ (°_0) _|”

    Sincerely,

    George

    http://www.vimeo.com/georgegoodman
    http://www.linkedin.com/in/georgefranklingoodman

  • Russell Birkett

    May 23, 2014 at 3:36 pm

    Thanks guys.
    I’ll go away and have a play. will let you know the outcome.
    Cheers
    Russ

  • Russell Birkett

    May 23, 2014 at 4:15 pm

    Excellent. That’s sorted it. Many thanks again guys
    Cheers
    Russ

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