ADOBE AFTER EFFECTS 7.0
User Guide
568
thisComp.layer(“nested comp”).source.layer(1).position
Note: If you use a specific time in an expression, After Effects ignores the remapped time.
Commonly used attributes and methods
The hasParent attribute
Use the hasParent attribute to determine if a layer has a parent. You can use this attribute even if there isn’t a parent
layeratpresent.Forexample,thefollowingexpressionindicatesthatthelayertowhichyouapplyitwillwigglebased
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)
The name attribute
Use the name attribute with Comp, Footage, Layer, Mask, and Effect objects when you want to apply the same
expression to several layers and vary the results based on the name of an object. For example, the following
expression wiggles the position of a layer differently if the layer is named "
hero":
amp = 20;
if (name == "hero") {
amp = 40;
}
wiggle(5, amp)
Layer space transform methods
Use layer space transform methods to transform values from one space to another, such as from layer space to world
space. The “from” methods transform values from the layer’s space to the named space (comp or world). The “to”
methods transform values from the named space (comp or world) to the layer space. Each transform method takes
an optional parameter to determine the time at which the layer’s transform is computed; however, you can almost
always use the current (default) time.
Use “Vec” transform methods when transforming a direction vector, such as the difference between two position
values. Use the plain (non-”Vec”) transform methods when transforming a point, such as position. Comp and world
spacearethesamefor2Dlayers.For3Dlayers,however,compspaceisrelativetotheactivecamera,andworldspace
is independent of the camera.
See also
“Layer Space Transforms methods” on page 581