Vector math methods – Adobe After Effects CS3 User Manual
Page 567

AFTER EFFECTS CS3
User Guide
562
Argument type: t is a Number, ntscDropFrame and isDuration are Booleans.
Converts t to a String representing NTSC timecode. See
timeToFrames
for an explanation of the t and isDuration
arguments. If ntscDropFrame is false (the default), the result String is NTSC non-drop-frame timecode. If ntscDrop-
Frame is true, the result String is NTSC drop-frame timecode.
timeToFeetAndFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, framesPerFoot =
16, isDuration = false)
Return type: String.
Argument type: t, fps, and framesPerFoot are Numbers; isDuration is a Boolean.
Converts the value of t to a String representing feet of film and frames. See
timeToFrames
for an explanation of the
t, fps, and isDuration arguments. The framesPerFoot argument specifies the number of frames in one foot of film. It
defaults to 16, which is the most common rate for 35mm footage.
timeToCurrentFormat(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false)
Return type: String.
Argument type: t and fps are Numbers; isDuration is a Boolean.
Converts the value of t to a String representing time in the current Project Settings display format. See
timeToF-
rames
for a definition of all of the arguments.
If you want more control over the look of timecode in your footage, use the
timeToCurrentFormat
method or other
timeTo
methods to generate the timecode instead of using the Timecode or Numbers effect. Create a text layer, add
an expression to the Source Text property, and enter
timeToCurrentFormat()
in the expression field. This method
enables you to format and animate the timecode text. In addition, the timecode uses the same display style defined by
the current project settings.
See also
“Change time display units” on page 131
Vector Math methods
Vector Math functions are global methods that perform operations on arrays, treating them as mathematical vectors.
Unlike built-in JavaScript methods, such as
Math.sin
, these methods are not used with the
Math
prefix. Unless
otherwise specified, Vector Math methods are lenient about dimensions and return a value that is the dimension of
the largest Array, filling in missing elements with zeros. For example, the expression
add([10, 20], [1, 2, 3])
returns
[11, 22, 3]
.
add(vec1, vec2)
Return type: Array.
Argument type: vec1 and vec2 are Arrays.
Adds two vectors.
sub(vec1, vec2)
Return type: Array.
Argument type: vec1 and vec2 are Arrays.
Subtracts two vectors.
mul(vec, amount)
Return type: Array.
Argument type: vec is an Array, amount is a Number.
Multiplies every element of the vector by the amount.