Adobe 12040118 - After Effects Standard Tutorial page 580

Help and tutorials
Hide thumbs Also See for 12040118 - After Effects Standard:
Table of Contents

Advertisement

You can also use other effects, such as Ripple, with this expression.
1. Start with two layers. Make one layer a magnifying glass or similar object with a hole in the middle and name it Magnifier. (See Creating
layers.)
2. Animate the position of the magnifying glass layer. (See Motion paths.)
3. Apply the Bulge effect to the other layer. (See Apply an effect or animation preset.)
4. Select the Bulge Center property of the Bulge effect in the Timeline panel and choose Animation > Add Expression, or Alt-click (Windows) or
Option-click (Mac OS) the stopwatch
5. Select the default expression text and type the following:
fromWorld(thisComp.layer("Magnifier").position)
Expression example: Fade opacity of a 3D layer based on distance from camera
Apply the following expression to the Opacity property of a 3D layer:
startFade = 500; // Start fade 500 pixels from camera.
endFade = 1500;
// End fade 1500 pixels from camera.
try{ // Check whether there's a camera.
C = thisComp.activeCamera.toWorld([0,0,0]);
}catch(err){ // No camera, so assume 50mm.
w = thisComp.width * thisComp.pixelAspect;
z = (w/2)/Math.tan(degreesToRadians(19.799));
C = [0,0,-z];
}
P = toWorld(anchorPoint);
d = length(C,P);
linear(d,startFade,endFade,100,0)
The fade starts at a distance of 500 pixels from the camera and is complete at 1500 pixels from the camera. The linear interpolation method is
used to map distance values to opacity values.
Expression example: Make a 3D layer invisible if facing away from camera
Apply the following expression to the Opacity property of a 3D layer:
if (toCompVec([0, 0, 1])[2] > 0 ) value else 0
Dan Ebberts explains this expression on his
Expression example: Flip layer horizontally if facing away from camera
Apply the following expression to the Scale property of a 3D layer:
if (toCompVec([0, 0, 1])[2] > 0 ) value else [-value[0], value[1], value[2]]
Expression example: Animate scale at each layer marker
Apply the following expression to a Scale property to make a layer wobble at each marker:
n = 0;
t = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if (n > 0) t = time - marker.key(n).time;
amp = 15;
freq = 5;
decay = 3.0;
angle = freq * 2 * Math.PI * t;
scaleFact = (100 + amp * Math.sin(angle) / Math.exp(decay * t)) / 100;
button for the property.
MotionScript
website.
To the top
To the top
To the top
To the top

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

After effects

Table of Contents