← back to roto on ba3a.dev

ModelClip

class ModelClip(val action: String, val facing: String, val frames: List<ModelFrame>, val loop: Boolean, val origin: String)

One finished animation the artist imported as reference: an action and facing, its frames at one size with their durations, and whether it loops. A model is read-only; it is stored under the profile's models/<action>_<facing>/ folder.

Constructors

Link copied to clipboard
constructor(action: String, facing: String, frames: List<ModelFrame>, loop: Boolean, origin: String)

Properties

Link copied to clipboard

the action, a SafeName

Link copied to clipboard

the facing, a SafeName

Link copied to clipboard

the frames in order, at least one, all the same size

Link copied to clipboard
val height: Int

The frames' height.

Link copied to clipboard
val key: String

<action>_<facing>: the model's folder name.

Link copied to clipboard

whether the animation repeats

Link copied to clipboard

where it was imported from, for the artist's information

Link copied to clipboard
val width: Int

The frames' width.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Equal when every part is.

Link copied to clipboard
fun frameIndexFor(index: Int, keyFrameCount: Int): Int

The index of the model frame shown with key frame index of keyFrameCount: the nearest to index * (n - 1) / (k - 1) for n model frames and k key frames, in exact integer arithmetic with halves rounded up. One key frame shows the first model frame.

Link copied to clipboard
open override fun hashCode(): Int

Consistent with equals.

Link copied to clipboard

The model.json content: everything but the pictures.

Link copied to clipboard
open override fun toString(): String

The key and frame count, for messages and tests.