Skip to content

Architecture Overview

K-Pipe is a uv workspace of self-contained packages under packages/. Each package owns its full source tree under its own src/ (e.g. packages/core/src/kpipe/, packages/nuke/src/kpipe_nuke/) — there is no shared top-level lib//scripts// extensions//res/ tree. The core library (kpipe) lives in packages/core/src/kpipe/; optional DCC packages (e.g. kpipe_blender, kpipe_nuke) each bundle their own launcher and DCC extension together.

Key modules

Module Location Role
config.py packages/core/src/kpipe/ Loads TOML configs; resolves per-user overrides (<key path>.<username>.<key>)
entity.py packages/core/src/kpipe/ Entity, EntityData (metadata TOML), EntityFileHelper (naming)
production.py packages/core/src/kpipe/ ProductionManager singleton; file-locked TOML cache (30-min TTL)
attributes.py packages/core/src/kpipe/ Config queries — FPS, handles; project formats get_format() / get_formats() → Format (name, resolution, overscan)
media/ packages/core/src/kpipe/ DCC-agnostic media vocabulary: format/codec registries, settings, presets, OCIO color roles, frame ranges, file-type detection — see Media Settings & Presets
publish.py packages/core/src/kpipe/ publish_file/video/sequence/texture_set() — copies outputs into the publish tree and records metadata, including the media settings (legacy integrate_*() functions are deprecated)
pipeline.py packages/core/src/kpipe/ Five-phase publish workflow and action registry
session.py packages/core/src/kpipe/ DCC workfile lifecycle with DCC-specific callbacks
path.py packages/core/src/kpipe/ Template-based path resolution

DCC integration pattern

Each DCC follows a three-layer pattern:

Launcher script        →  resolves DCC install path, sets env vars, spawns DCC
  └─ Extension         →  startup scripts loaded by the DCC, initialises K-Pipe context
       └─ Session      →  manages active entity/task; DCC registers open/save/close callbacks

See DCC Integration for details.

Production backend

ProductionManager abstracts the data source via ProductionBackend. The only implemented backend is Kitsu (packages/kitsu/src/kpipe_kitsu/backend.py) using the gazu SDK. Results are cached locally in a TOML file with filelock for multi-process safety.

Set data_backend = "kitsu" (or "local") in the project config.

Shots in the cache carry their Kitsu casting: a casting list of {asset_id, asset_type, asset, count, label, animated} entries (animated is true for Kitsu's animate label and false for fixed). It is read with ProductionManager.get_shot_casting(sequence, shot) or Entity.get_casting(); asset_type/asset match the asset cache keys.