Configuration
Project and scene settings.
Precedence, from strongest to weakest: command-line flags, the @k.scene decorator, the [scene] table of kinemo.toml, built-in defaults.
kinemo.toml#
Found by walking up from the current directory; the directory that contains it is the project root. kinemo new writes this one:
# kinemo project configuration
[scene]
fps = 60
size = "1080p"
theme = "dark"
[render]
out = "out"
[lints]
allow = []
Keys#
| Key | Type | Default | Effect |
|---|---|---|---|
[scene] size |
str | tuple[int, int] |
"1080p" |
Output size: a preset name ("1080p", "4k", "vertical", ...) or (width, height) in pixels. |
[scene] fps |
float |
60 |
Frames per second of the final render. |
[scene] background |
ColorLike | None |
None |
Background color; None uses the theme's bg. |
[scene] seed |
int |
0 |
Seed for random and numpy.random during the build, so scenes are reproducible. |
[scene] tail |
float |
0.5 |
Seconds added after the last animation ends. |
[scene] theme |
Theme | str | None |
None |
A k.Theme or the name of one in k.themes ("dark", "light", "blueprint"). |
[scene] camera |
str |
"2d" |
"2d" or "3d". |
[render] * |
table | {} |
Read into ProjectConfig.render; the CLI does not use it yet. The output directory is set with --out (default out). |
[lints] allow |
list[str] |
[] |
Lint codes allowed in the whole project (see diagnostics). |
[tts] provider |
str |
None |
Text-to-speech provider for s.voice. Without one, s.voice is silent with an estimated duration and lint W1401 is reported. |
[cache] dir |
str |
".kinemo-cache" |
Cache directory (generated audio, ...), relative to the project root. |
[editor] command |
str |
"vscode" |
Editor the preview opens when an object is clicked (vscode, idea or a command). |
[python] workers_threshold |
float |
2.0 |
Seconds of k.python computation above which a worker pool is used. |
@k.scene options#
@k.scene(size="vertical", fps=30, tail=1.0, theme="light")
def intro(s: k.Scene): ...
| Option | Type | Default | Effect | Where |
|---|---|---|---|---|
size |
str | tuple[int, int] |
"1080p" |
Output size: a preset name ("1080p", "4k", "vertical", ...) or (width, height) in pixels. |
also [scene] |
fps |
float |
60 |
Frames per second of the final render. | also [scene] |
background |
ColorLike | None |
None |
Background color; None uses the theme's bg. |
also [scene] |
seed |
int |
0 |
Seed for random and numpy.random during the build, so scenes are reproducible. |
also [scene] |
tail |
float |
0.5 |
Seconds added after the last animation ends. | also [scene] |
theme |
Theme | str | None |
None |
A k.Theme or the name of one in k.themes ("dark", "light", "blueprint"). |
also [scene] |
camera |
str |
"2d" |
"2d" or "3d". |
also [scene] |
params |
dict[str, Param] | None |
None |
Scene parameters (k.Int, k.Float, k.Bool, k.Choice, k.Str), passed to the function by name. |
decorator only |
name |
str | None |
None |
Scene name used by --scene; defaults to the function name. |
decorator only |
See k.scene and k.SceneDef.
Sizes#
The frame always has 9 units on its shorter side; the longer side follows the aspect ratio. The origin is the center and y points up.
| Preset | Pixels | Frame units | Draft pixels |
|---|---|---|---|
"720p" |
1280 × 720 | 16 × 9 | 960 × 540 |
"1080p" |
1920 × 1080 | 16 × 9 | 960 × 540 |
"4k" |
3840 × 2160 | 16 × 9 | 960 × 540 |
"square" |
1080 × 1080 | 9 × 9 | 540 × 540 |
"vertical" |
1080 × 1920 | 9 × 16 | 540 × 960 |
Any (width, height) tuple is also accepted.
Quality presets#
| Preset | Resolution | Frame rate | Used by |
|---|---|---|---|
draft |
shorter side scaled down to 540 px (never up), even sizes | the scene's fps, at most 30 | kinemo dev, kinemo snap (default) |
final |
the scene's size | the scene's fps | kinemo render (default) |
Choose with --quality draft|final on kinemo snap and kinemo render.