-
Ramp up opacity with Z position
Hi there,
I have a bunch of solids placed in z space. I want to animate them like the Apple Time Machine effect.
The part that does the z-space animation is obvious. But when a layer is at position 0 in z-space I want that layer to become at 100% opacity. When it crosses the 0 point it fades out to 0% opacity. So: all the layers are behind the layer that is on 0, they are at let’s say 50% opacity. When the layers move towards the camera the opacity changes.A good example is the Dock Effect expression. But instead of scale, i want to use opacity.
Like the expression below.f = 2; //factor to increase scale by
min = 0; //distance in pixels from the center where the layer is at full scale
max = 300; //distance in pixels from the center where the layer is at 'normal' scale
c = [thisComp.width / 2, thisComp.height / 2]; //center of the composition
p = toComp(anchorPoint); //location of the current layer in the composition
d = Math.abs((p - c)[0]); //distance from the center along the x-axis
ease(d, min, max, f * value, value);