81
JavaScript Reference
KeyframeEase object
81
KeyframeEase object
m y K e y = n e w K e y f r a m e E a s e (
s p e e d , i n f l u e n c e
) ;
Description
The KeyframeEase object encapsulates the keyframe ease settings of a layer’s AE property. There are two types
of ease, temporal and spatial, which are determined by the speed and influence settings. Both types are set
using the property’s
s e t T e m p o r a l E a s e A t K e y
method. See “Property setTemporalEaseAtKey() method” on
page 136.
The constructor creates a KeyframeEase object. Both parameters are required.
•
s p e e d
: A floating-point value. Sets the
s p e e d
attribute.
•
i n f l u e n c e
: A floating-point value in the range [0.1..100.0]. Sets the
i n f l u e n c e
attribute.
Example
This example assumes that the Position, a spatial property, has more than two keyframes.
v a r e a s e I n = n e w K e y f r a m e E a s e ( 0 . 5 , 5 0 ) ;
v a r e a s e O u t = n e w K e y f r a m e E a s e ( 0 . 7 5 , 8 5 ) ;
v a r m y P o s it i o n P r o p e r t y = a p p . p r o j e c t . i t e m
(
1
)
. l a y e r ( 1 ) . p r o p e r t y
( "
P o s i t i o n
" )
m y P o s i t i o n P r o p e r t y . s e t T e m p o r a l E a s e A t K e y ( 2 , [ e a s e I n ] , [ e a s e O u t ] ) ;
This example sets the Scale, a temporal property with two dimensions. For 2D and 3D properties you must
set an
e a s e I n
and
e a s e O u t
value for each dimension:
v a r e a s e I n = n e w K e y f r a m e E a s e ( 0 . 5 , 5 0 ) ;
v a r e a s e O u t = n e w K e y f r a m e E a s e ( 0 . 7 5 , 8 5 ) ;
v a r m y S c a l e P r o p e r t y = a p p . p r o j e c t . i t e m ( 1 ) . l a y e r ( 1 ) . p r o p e r t y ( " S c a l e " )
m y S c a l e P r o p e r t y . s e t T e m p o r a l E a s e A t K e y ( 2 , [ e a s e I n , e a s e I n , e a s e I n ] , [ e a s e O u t , e a s e O u t , e a s e O u t ] ) ;
Attributes
KeyframeEase influence attribute
m y K e y
. i n f l u e n c e
Description
The influence value of the keyframe, as shown in the Keyframe Velocity dialog box.
Type
Floating-point value in the range [0.1..100.0]; read/write.
Attribute
Reference
Description
s p e e d
“KeyframeEase speed attribute” on page 82
The speed setting for a keyframe.
i n f l u e n c e
“KeyframeEase influence attribute” on page 81
The influence setting for a keyframe.
Summary of Contents for 65009963 - After Effects CS4
Page 1: ...SCRIPTING GUIDE...