Copy link to clipboard
Copied
I'm relatively new to After Effects, but I've searched quite a bit and can't figure this out.
I have two solids right next to each other. At certain points in the timeline, I'll increase the scale of one or the other for emphasis - making it pop out for a second and then return to normal size.
This works just fine for the solid layer on top, but the lower layer gets partially blocked. I thought it would be trivial to move the lower layer up when needed via expressions, but I can't find a way to do that.
2 Correct answers
That's just how 2D layers work in After Effects. Moving a layer on top of another in the layer stack can't be done by expressions, only scrpiting, but in your case that wouldn't work anyway since it needs to switch back and forth.
Easiest fix is make them 3D layers instead. Or you could have a Background and Foreground versions of one of the layers and toggle on and off their opacity as needed.
You can only use expressions on properties that you can keyframe. Layer Order is not one of those properties.
If you make the layers 3D and animate the Z position of the layer, you want to move in front of the other. Moving a layer closer to the camera has the same effect as increasing the scale, but the speed of the transformation is more natural.
If you want to stick with 2D, you could add animated masks or use a copy of one of the animated layers as a track matte for the other.
Copy link to clipboard
Copied
That's just how 2D layers work in After Effects. Moving a layer on top of another in the layer stack can't be done by expressions, only scrpiting, but in your case that wouldn't work anyway since it needs to switch back and forth.
Easiest fix is make them 3D layers instead. Or you could have a Background and Foreground versions of one of the layers and toggle on and off their opacity as needed.
Copy link to clipboard
Copied
This thread is a couple years old, but this is exactly what I want to do...move a layer on top of another....Would I be able to make the bottom layer "push" through the text layer above it with a script? If so, how would I go about figuring out how to write it? Thanks
Copy link to clipboard
Copied
Yes, changing layer index in After Effects is simple in scripting with moveAfter() and moveBefore()
https://ae-scripting.docsforadobe.dev/layer/layer/?h=moveafter#layermoveafter
Copy link to clipboard
Copied
You can only use expressions on properties that you can keyframe. Layer Order is not one of those properties.
If you make the layers 3D and animate the Z position of the layer, you want to move in front of the other. Moving a layer closer to the camera has the same effect as increasing the scale, but the speed of the transformation is more natural.
If you want to stick with 2D, you could add animated masks or use a copy of one of the animated layers as a track matte for the other.
Copy link to clipboard
Copied
Thank you, both. That makes perfect sense. For a quick fix I'll probably just duplicate the layer and change its opacity when I need to animate, but it sound like 3D is the "right" way to manage this.

