View comments | RSS feed

After Effects CS3  |  Go to CS4 Help

Expression time

Time within an expression is always in composition time (not layer time) and is measured in seconds. The default time for any expression is the current composition time at which the expression is being evaluated. The following expressions both use the default composition time and return the same values:

  thisComp.layer(1).position 
  thisComp.layer(1).position.valueAtTime(time)

To use a relative time, add an incremental time value to the time argument. For example, to get the Position value 5 seconds before the current time, use the following expression:

  thisComp.layer(1).position.valueAtTime(time-5)

Default time references to properties in nested compositions use the original default composition time, not remapped time. However, if you use the source function to retrieve a property, the remapped time is used.

For example, if the source of a layer in the parent composition is a nested composition, and in the parent composition you have remapped time, when you access the position values of a layer in the nested composition with the following expression, the position values use the composition’s default time:

  comp("nested composition").layer(1).position

However, if you access layer 1 using the source function, the position values use the remapped time:

  thisComp.layer("nested composition").source.layer(1).position
Note: If you use a specific time in an expression, After Effects ignores the remapped time.

Comments

Comments are no longer accepted for After Effects CS3. After Effects CS4 is the current version. To discuss After Effects CS3, please use the Adobe forum.

Comments


Cross_ said on Jul 30, 2008 at 2:44 PM :
When specifying a different time will AE evaluate the expression at that time?
Does this pose a risk for infinite loops ?
E.g. what happens if a position value is assigned the expression
thislayer.position.valueAtTime(time-0.1) ?
Todd_Kopriva said on Jul 30, 2008 at 5:34 PM :
It's usually better to ask questions like this on the After Effects Expressions User-to-User forum:

http://www.adobeforums.com/webx/.ef366e7/

When you use the valueAtTime method to sample the value of the property on which it's written, the return value is the value at that time as defined by the keyframes on the property. There's no danger of an infinite self-referential loop here.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/en_US/AfterEffects/8.0/WS3878526689cb91655866c1103906c6dea-7a30.html