beautypg.com

Adobe After Effects User Manual

Page 694

background image

Note:

To the top

anchorPoint

position

scale

rotation

opacity

audioLevels

timeRemap

marker.key(index)

marker.key(name)

Argument type: point is an Array [2], radius is an Array [2], postEffect is a Boolean, and t is a Number.

Samples the color and alpha channel values of a layer and returns the average alpha-weighted value of the pixels within the specified distance of
the point as an array: [red, green, blue, alpha]. If postEffect is true, the sampled values are for the layer after masks and effects on that layer have
been rendered; if postEffect is false, the sampled values are for the layer before masks and effects have been rendered. The input value point is
in layer space; the point [0,0] is the center of the top-left pixel in the layer. The input value radius specifies the horizontal and vertical distance
from the sample center to the edges of the sampled rectangle. The default value samples one pixel.

The postEffect parameter refers to effects applied directly to the layer, not to effects applied indirectly, such as with an adjustment layer.

This example samples a rectangle 4 pixels wide and 3 pixels high, centered around a point 100 pixels down and to the right of the upper-left
corner of the layer:

thisComp.layer(1).sampleImage([100, 100], [2, 1.5])

Dan Ebberts provides an example of how to use the sampleImage method on his

MotionScript website

.

The

AE Enhancers forum

provides an expression that uses the sampleImage method to measure a text layer or shape layer and determine its

effective bounding box.

Todd Kopriva provides instructions for using the sampleImage method and the Point Control effect to monitor colors for a specified point during

color correction on his

After Effects Region of Interest blog

.

Layer Properties attributes and methods (expression reference)

When you add masks, effects, paint, or text to a layer, After Effects adds new properties to the Timeline panel. There are too many of these
properties to list here, so use the pick whip to learn the syntax for referring to them in your expressions.

Return type: Property [2 or 3].

Returns the anchor point value of the layer in the coordinate system of the layer (layer space).

Return type: Property [2 or 3].

Returns the position value of the layer, in world space if the layer has no parent. If the layer has a parent, returns the position value of the layer in
the coordinate system of the parent layer (in the layer space of the parent layer).

Return type: Property [2 or 3].

Returns the scale value of the layer, expressed as a percentage.

Return type: Property.

Returns the rotation value of the layer in degrees. For a 3D layer, it returns the z rotation value in degrees.

Return type: Property.

Returns the opacity value for the layer, expressed as a percentage.

Return type: Property [2].

Returns the value of the Audio Levels property of the layer, in decibels. This value is a 2D value; the first value represents the left audio channel,
and the second value represents the right. The value is not the amplitude of the audio track of the source material. Instead, it is the value of the
Audio Levels property, which may be affected by keyframes.

Return type: Property.

Returns the value of the Time Remap property, in seconds, if Time Remap is enabled.

Return type: MarkerKey.

Argument type: index is a Number.

Returns the MarkerKey object of the layer marker with the specified index.

Return type: MarkerKey.

690

This manual is related to the following products: