User Guide

CHAPTER 10
336
Creating Expressions
Number or Array smooth(width=.2, samples=5, t=time) {width, samples, and t are
numbers} Applies a box filter to the value of the property at the specified time, and
smooths the result over time. Width (in seconds) is the range of time over which the filter
is averaged. Samples equals the number of discrete samples evenly spaced over time.
Generally, you’ll want samples to be an odd number so that the value at the current time
is included in the average. For example, “position.smooth(.1, 5)”.
Number or Array temporal_wiggle(freq, amp, octaves=1, amp_mult=.5, t=time) {freq,
amp, octaves, amp_mult, and t are numbers} Samples the property at a wiggled time. Freq
is calculated in wiggles per second, amp is calculated in units of the property to which it is
applied, octaves is the number of octaves of noise to add together, amp_mult is the amount
that amp is multiplied by for each octave, and t is the base start time. For this function to
be meaningful, the property it samples must be animated, because the function alters only
the time of sampling, not the value. For example, “scale.temporal_wiggle(5, .2)”.
Number or Array wiggle(freq, amp, octaves=1, amp_mult=.5, t=time) {freq, amp, octaves,
amp_mult, and t are numbers} Randomly shakes (wiggles) the value of the property. Freq
is calculated in wiggles per second, amp is calculated in units of the property to which it is
applied, octaves is the number of octaves of noise to add together, amp_mult is the amount
that amp is multiplied by for each octave, and t is the base start time. For example,
“position.wiggle(7, 30, 3)”.
UG.book Page 336 Wednesday, February 21, 2001 12:05 PM