Hierarchy

  • P3dValueCached
    • P3dAnimation

Accessors

  • get duration(): number
  • Animation duration in seconds

    Returns number

  • get id(): string
  • Unique string identifier for the object

    Returns string

  • get isPlaying(): boolean
  • Animation playback state

    Returns boolean

  • set isPlaying(value): void
  • Parameters

    • value: boolean

    Returns void

  • get loops(): number
  • Animation looping behavior: -1 is infinite loops. Otherwise a specific number of loops

    Returns number

  • set loops(value): void
  • Parameters

    • value: number

    Returns void

  • get name(): string
  • Animation name

    Returns string

  • get playFrom(): number
  • Limit animation playback range. By default between 0 and duration.

    Default: 0

    Returns number

  • set playFrom(value): void
  • Parameters

    • value: number

    Returns void

  • get playTo(): number
  • Limit animation playback range. By default between 0 and duration.

    Default: duration

    Returns number

  • set playTo(value): void
  • Parameters

    • value: number

    Returns void

  • get speed(): number
  • Animation playback speed factor

    Returns number

  • set speed(value): void
  • Parameters

    • value: number

    Returns void

  • get time(): number
  • Current animation playback time in seconds

    Returns number

  • set time(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Refresh animation values to their current states in the embed. This can be useful for example when determining playback position of animations.

    (Normally values are updated only after calling listAnimations())

    Using via then() callback:

    animation.refresh().then(() => {
    // Log current playback position
    console.log(animation.time);
    });

    Or in async function:

    await animation.refresh();
    // Log current playback position
    console.log(animation.time);

    Returns Promise<P3dAnimation>