← back to roto on ba3a.dev

ModelImporter

class ModelImporter(profileFolder: ProfileFolder, config: ProjectConfig)

Turns a ModelSource and the artist's confirmed rows into model folders under a profile. All rows are checked first, then staged in a temporary folder with model.json written last in each, then moved into place; a failure leaves the profile as it was. A key that already exists is refused unless replace is true. The same source always gives byte-identical folders.

Constructors

Link copied to clipboard
constructor(profileFolder: ProfileFolder, config: ProjectConfig)

Functions

Link copied to clipboard
fun import(source: ModelSource, rows: List<ConfirmedRow>, origin: String, replace: Boolean, writer: ModelFileWriter = ModelFileWriter { _, write -> write() }): List<String>

Imports rows from source and returns the models' keys in row order. origin is recorded as where they came from. Each staged file write goes through writer.