Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: ForumAE BasicsAE ExpressionsTutorialsArticlesPodcastsMotion GraphicsTrainingCinema 4D

Change layer order with expressions

Cow Forums : Adobe After Effects Expressions
Change layer order with expressions
by MattMariska on Feb 15, 2007 at 4:07:37 am

Hello! I'm new to posting to these forums, but I've been reading them for help countless times over the past years.

I'm just a beginner with AE Expressions, and I was wondering if the following is possible:

I would like to change the order (or perceived order) of layers in my composition, based on their Y axis. In this composition, the lower a layer is vertically, the closer it should be to the camera. Therefore, anything lower vertically should overlap anything else higher vertically. Is this possible?

I hope I'm explaining myself well enough. Thank you for taking the time to give me a hand with this.

-Matt

Respond to this post     Return to posts index

Re: Change layer order with expressions
by Colin Braley on Feb 15, 2007 at 7:24:26 am

Well you can't make the layers become stacked in a different order via expressions, however scripting could sort the layers based on the y position at frame zero, or something like that. However, you could change the z-position of layers based on y position. You could create an expression to do something like place the layer with the largest y value at z = 0, the layer with the second largest y value at z = -100, the layer with the third largest y value at z = -200 etc. Just clarify what you are looking for a bit more and Im sure someone will be able to help you out.
~Colin

Respond to this post     Return to posts index

Re: Change layer order with expressions
by Dan Ebberts on Feb 15, 2007 at 2:30:18 pm

Yeah, I'd make them all 3D and use an expression like this to sort them in Z space:

below = 0;
for (i = 1; i <= thisComp.numLayers; i++){
if (i == index) continue;
if (thisComp.layer(i).position[1] < value[1]) below--;
}
[value[0],value[1],below]


Dan



Respond to this post     Return to posts index


Re: Change layer order with expressions
by MattMariska on Feb 15, 2007 at 6:37:03 pm

Thanks! I'll give this a try, and see if it works out.

Thanks for taking the time to look this over.

Respond to this post     Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]