User Guide

Using Help | Contents | Index Back 261
Adobe After Effects Help Creating Expressions
Using Help | Contents | Index Back 261
Array [2 or 3] to_comp_vec(point, t=time) {point is an array[2 or 3], and t is a number}
Transforms a vector from layer space to comp space. For example, “to_comp_vec([1, 0])”.
Array [2 or 3] from_comp_vec(point, t=time) {point is an array[2 or 3], and t is a number}
Transforms a vector from comp space to layer space. For example (2D layer),
dir=sub(position, this_comp.layer(2).position); from_comp_vec(dir)”.
Array [2 or 3] to_world_vec(point, t=time) {point is an array[2 or 3], and t is a number}
Transforms a vector from layer space to world space. For example, “p1 = effect("Eye Bulge
1").param("Bulge Center"); p2 = effect("Eye Bulge 2").param("Bulge Center");
to_world(sub(p1, p2))”.
Array [2 or 3] from_world_vec(point, t=time) {point is an array [2 or 3], and t is a number}
Transforms a vector from world space to layer space. For example,
“from_world(this_comp.layer(2).position)”.
Array [2] from_comp_to_surface(point, t=time) {point is an array [2 or 3], and t is a
number} Use with 3D layers only. Projects a point located in comp space to a point on the
surface of the layer (zero z-value) at the location where it appears when viewed from the
active camera. This is useful for setting effect control points.
Camera attributes and methods
Camera objects have all of the same attributes and methods as Layer objects, except for
source, effect, mask, width, height, anchor_point, scale, opacity, audio_levels, time_remap,
and all of the material properties. In addition, Cameras have the following:
Property [3] point_of_interest Returns the cameras Point of Interest values in world space.
Property zoom Returns the cameras Zoom values in pixels.
Property depth_of_field Returns a 1 if the cameras Depth of Field property is on, or
returns a 0 if it is off.
Property focus_distance Returns the cameras Focus Distance values in pixels.
Property aperture Returns the cameras Aperture value in pixels.
Property blur_level Returns the cameras Blur Level value as a percentage.
Boolean active Returns a true value if the cameras video switch ( )is on, the current time
is between the cameras In and Out points, and it is the first such camera listed in the
Timeline window. Returns a false value if the above conditions are not met.
Light attributes and methods
Light objects have all of the same attributes and methods as Layer objects, except for
source, effect, mask, width, height, anchor_point, scale, opacity, audio_levels, time_remap,
and all of the material properties. In addition, Lights have the following:
Property [3] point_of_interest Returns the lights Point of Interest values in work space.
Property
intensity Returns the light’s Intensity values as a percentage.
Property [4] color Returns the lights Color value.
Property cone_angle Returns the lights Cone Angle value in degrees.
Property cone_feather Returns the light’s Cone Feather value as a percentage.
Property shadow_darkness Returns the lights Shadow Darkness value as a percentage.
Property shadow_diffusion Returns the lights Shadow Diffusion value in pixels.