User Guide

CHAPTER 10
332
Creating Expressions
Mask mask(name) {name is a string} Returns a layer Mask object. The name can be the
default name or a user-defined name.
Effect effect(index) {index is a number} Returns an Effect object. After Effects finds the effect
by its index in the Effect Controls window, starting at 1 and counting down from the top.
Effect effect(name) {name is a string} Returns an Effect object. After Effects finds the effect
by its name in the Effect Controls window. The name can be the default name or a user-
defined name. If there is more than one effect with the same name, the effect closest to the
top of the Effect Controls window is used.
Material properties for 3D layers
Property casts_shadows If the layer casts shadows, the returned value is 1.0.
Property accepts_shadows If the layer accepts shadows, the returned value is 1.0.
Property accepts_lights If the layer accepts lights, the returned value is 1.0.
Property ambient Returns the ambient component value as a percentage.
Property diffuse Returns the diffuse component value as a percentage.
Property specular Returns the specular component value as a percentage.
Property shininess Returns the shininess component value as a percentage.
Layer space transform methods
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.
Use the _vec methods when transforming a direction vector, such as the difference
between two positions. Use the plain (non-vec) methods when transforming a point, such
as position.
Comp and world space are the same for 2D layers. For 3D layers, however, comp space is
relative to the active camera, and world space is independent of the camera.
Each of these methods 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.
UG.book Page 332 Wednesday, February 21, 2001 12:05 PM