Class Layer
Hierarchy
- Layer
Index
Constructors
Properties
Methods
- add
- clamp
- comp
- cross
- degrees
ToRadians - div
- dot
- ease
- ease
In - ease
Out - effect
- footage
- frames
ToTime - from
Comp - from
Comp ToSurface - from
Comp Vec - from
World Vec - gauss
Random - hex
ToRgb - hsl
ToRgb - length
- linear
- look
At - mask
- mul
- noise
- normalize
- radians
ToDegrees - random
- rgb
ToHsl - sample
Image - seed
Random - source
Rect AtTime - source
Time - sub
- time
ToCurrent Format - time
ToFeet And Frames - time
ToFrames - time
ToNTSCTimecode - time
ToTimecode - to
Comp - to
Comp Vec - to
World - to
World Vec
Constructors
constructor
-
Returns Layer
Properties
Readonly active
Optional Readonly audioActive
Whether the audio switch is enabled, and the current time is in between the inPoint and outPoint of the layer
Optional Readonly audioLevels
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.
Readonly colorDepth
The project color depth value. For example, colorDepth returns 16 when the project color depth is 16 bits per channel.
Readonly enabled
Whether the video switch for the layer is enabled
Readonly hasAudio
Whether the layer has audio data
Readonly hasParent
Whether the layer has a parent layer
Readonly hasVideo
Whether the layer has video data
Readonly height
The height of the layer in pixels, same as source.height
Readonly inPoint
The in point of the layer, in seconds
Readonly index
The index number of the layer in the composition
Optional Readonly marker
The marker property group object
Optional Readonly materialOption
The material options property group object
Readonly name
The name of the layer
Readonly outPoint
The out point of the layer in seconds
Optional Readonly parent
The parent Layer object of the layer, if it has one
Optional Readonly source
The source Comp or source Footage object for the layer. Default time is adjusted to the time in the source
Readonly startTime
The start time of the layer in seconds
Optional Readonly text
The text property group object
Readonly time
The composition time, in seconds, at which the expression is being evaluated.
Optional Readonly timeRemap
The value of the Time Remap property, in seconds, if Time Remap is enabled.
Readonly transform
The transform property group object
Readonly width
The width of the layer in pixels, same as source.width
Methods
add
-
Adds two vectors
Type parameters
-
A: NumericValue
-
B: NumericValue
Parameters
-
a: A
-
b: B
Returns MathReturn<A, B>
-
clamp
-
Constrains a given number, or each element of an array, to fall within a a given range
Type parameters
-
T: NumericValue
Parameters
-
value: T
Array or number to constrain
-
limit1: number
Lower limit
-
limit2: number
Upper limit
Returns T
-
comp
-
Retrieves a composition by name
Parameters
-
name: string
The name of the composition
Returns Comp
The composition with the given name
-
cross
degreesToRadians
-
Convert a given value in degrees to radians
Parameters
-
degrees: number
The value to convert
Returns number
The value radians
-
div
-
Divides a vector by a given scalar amount
Type parameters
-
VectorType: NumericValue
Parameters
-
vec1: VectorType
The vector to divide
-
amount: number
The amount to divide by
Returns VectorType
-
dot
ease
-
Parameters
-
t: number
The input value to be re-mapped
-
tMin: number
The inputs low floor
-
tMax: number
The inputs high ceiling
-
Optional value1: number | []
The output floor
-
Optional value2: number | []
The output ceiling
Returns number | []
A given value, mapped from one range to another, clamped to the output range. The mapping will ease in and out so it reaches the output range with a velocity of
0. If only 3 parameters are given, the input range is0to1and the given values are used for the output range. -
easeIn
-
Parameters
-
t: number
The input value to be re-mapped
-
tMin: number
The inputs low floor
-
tMax: number
The inputs high ceiling
-
Optional value1: number | []
The output floor
-
Optional value2: number | []
The output ceiling
Returns number | []
A given value, mapped from one range to another, clamped to the output range. The mapping will ease out with a velocity of
0. If only 3 parameters are given, the input range is0to1and the given values are used for the output range. -
easeOut
-
Parameters
-
t: number
The input value to be re-mapped
-
tMin: number
The inputs low floor
-
tMax: number
The inputs high ceiling
-
Optional value1: number | []
The output floor
-
Optional value2: number | []
The output ceiling
Returns number | []
A given value, mapped from one range to another, clamped to the output range. The mapping will ease into the output range with a velocity of
0. If only 3 parameters are given, the input range is0to1and the given values are used for the output range. -
effect
-
Get the effect on a layer with a given name or index.
Parameters
-
nameOrIndex: string | number
The effect's name or index
Returns Effect
The first effect with the given name, or at the given index
-
footage
-
Gets the footage object for the item with the provided name
Parameters
-
name: string
The file name of the footage item
Returns Footage
The relevant footage item
-
framesToTime
-
Converts a number of frames to time in seconds
Parameters
-
frames: number
The frame count to convert
-
fps: number = ...
The frames per second use in the calculation
Returns number
The given frames as time
-
fromComp
-
Transforms a given vector from the compositions space to the layer's space
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
The vector to transform
-
time: number = ...
The time to sample the vector
Returns VectorType
The vector in the layer's space
-
fromCompToSurface
-
Projects a point located in composition space to a point on the surface of the layer (zero z-value) at the location where it appears when viewed from the active camera.
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
The vector to transform
-
time: number = ...
The time to sample the number
Returns VectorType
The vector in on the layers surface space
-
fromCompVec
-
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
-
time: number = ...
Returns VectorType
-
fromWorldVec
-
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
-
time: number = ...
Returns VectorType
-
gaussRandom
-
Parameters
-
Optional minValOrArray: number | []
If only one argument is provided, the max value for the random number, otherwise the minimum value
-
Optional maxValOrArray: number | []
The maximum value to return
Returns number | []
a random value with a gaussian distribution either between
0and1,0and the first argument, or the first and second argument if two are provided. If the arguments are arrays, an equal length array of random values will be returned -
hexToRgb
-
Converts a color in hex triplet space to RGB, or in hex quartet space to RGBA space. For hex triplets, alpha defaults to 1.0
Parameters
-
hex: string
String representing an hex triplet (6 digits, no alpha channel) or quartet (8 digits, includes alpha channel) containing only numerals or characters A–F. Optional leading characters 0x, 0X, or # are ignored. Characters beyond 8 digits are ignored.
Returns Color
-
hslToRgb
length
linear
-
Parameters
-
t: number
The input value to be re-mapped
-
tMin: number
The inputs low floor
-
tMax: number
The inputs high ceiling
-
Optional value1: number | []
The output floor
-
Optional value2: number | []
The output ceiling
Returns number | []
A given value, mapped from one range to another, clamped to the output range. If only 3 parameters are given, the input range is
0to1and the given values are used for the output range. -
lookAt
-
Used to orient a layer towards a given point in 3D space
Parameters
-
fromPoint: Vector
The location in world space of the layer you want to orient
-
atPoint: Vector
The point in world space you want to point the layer at
Returns Vector3D
An orientation value that can be used to orient the layer so that the z-axis points at the
atPoint -
mask
-
Get the mask on a layer with a given name or index.
Parameters
-
nameOrIndex: string | number
The mask's name or index
Returns Mask
The first mask with the given name, or at the given index
-
mul
-
Multiplies a vector by a given scalar amount
Type parameters
-
VectorType: NumericValue
Parameters
-
vec1: VectorType
The vector to multiply
-
amount: number
The amount to multiply by
Returns VectorType
-
noise
-
Used to get a random value via Perlin noise, where inputs values that are close together will result in output values that are closer together.
Parameters
-
valOrArray: number | []
The noise input value
Returns number
A value between
-1and1 -
normalize
radiansToDegrees
-
Convert a given value in radians to degrees
Parameters
-
radians: number
The value to convert
Returns number
The value radians
-
random
-
Parameters
-
Optional minValOrArray: number | []
If only one argument is provided, the max value for the random number, otherwise the minimum value
-
Optional maxValOrArray: number | []
The maximum value to return
Returns number | []
a random value either between
0and1,0and the first argument, or the first and second argument if two are provided. If the arguments are arrays, an equal length array of random values will be returned -
rgbToHsl
sampleImage
-
Sample a layers color at a given point
Parameters
-
point: Vector2D
The center point of the sampling area, in layer space
-
radius: Vector2D = ...
Defines the sample area size, the horizontal and vertical distance from the center
-
postEffect: boolean = true
Whether to sample the layer after effects and masks are applied
-
time: number = ...
The time at which to sample
Returns Color
The average color of the layer in the sample area
-
seedRandom
-
Used to modify the random seed for an expression
Parameters
-
offset: number
A value used to modify the random seed
-
timeless: boolean = false
Whether the random seed should be consistent across time
Returns void
-
sourceRectAtTime
-
Gets the layer's size and position at a given time
Parameters
-
time: number = ...
The time at which to get the layers bounds
-
includeExtents: boolean = false
Whether to include areas of the layer outside the bounding box. Applies to Shape Layers and Paragraph Text.
Returns SourceRect
An object with properties for layers
top,left,widthandheightvalues at the given time. -
Optional sourceTime
-
Returns the layer's source item at the given time
Parameters
-
time: number = ...
The time at which to get the source
Returns Footage
The source item
-
sub
-
Subtracts two vectors
Type parameters
-
A: NumericValue
-
B: NumericValue
Parameters
-
a: A
-
b: B
Returns MathReturn<A, B>
-
timeToCurrentFormat
-
Converts a given time in seconds to the current time display format of the Project.
Parameters
-
t: number = ...
The time to convert
-
fps: number = ...
Frame rate to use for the conversion
-
isDuration: boolean = false
Whether
trepresents a duration rather than an absolute time. Durations are rounded away from zero rather than down. -
ntscDropFrame: boolean = ...
Returns string
-
timeToFeetAndFrames
-
Converts a given time in seconds to a string representing feet of film and frames.
Parameters
-
t: number = ...
The time to convert
-
fps: number = ...
Frame rate to use for the conversion
-
framesPerFoot: number = 16
Number of frames in one foot of film
-
isDuration: boolean = false
Whether
trepresents a duration rather than an absolute time. Durations are rounded away from zero rather than down.
Returns string
-
timeToFrames
-
Converts a given time in seconds to an integer amount of frames
Parameters
-
t: number = ...
The time to convert in seconds
-
fps: number = ...
Frames per second to calculate with, defaulting to the compositions frame rate
-
isDuration: boolean = false
Whether
trepresents a duration rather than an absolute time. Durations are rounded away from zero rather than down.
Returns number
The time in frames
-
timeToNTSCTimecode
-
Converts a given time value to a NTSC timecode string
Parameters
-
t: number = ...
The time to convert
-
ntscDropFrame: boolean = false
-
isDuration: boolean = false
Whether
trepresents a duration rather than an absolute time. Durations are rounded away from zero rather than down.
Returns string
-
timeToTimecode
-
Converts the given time value to a timecode string (e.g.
"00:00:00:00")Parameters
-
t: number = ...
The time to convert
-
timecodeBase: number = 30
The frames per second to use in the calculation
-
isDuration: boolean = false
Whether
trepresents a duration rather than an absolute time. Durations are rounded away from zero rather than down.
Returns string
The time as a timecode string
-
toComp
-
Transforms a given vector from the layer's space to the composition space
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
The vector to transform
-
time: number = ...
The time to sample the vector
Returns VectorType
The vector in the composition space
-
toCompVec
-
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
-
time: number = ...
Returns VectorType
-
toWorld
-
Transforms a given vector from the layers space to the view-independent world space
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
The vector to transform
-
time: number = ...
The time to sample the number
Returns VectorType
The vector in world space
-
toWorldVec
-
Type parameters
-
VectorType: Vector
Parameters
-
vec: VectorType
-
time: number = ...
Returns VectorType
-
Generated using TypeDoc

Whether the video switch is enabled, and the current time is between in the
inPointandoutPointof the layer