← back to roto on ba3a.dev

Package-level declarations

Types

Link copied to clipboard
data class BrokenPreset(val id: String, val message: String) : LibraryEntry

A user preset that could not be loaded; listing it keeps one damaged folder from hiding the rest.

Link copied to clipboard

The presets shipped inside roto-core as classpath resources under presets/<id>/: preset.json, palette.hex and ramps.json each, with presets/index.txt listing the ids, one per line. They are generic starting points that name no game, engine or consumer layout.

Link copied to clipboard
sealed interface LibraryEntry

One preset the PresetLibrary lists: id is its folder name, or its built-in id.

Link copied to clipboard
data class LibraryPreset(val id: String, val builtIn: Boolean, val preset: ProjectPreset) : LibraryEntry

A preset that loaded.

Link copied to clipboard

The named ways published frames are laid out under a folder of the consuming project. The artist picks a folder and a layout and never sees a template. Every layout uses the variables ProjectConfig requires: all four in output, all but {frame} in manifest.

Link copied to clipboard
data class OutputTemplates(val output: PathTemplate, val manifest: PathTemplate)

The output and manifest templates a OutputLayout gives for one folder.

Link copied to clipboard

A preset as one .rotopreset file: a ZIP of exactly three entries, preset.json, palette.hex and ramps.json.

Link copied to clipboard

Reads and writes PresetInfo as preset.json; a bad file is a PresetException.

Link copied to clipboard
class PresetException(message: String, cause: Throwable? = null) : IOException

A preset, or a preset bundle, that is malformed or fails validation.

Link copied to clipboard
@Serializable
data class PresetInfo(val name: String, val description: String, val facings: List<String>, val mirrorPairs: List<MirrorPair>, val actions: List<String>, val canvas: Canvas, val layout: @Serializable(with = OutputLayoutSerializer::class) OutputLayout, val outputFolder: String, val formats: List<OutputFormat> = emptyList())

What preset.json holds: a ProjectPreset without its palette and ramps, which a bundle keeps in their own files. It has no afterPublish, so a shared file never makes Roto run a command, and reading rejects any key it does not know. Validated on construction by building the ProjectConfig it would give, with a probe id. Throws IllegalArgumentException naming the problem.

Link copied to clipboard
class PresetLibrary(builtIn: Map<String, ProjectPreset>, userFolder: Path)

The presets a project can start from: the builtIn ones, then the artist's own in userFolder (<config>/presets), one <id>/ folder each holding the three bundle files. Listing is sorted by id within each group, so it is deterministic. Adding is all-or-nothing: the files are written to a temporary folder that is then moved into place.

Link copied to clipboard

The inverse of ProjectScaffolder: turns an open project back into a ProjectPreset.

Link copied to clipboard
data class ProjectPreset(val name: String, val description: String, val facings: List<String>, val mirrorPairs: List<MirrorPair>, val actions: List<String>, val canvas: Canvas, val layout: OutputLayout, val outputFolder: String, val palette: Palette, val ramps: RampSet, val formats: List<OutputFormat> = emptyList())

Everything in a project setup that is not the project's identity: facings, mirror pairs, actions, canvas, output layout, output formats, palette and ramps. It holds no id, no project folder and no afterPublish, so sharing one never makes Roto run a command. Validated on construction by building the ProjectConfig it would give, and by checking that every ramp colour and the outline are in the palette. Throws IllegalArgumentException naming the problem.

Link copied to clipboard

Writes a new project from a ProjectPreset: roto/palette.hex, roto/ramps.json, then roto.json last, so a folder holding roto.json is always a complete project. Writes nothing and overwrites nothing: if any of the three files exists it stops first.

Link copied to clipboard
data class RecognisedLayout(val layout: OutputLayout, val folder: String)

A layout OutputLayout.recognise found in a pair of templates.

Link copied to clipboard
class ScaffoldException(message: String, val written: List<Path> = emptyList(), cause: Throwable? = null) : IOException

A scaffold that could not write a project.

Link copied to clipboard
fun interface ScaffoldWriter

How ProjectScaffolder performs one file write: runs write, which creates file. A seam for tests.