See also
"Add, edit, and remove expressions" on page 545
Example: Match camera's focal plane to another layer
❖
Apply the following expression to a camera layer's Focus Distance property to have its focus distance match the
distance to the anchor point of a layer named "target":
target = thisComp.layer("target");
V1 = target.toWorld(target.anchorPoint) - toWorld([0,0,0]);
V2 = toWorldVec([0,0,1]);
dot(V1,V2);
See also
"Add, edit, and remove expressions" on page 545
"Create a camera layer and change camera settings" on page 179
AFTER EFFECTS CS3
581
User Guide