beautypg.com

Adobe After Effects CS3 User Manual

Page 582

background image

AFTER EFFECTS CS3

User Guide

577

Argument type: t is a Number.

Returns the property’s value at the specified time, in seconds.

For example, to have a property's value for each frame be chosen randomly from a set of four values, set your four
values as keyframes at 0, 1, 2, and 3 seconds, and then apply the following expression to the property:

valueAtTime(random(4))

velocity

Return type: Number or Array.

Returns the temporal velocity value at the current time. For spatial properties, such as Position, it returns the tangent
vector value. The result is the same dimension as the property.

velocityAtTime(t)

Return type: Number or Array.

Argument type: t is a Number.

Returns the temporal velocity value at the specified time.

speed

Return type: Number.

Returns a 1D, positive speed value equal to the speed at which the property is changing at the default time. This
element can be used only for spatial properties.

speedAtTime(t)

Return type: Number.

Argument type: t is a Number.

Returns the spatial speed value at the specified time.

wiggle(freq, amp, octaves=1, amp_mult=.5, t=time)

Return type: Number or Array.

Argument type: freq, amp, octaves, amp_mult, and t are Numbers.

Randomly shakes (wiggles) the value of the property.

freq value is the frequency in wiggles per second.

amp value is the amplitude in units of the property to which it is applied.

octaves is the number of octaves of noise to add together. This value controls how much detail there is in the wiggle.
Make this value higher than the default of 1 to include higher frequencies or lower to include amplitude harmonics
in the wiggle.

amp_mult is the amount that amp is multiplied by for each octave. This value controls how fast the harmonics drop
off. The default is 0.5; make it closer to 1 to have the harmonics added at the same amplitude as the base frequency,
or closer to 0 to add in less detail.

t is the base start time. This value defaults to the current time. Use this parameter if you want the output to be a wiggle
of the property value sampled at a different time.

Example:

position.wiggle(5, 20, 3, .5)

will produce about 5 wiggles per second with an average size of about

20 pixels. In addition to the main wiggle, two more levels of detailed wiggles will occur with a frequency of 10 and
20 wiggles per second, and sizes of 10 and 5 pixels, respectively.

This example, on a two-dimensional property such as Scale, wiggles both dimensions by the same amount:

v = wiggle(5, 10);

[v[0], v[0]]

This example, on a two-dimensional property, wiggles only along the y axis: