FORUMS: list search recent posts

Using an expression to refer to to a layer above its own layer in the timeline.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christopher Rutherford
Using an expression to refer to to a layer above its own layer in the timeline.
on Feb 20, 2020 at 7:45:14 pm

Hey all,

currently daisy-chaining a bunch of layers so they stack automatically based on their shape sizes. Expression used on layer A is currently "thisComp.layer("Layer B").sourceRectAtTime().height" and on layer B it's "thisComp.layer("Layer C").sourceRectAtTime().height" and so on.

Wondering if there was an expression that would make it such that reordering the layers in the timeline would update their position in the stack. My initial thought was using the layer index, but I couldn't figure out a way to make it refer to the layer immediately above it in the timeline.


Return to posts index

Dan Ebberts
Re: Using an expression to refer to to a layer above its own layer in the timeline.
on Feb 20, 2020 at 8:26:51 pm

You can do math on the layer's index to get to the layer above, like this:

thisComp.layer(index-1)

Or you can use relative indexing, like this:

thisComp.layer(thisLayer,-1)

but, you can't change the actual stacking order with an expression. It wasn't clear to me if you understood this. Sorry if you did. You could shuffle them in Z space if they are 3D layers though.

Dan



Return to posts index

Christopher Rutherford
Re: Using an expression to refer to to a layer above its own layer in the timeline.
on Feb 20, 2020 at 11:01:24 pm

The relative indexing is exactly what I was looking for. Mr. Ebberts, you've done it again.


Return to posts index


Adrian Almonte
Re: Using an expression to refer to to a layer above its own layer in the timeline.
on Feb 21, 2020 at 5:42:11 am



Hey all,

Is it possible to use this same expression for a mobile text conversation, without any key frames, as well?

The "text message" would be placed in a pre-composition. All of the pre-comped text messages would be placed in one composition.

Can the pre-compositions, that are sequenced/spread 10 seconds apart, call to the Current Time Indicator to determine and allow the pre-compositions to be animated to it's dedicated position?

See image attached as referenced

Thank you for your help


Return to posts index

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