Skip to content

Markers

hernan edited this page Mar 22, 2021 · 2 revisions

Markers are now supported by the goToAndStop and goToAndPlay methods.

In order to make use of them, you have three different option for creating them in After Effect.

Option 1:

Add a json style object to the Comment field on After Effects.
The only mandatory field will be the the name field that will be used to identify the specific marker.

{
  "name":"position 1",
  "description": "this marker is used to identify the first frame of the loop"
}

Option 2:

Add a list of fields separated by new lines

name: position 1
description: this marker is used to identify the first frame of the loop

Option 3:

set a single string that will be used to start the animation at that position

position 1

Usage

goToAndPlay

anim.goToAndPlay('position 1') has two different behaviors:

  • If the marker has no duration, it will simply change the player position to the time the marker indicates and play from there.
  • If the marker has a specified duration, it will act as if the playSegments is called, and set the new duration of the animation to the duration of the marker.

goToAndStop

anim.goToAndStop('position 1') will set the playhead to the time position of the marker and pause the animation at that point.