83
JavaScript Reference
Layer object
83
Layer object
a p p . p r o j e c t . i t e m
( i nd e x ) .
l a y e r
( i n d e x )
Description
The Layer object provides access to layers within compositions. It can be accessed from an item’s layer
collection either by index number or by a name string.
•
Layer is the base class for CameraLayer, TextLayer, LightLayer, and AVLayer, so Layer attributes and
methods are available when working with all layer types. See “AVLayer object” on page 39,
“CameraLayer object” on page 50, “LightLayer object” on page 97, and “TextLayer object” on page 172.
Layers contain AE properties, in addition to their JavaScript attributes and methods. For examples of how to
access properties in layers, see “PropertyBase object” on page 140.
Example
If the first item in the project is a CompItem, this example disables the first layer in that composition and
renames it. This might, for example, turn an icon off in the composition.
v a r f ir s t L a y e r = a p p . p r o j e c t . i t e m ( 1 ) . l a y e r ( 1 ) ;
f i r s t L a ye r . e n a b l e d = f a l s e ;
f i r s t L a ye r . n a m e = " D i s a b l e d L a y e r " ;
Attributes
Attribute
Reference
Description
i n d e x
“Layer index attribute” on page 87
The index position of the layer.
n a m e
“Layer name attribute” on page 89
The name of the layer.
p a r e n t
“Layer parent attribute” on page 89
The parent of this layer.
t i m e
“Layer time attribute” on page 91
The current time of the layer.
s t a r t T im e
“Layer startTime attribute” on page 91
The start time of the layer.
s t r e t c h
“Layer stretch attribute” on page 91
The time stretch percentage of the layer.
i n P o i n t
“Layer inPoint attribute” on page 87
The “in” point of the layer.
o u t P o i n t
“Layer outPoint attribute” on page 89
The “out” point of the layer.
e n a b l e d
“Layer enabled attribute” on page 86
When true, the layer is enabled.
s o l o
“Layer solo attribute” on page 91
When true, the layer is soloed.
s h y
“Layer shy attribute” on page 90
When true, the layer is shy.
l o c k e d
“Layer locked attribute” on page 87
When true, the layer is locked.
h a s V i d e o
“Layer hasVideo attribute” on page 86
When true, the layer contains a video component.
a ct i v e
“Layer active attribute” on page 84
When true, the layer is active at the current time.
n u ll L a y e r
“Layer nullLayer attribute” on page 89
When true, this is a null layer.
s e l e c t e d P r o p e r t i e s
“Layer selectedProperties attribute” on page 90
All selected AE properties in the layer.
c o m m e n t
“Layer comment attribute” on page 85
A descriptive comment for the layer.
c o n t a i n i n g C o m p
“Layer containingComp attribute” on page 85
The composition that contains this layer.
Summary of Contents for 65009963 - After Effects CS4
Page 1: ...SCRIPTING GUIDE...