Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expressions comment to prevent calculations on every frame. Is there such a thing?

  • Roland R. kahlenberg

    February 15, 2017 at 6:51 pm

    FOUND IT!!!

    expression sampling interval
    After Effects evaluates an expression at various times to determine whether the values held in the global performance cache are current or are stale and need to be updated with fresh values. This sampling at various times along the composition can cause interactions in a composition that combines expressions and certain other features to be rather slow, which causes various interactions to be sluggish.

    You can force the number of samples for a given expression to be exactly 1 for the entire composition by inserting the following comment in the expression:

    // cacheCompareSamplesPerSecond 0

    Even without the addition of this comment, After Effects will only use one sample for the entire composition if there are no features used that span across multiple frames, such as motion blur or wide-time effects (e.g., the Echo effect).

    The risk of using this feature to specify that only one sample is used is that you may get stale values in the global performance cache. Only use this comment when you are experiencing slowdowns with expression evaluation; be sure to check your rendered frames to make sure that they are updating as they should.

    You can also use the same comment with a whole number value to specify a sampling rate with the units of samples per second. For example, the following comment forces the expression to be sampled 25 times per second – i.e., on every frame of a 25fps composition:

    // cacheCompareSamplesPerSecond 25

    You should very rarely need to specify a higher sampling rate than the default, since After Effects will by default use an adaptive sampling rate that should be appropriate for most cases. Only set a higher sampling rate if you find that the frames that you are seeing contain the wrong image information that is not updating when it should. Specifying a high sample rate will slow down expression evaluation, so it should only be used when a problem is actually observed. You are only likely to run into this problem if the expression is upstream from a temporal effect such as Echo or Roto Brush or an extreme time speedup, or has very high frequencies and is motion blurred.

    https://blogs.adobe.com/creativecloud/new-changed-after-effects-cc-2014/

    TypeGEMs – the Definitive Type Gizmo for AE
    https://broadcastgems.com/typegems/

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations
    Adobe After Effects CC ACE/ACI
    Imagineer Systems (mocha) Certified Instructor

    https://www.broadcastgems.com/mographintensity_shapestext/

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy