Scripting API

Scripting API

AnimationClipDocument

Class in Abyss.Core, from Abyss.Core.

What a clip file says, to read and change; see AnimationClipFiles.

public sealed class AnimationClipDocument

Properties

Samples

public float Samples { get; set; }

How many samples a second it has, which its frames are placed by.

Loop

public bool Loop { get; set; }

Whether it loops when nothing says otherwise.

Frames

public List<ClipFrame> Frames { get; }

Its frames, in the order of their times.

Events

public List<ClipEvent> Events { get; }

What it fires as it passes, in the order of their times.

Curves

public List<ClipCurve> Curves { get; }

The fields it writes as it plays.

Markers

public List<ClipMarker> Markers { get; }

Its sync markers, in the order of their times.

Length

public float Length { get; }

How long it is, in seconds, as the engine plays it: as far as what is on it reaches — its last frame and a sample, its curves' last keys, its events and its markers — and a sample at least.

Methods

Of

public static AnimationClipDocument Of(IEnumerable<(string Image, AssetGuid Guid, ulong? Slice)> frames, float samples = 12)

A clip of frames one after another, a sample apart, at samples a second, looping: what images or slices dragged together make.

Parameters

  • frames: Each frame's image, its identity and its slice, in the order they are shown.
  • samples: How many samples a second.

Copy

public AnimationClipDocument Copy()

A copy, every list copied too.

Parse

public static AnimationClipDocument Parse(string text)

Reads a clip file's text: its frames, events and markers put in the order of their times.

Parameters

  • text

Exceptions

  • FormatException: It is not JSON, not a clip file, of a newer version, or of the wrong shape.

Order

public void Order()

Puts its frames, events and markers in the order of their times, keeping the order of those at one time.

Text

public string Text()

The file's text: two spaces in, its keys in one order, a list with nothing in it left out.