← back to roto on ba3a.dev

GodotSpeed

object GodotSpeed

The speed of a Godot animation, in frames per second. A frame there lasts a number of units of 1 / speed seconds, and the natural unit is the greatest common divisor of the durations, which gives a speed of 1000 / divisor. The speed is kept a whole number: when that quotient is not one, it is the artist's choice, or else the quotient rounded half up and at least 1.

Functions

Link copied to clipboard
fun ask(formats: List<OutputFormat>, clip: Clip, handoff: Path): Int?

The speed to ask the artist for, for clip of a project that writes formats, whose rendered handoff is the file handoff: the stored choice, or else the suggestion. Null when there is nothing to ask: the project writes no Godot frames, or the durations a publish writes, after the clip's retime, have a whole speed. A handoff that cannot be read, or lacks a frame the retime keeps, is an java.io.IOException.

Link copied to clipboard
fun isWhole(durationsMs: List<Int>): Boolean

Whether frames lasting durationsMs have a whole speed of their own, which leaves nothing to choose.

Link copied to clipboard
fun of(durationsMs: List<Int>, chosen: Int? = null): Int

The speed for frames lasting durationsMs; chosen applies only while their own speed is not whole.

Link copied to clipboard
fun parse(text: String): Int

The speed the artist typed as text; anything but a whole number of at least 1 is refused.