Scripting API
Scripting API
AnimationClipFiles
Class in Abyss.Core, from Abyss.Core.
A clip as a file of its own: an .anim in a game's assets, which holds one clip — a sprite's frames, and the events, curves and sync markers a model's clip has.
public static class AnimationClipFilesRemarks
Played as a model's clip is: loaded by its path with World.LoadClip, played on an animator, named by a controller's state. Its frames are written into the animator's own sprite as it plays — the image, and the slice of it — each shown until the next, the last for one sample. It is JSON:
{ "abyssClip": 1, "samples": 12, "loop": true, "frames": [ { "time": 0, "image": "sprites/coin.png", "guid": "bd0682ba36624411a3b60ffee2585e2a", "slice": "e1f027e90c274848" }, { "time": 0.083333336, "image": "sprites/coin.png", "guid": "bd0682ba36624411a3b60ffee2585e2a", "slice": "11ee6444f37c5ed7" } ], "events": [ { "time": 0.5, "type": "Footstep", "fields": {} } ], "curves": [ { "field": "Footing.Plant", "smooth": true, "keys": [[0, 0], [0.5, 1]] } ], "markers": [ { "time": 0, "name": "LeftDown" } ]}A frame names its image by its path and, under guid, by its identity, so an image moved or renamed is still found; and of an image cut into slices, the slice by its identity.
Properties
New
public static string New { get; }What a new clip file says: nothing on it yet, twelve samples a second, looping.
Methods
Is
public static bool Is(string path)Whether a path names a clip file, by its extension, and not one of a model's clips.
Parameters
path
NameOf
public static string? NameOf(string path)What a clip is called: a model's by its name after the #, a clip file by its file's name; null for a path that is neither.
Parameters
path
Constants
Extension
public const string Extension = ".anim"The extension a clip file has.
Version
public const int Version = 2The version of a clip file this build writes; it reads this and every one before it.
Key
public const string Key = "abyssClip"The key that says a file is a clip file, and which version.
Samples
public const float Samples = 12How many samples a second a clip has where nothing says otherwise: twelve, as slices dragged together are played.
MostSamples
public const float MostSamples = 1000The most samples a second a clip may have.
