Opacity depending on the layer
You can do this with an expression on the Opacity property:

fade = framesToTime(10);
fadeIn = (time - inPoint) / fade;
fadeOut = (outPoint - time) / fade;
if (time &lt; inPoint + fade) { ease(fadeIn, 0, 1) * value }
else if (time &gt; outPoint - fade) { ease(fadeOut, 0, 1) * value }
else { value }


This expression will fade the layer from 0% to 100% Opacity across the first 10 frames, then fade from 100% to 0% on the last 10 frames of the layer. This is based on the layer's in and out points on the timeline.

Full tutorial (starts at 3:08):


                
            

Hope this helps!