Layer general attributes and methods, T “layer – Adobe After Effects CS3 User Manual

Page 575

Advertising
background image

AFTER EFFECTS CS3

User Guide

570

Argument type: index is a Number.

After Effects finds the mask by its index in the Timeline panel, starting at 1 and counting from the top.

Layer General attributes and methods

width

Return type: Number.

Returns the width of the layer, in pixels. It is the same as

source.width

.

height

Return type: Number.

Returns the height of the layer, in pixels. It is the same as

source.height

.

index

Return type: Number.

Returns the index number of the layer in the composition.

parent

Return type: Layer, Light, or Camera.

Returns the parent Layer object of the layer, if there is one. Example:

position[0] + parent.width

hasParent

Return type: Boolean.

Returns true if the layer has a parent or false if it doesn’t.

Use the

hasParent

attribute to determine if a layer has a parent. You can use this attribute even if there isn’t a parent

layer at present. For example, the following expression indicates that the layer to which you apply it will wiggle based
on the position of the layer’s parent. If the layer has no parent, then it will wiggle based on its own position. If the
layer is given a parent later, then the layer’s behavior will change accordingly:

idx = index;

if (hasParent) {

idx = parent.index;

}

thisComp.layer(idx).position.wiggle(5,20)

inPoint

Return type: Number.

Returns the In point of the layer, in seconds.

Note: In general, the value of

outPoint

is greater than the value of

inPoint

. However, if a layer is reversed in time, the

value of

inPoint

is greater than the value of

outPoint

. Similarly, the value of

startTime

can be greater than the value

of

inPoint

.

outPoint

Return type: Number.

Returns the Out point of the layer, in seconds.

startTime

Return type: Number.

Returns the start time of the layer, in seconds.

hasVideo

Return type: Boolean.

Returns true if the layer has video, or false if it doesn’t.

hasAudio

Return type: Boolean.

Returns true if the layer has audio or false if it doesn’t.

active

Return type: Boolean.

Advertising