CLI reference › Reconciliation and lifecycle

model

The gallery's 3D model actions, from the terminal, for painting in your own editor or for a script. A model is a .glb under a style's outDir; name one by its path, its file name, or its gallery id. Nothing here reads or writes the manifest or the lockfile, and the model as built is never written.

pixelkiln model list [--json]
pixelkiln model resolve [knight] [--json]
pixelkiln model export knight --image Helm [--out <dir>] [--no-open] [--json]
pixelkiln model import knight --image Helm [--from <png>] [--json]
pixelkiln model blender knight
pixelkiln model adopt knight [--mode textures|whole] [--from <glb>] [--json]
pixelkiln model normal-map knight [--source views|texture|sprites] [--image <material>[,…]] [--views south,east,…]
                                  [--size <px>] [--sprites <folder>|south=a.png,…] [--pose <animation>[@s]] [--blend <0-2>] [--replace] [--surface-detail <n>]
                                  [--detail-softness <n>] [--mode lite|pro] [--budget <n>] [--dry-run] [--yes] [--json]
  • list (the default) shows every model with its meshes, bones, animations, and images by index, material, and role, and its edited copy if there is one. --style narrows it. A normal map is listed as <material> normal map.

  • resolve prints the file a game or build script should load for a model, as a manifest-relative path: the edited copy when it is an edit of the model as it is now (edited) or a file placed in the edit slot by hand with no record (unrecorded); otherwise the model as built. An edit made before the model was rebuilt (rebuilt-since) is passed over for the new build, with a note on stderr, since its meshes may no longer match. Given a model it prints only the path; without one it lists every model as <as built> -> <load> (<why>). --json gives styleId, file, load, from (edit or built), edit, status, and absolute (the load path made absolute): one object for a named model, an array otherwise. It reads only. pack, mount, and export still do not read models.

  • export writes one texture for painting anywhere: --image takes the image index, a material name (its base colour texture), or <material>:normal (its normal map), e.g. --image Helm:normal. Three files land beside the edited copy, or in --out: <name>.image-<n>.png, the texture as PNG (a JPEG texture is decoded; progressive JPEG is refused with the reason), taken from the edited copy when there is one; <name>.image-<n>.guide.png, a transparent layer the same size with every unwrap piece outlined in its region's colour and numbered; and <name>.image-<n>.guide.txt, which names each number and lists every piece with its label, pixel bounds, and meshes. The texture then opens in PIXELKILN_EDITOR or the OS default, unless --no-open. Lay the guide on top as its own layer; it is never imported.

  • import reads the painted PNG back (or --from <png>), refuses one of a different size, and writes the edited copy with only that texture replaced, plus the same .edit.json record a browser save writes, naming the editor PIXELKILN_EDITOR names.

  • blender starts Blender with the model (or its edited copy) imported and File > Export > PixelKiln edit (.glb) added; see PIXELKILN_BLENDER above.

  • adopt takes what that export wrote. --mode textures (the default) takes only the base colour textures and normal maps that changed, by material name, into a copy of the model as built; --mode whole takes the file as it is. --from <glb> adopts a file from somewhere else.

  • normal-map adds normal map detail from PixelLab's /normal-map to the model's normal maps (all of them, or --image Helm,Cape), written into the edited copy with a record per map (editor pixellab normal-map (<source>)). It is the one model command that spends: it prints the calls and their price, then asks (--yes skips the question, --budget refuses a run that costs more, --dry-run writes the pictures it would send and stops). PixelLab is asked for surface detail only, with outline rounding and part shapes at 0, since the mesh already has its shape. Two sources:

    • --source views (the default) draws the whole figure from --views (four sides unless given: south,east,north,west; any of the eight directions or degrees), each at --size px (8–512, default 512), sends each picture, and carries the normals back onto every texture through the surface: each texel takes them from the views that see it, weighted by how squarely. One call per view, whatever the number of textures: 0.4 generation for four in lite mode. The detail is consistent across seams but coarser than the texture, and a part no view sees (under an arm, behind the cape) keeps the map it had.
    • --source texture sends each normal map's base colour texture as laid out, masked to the unwrap and cut into tiles of at most 512 px: one call per tile (a 1024 texture is four). The detail is finer and covers every piece, but neighbouring pieces of the unwrap are read separately and can disagree where they meet, which shows as a line along the seam.
    • --source sprites sends the figure's own sprites, the art the model was made from: a folder of <direction>.png (south.png, north-east.png, …; a PixelLab character's rotations/ folder inside it is found too), given with --sprites <folder> or as --sprites south=a.png,east=b.png, and by default <model>.sprites/ beside the model. Each sprite is lined up with the model: the camera's tilt (sprites are often drawn from a little above), scale, and position are searched for where the most sprite pixels are matched by the model's own paint, and only those matching pixels pass their normals on. The dry run prints, per sprite, how much lined up in colour, the outline overlap, and the tilt found, and writes sprite-<direction>.fit.png (the sprite, the model's outline in red, the unused pixels dimmed). A sprite under 25% is left out, and with none left the run is refused. One call per sprite. This only pays off when the model was built to the sprites' proportions: on the sample knight, whose mesh has adult proportions and level arms against chibi A-pose sprites at 80 px, 35–52% of each sprite lined up and the detail came out patchy and soft, clearly worse than views. The plan says so before anything is spent.

    --pose <animation>[@seconds] poses the model at a moment of one of its animations first (names match without case or spacing: Idle Loop finds Idle_Loop), for sprites drawn in a stance other than the rest pose; it applies to any source.

    The detail is blended onto the normal map the model has ("whiteout": the sideways parts add, so the relief baked from the high-detail mesh stays); --blend scales it (0–2, default 1) and --replace writes PixelLab's detail alone. Every picture sent and every answer is kept in <name>.normal-map/<source>/ beside the edited copy, with image-<n>.detail.png showing the detail on its own; an answer is reused whenever the same picture is asked for again, so running again with another --blend or --replace is free. Each run blends onto the normal map as it was before the first PixelLab run (kept there as image-<n>.base.png), so runs re-tune the detail rather than stack it, and --blend 0 takes it off; a hand paint or an adopt after that becomes the new starting map. --mode pro is 0.5 generation a call. On the sample knight in testing, both sources added relief to trim and embossing and little to plain cloth; the effect is subtle at --blend 1.