beautypg.com

Interpolation methods (expression reference) – Adobe After Effects User Manual

Page 688

background image

gaussRandom()

gaussRandom(maxValOrArray)

gaussRandom(minValOrArray, maxValOrArray)

noise(valOrArray)

To the top

linear(t, tMin, tMax, value1, value2)

linear(t, value1, value2)

If minValOrArray and maxValOrArray are Numbers, this method returns a number in the range from minValOrArray to maxValOrArray. If the
arguments are Arrays, this method returns an Array with the same dimension as the argument with the greater dimension, with each component in
the range from the corresponding component of minValOrArray to the corresponding component of maxValOrArray. For example, the expression

random([100, 200], [300, 400])

returns an Array whose first value is in the range 100–300 and whose second value is in the range 200–

400. If the dimensions of the two input Arrays don’t match, higher-dimension values of the shorter Array are filled out with zeros.

Return type: Number.

Returns a random number. The results have a Gaussian (bell-shaped) distribution. Approximately 90% of the results are in the range 0–1, and the
remaining 10% are outside this range.

Return type: Number or Array.

Argument type: maxValOrArray is a Number or Array.

When maxValOrArray is a Number, this method returns a random number. Approximately 90% of the results are in the 0 to maxValOrArray range,
and the remaining 10% are outside this range. When maxValOrArray is an Array, this method returns an Array of random values, with the same
dimension as maxValOrArray. 90% of the values are in the range from 0 to maxValOrArray, and the remaining 10% are outside this range. The
results have a Gaussian (bell-shaped) distribution.

Return type: Number or Array.

Argument type: minValOrArray and maxValOrArray are Numbers or Arrays.

If minValOrArray and maxValOrArray are Numbers, this method returns a random number. Approximately 90% of the results are in the range from
minValOrArray to maxValOrArray, and the remaining 10% are outside this range. If the arguments are Arrays, this method returns an Array of
random numbers with the same dimension as the argument with the greater dimension. For each component, approximately 90% of the results are
in the range from the corresponding component of minValOrArray to the corresponding component of maxValOrArray, and the remaining 10% are
outside this range. The results have a Gaussian (bell-shaped) distribution.

Return type: Number.

Argument type: valOrArray is a Number or an Array [2 or 3].

Returns a number in the range from -1 to 1. The noise is not actually random; it is based on Perlin noise, which means that the return values for
two input values that are near one another will also tend to be near one another. This type of noise is useful when you want a sequence of
seemingly random numbers that don’t vary wildly from one to the other—as is usually the case when animating any apparently random natural
motion. Example: rotation + 360*noise(time)

Interpolation methods (expression reference)

For all of the Interpolation methods, the argument t is often time or value, though it can have other values, instead. If t is time, the

interpolation between values happens over a duration. If t is value, then the expression maps one range of values to a new range of values.

For additional explanations and examples of the Interpolation methods, see

JJ Gifford’s website

.

Chris and Trish Meyer provide additional information and examples for these methods in an article on the

ProVideo Coalition website

.

Ian Haigh provides a script on

After Effects Scripts website

that you can use to easily apply advanced interpolation method expressions—such as

bounces—to properties.

Andrew Devis provides a

pair of video tutorials

on the Creative COW website that show in detail how to use the linear expression method along

with the Convert Audio To Keyframes command.

Return type: Number or Array.

Argument type: t, tMin, and tMax are Numbers, and value1 and value2 are Numbers or Arrays.

Returns value1 when t <= tMin. Returns value2 when t >= tMax. Returns a linear interpolation between value1 and value2 when tMin < t < tMax.

For example, this expression on the Opacity property causes Opacity values to ramp linearly from 20% to 80% over the time from 0 seconds to 6
seconds:

linear(time, 0, 6, 20, 80)

This method—like all of the Interpolation methods—can also be used to convert from one range of values to another. For example, this expression
on the Opacity property converts the Opacity values from the range 0%-100% to the range 20%-80%:

linear(value, 0, 100, 20, 80)

Return type: Number or Array.

684

This manual is related to the following products: