@ikijs/mcp 0.34.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{chunk-HKJT3Q6G.mjs → chunk-Y36XOSK4.mjs} +227 -54
- package/dist/chunk-Y36XOSK4.mjs.map +1 -0
- package/dist/cli.js +226 -53
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +226 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/render-page.global.js +98 -8
- package/package.json +4 -4
- package/dist/chunk-HKJT3Q6G.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -30,9 +30,9 @@ Turns a set of role-named, full-canvas transparent PNG layers into a renderable,
|
|
|
30
30
|
- **`turnTargets`** — optional head-turn cues to fit the rig to, in the units `measure_turn_reference` reports off a front/turned reference pair: `eyeShift` (plus `noseShift` and `mouthShift`) is how far that feature slides across the head at full turn, as a fraction of the head's half-width — a **magnitude**, since the rig turns both ways and the sign is the turn's own business; `farEyeRatio` is the far/near eye width at full turn over that same ratio at rest; `silhouetteRatio` the head's half-width turned over at rest. An omitted field leaves that part of the turn at the profile the rig defaults to. An `eyeShift` you pass is fitted by the turn's amount and _clamped_ when it runs past the room the art leaves the far eye — the face plate's edge, or the bangs' side strand over the far iris — since that room is a fact about these layers, not about the reference. Any other target you **do** pass that it cannot reach is refused, because that number is a measurement rather than a preference. A layer set without a `nose` still turns its head, on the profile, but fits no target: `turnTargets` is then inert and the result carries no `turn`. A pair with a custom part crossing the eye row reads a wider head than the rig fits to: measure a pair drawn without them.
|
|
31
31
|
- **`rigPlan`** — optional per-character tuning from the profile the rig defaults to, in three groups: `turn` (`amount`: the whole head turn, ignored when `turnTargets.eyeShift` is given; `featureLead`: how far the features lead the face plate; `eyeForeshorten`: how much the far eye narrows on the turn, ignored when `turnTargets.farEyeRatio` is given; `noseLead`: how far the nose leads the plate on the turn, never the nod, ignored when `turnTargets.noseShift` is given — the last two have provisional recommended spans), `hair` (`follow`: the front hair's share of the face's turn; `outlineFollow`: its outer edge's share where it draws the head's outline; `sway`: the hair sway amplitude) and `eyes` (`blink`: how far the upper lid comes down over the eye's height). Call `describe_rig_plan` for each field's default, range, recommended span, step and poses. A value out of range, or a group or key not in the catalog, is refused as `INVALID: rigPlan.<path> …`. The old `style` input was removed in 0.30.0 and is refused with the map from each old knob to its `rigPlan` path.
|
|
32
32
|
- **`patches`** — optional displacements added to existing keyform stops of the freshly generated rig, each `{ target, at, region, by, falloff?, why? }` (`RigPatch` in `@ikijs/editor`). `target` is a feature grid (`eyeWarp_L`/`_R`, `browWarp_L`/`_R`, `noseWarp`, `mouthWarp`; `at` names `ParamAngleX` and `ParamAngleY`, each −30, 0 or 30, never both 0) or a mesh part with warps (`face`, `hair_front`, …; `at` names one parameter at one of its warp stops). `region` is a rectangle in fractions of a role's rest layer box (top-left origin, y down); `by` and `falloff` are in face widths on screen axes (+dx right, +dy down). They are replayed on every rig of these inputs, so they hold through a layout or `rigPlan` retune, and they never touch the rest stop or a stop where the rig shuts a part on purpose; `bodyWarp` and the matrix deformers are not targets. Aim them with `describe_iki`.
|
|
33
|
-
- **`customParts`** — optional parts the auto-rigger has no role for (a twin tail, a hairpin), each `{ id, path, anchor, tie, after, deformer?, rigid? }` (`CustomPart` in `@ikijs/editor`, with `path` in place of `layer`). `rigid: true` marks art that does not bend (a hairpin, a ribbon): a bake that bends it by more than 0.0025 face widths at a stop is refused. `path` is a PNG the size of the role layers, drawn alone and whole on a transparent ground; the tool takes its box from the layer's alpha. `anchor` is the role the part is fixed against, `tie` is `[x, y]` canvas px where it meets the anchor (inside both layers' boxes), `after` is a role of the set: the part is drawn right after that role's last part. `deformer` accepts only `headDeformer`, the default. The part goes into the model as an unrigged mesh on `headDeformer`. A custom layer is never role-parsed or measured, so its name is free and it does not widen the head the turn is fitted to (`headHalfWidth`, `headEdges` and `turn` are those of the role layers alone), but it counts toward the layer and pixel limits. All custom parts share one extra atlas page, the last, rendered with the call's `quantizeColors` on a palette of its own, so the role pages keep their bytes; `atlasBytes` includes it. A rig with `customParts: []` is the rig without the field. An empty or wrong-size layer, or an entry the rig refuses, comes back as `INVALID: customParts[i]…` and nothing is written. Needs 0.34.0: an older server drops the field and returns no `customParts`.
|
|
33
|
+
- **`customParts`** — optional parts the auto-rigger has no role for (a twin tail, a hairpin), each `{ id, path, anchor, tie, after, deformer?, rigid?, occlusion? }` (`CustomPart` in `@ikijs/editor`, with `path` in place of `layer`). `rigid: true` marks art that does not bend (a hairpin, a ribbon): a bake that bends it by more than 0.0025 face widths at a stop is refused. `occlusion: { by, parameter, stops: [{ value, amount }] }` hides the part where the roles in `by` (a non-empty list, no role repeated, each a role of the set; one with a clipped or meshless part, `iris_L` or `forearm_pose_L`, is refused) cover it, by an amount linear between the stops (ascending `value`, inside the parameter's range; `amount` 0 to 1) on a declared `parameter` that is not a physics output; the cover is where a role's drawn alpha is at least 0.5, a hard edge. Use the stops as a short switch starting a degree or more past the idle sway (amount 1 about one degree after 0), the hiding's progress coming from the part's baked motion; a long band turns the covered art translucent. The result's part then carries `occlusion` (`by` as the part ids written) and its `CUSTOM <id>:` line ends `, hidden by <id>,<id>… on <parameter> at <value>:<amount> <value>:<amount>…`; other parts' lines are unchanged. `occlusion` needs 0.35.0: an older server refuses the key as `INVALID: customParts[i]…`. `path` is a PNG the size of the role layers, drawn alone and whole on a transparent ground; the tool takes its box from the layer's alpha. `anchor` is the role the part is fixed against, `tie` is `[x, y]` canvas px where it meets the anchor (inside both layers' boxes), `after` is a role of the set: the part is drawn right after that role's last part. `deformer` accepts only `headDeformer`, the default. The part goes into the model as an unrigged mesh on `headDeformer`. A custom layer is never role-parsed or measured, so its name is free and it does not widen the head the turn is fitted to (`headHalfWidth`, `headEdges` and `turn` are those of the role layers alone), but it counts toward the layer and pixel limits. All custom parts share one extra atlas page, the last, rendered with the call's `quantizeColors` on a palette of its own, so the role pages keep their bytes; `atlasBytes` includes it. A rig with `customParts: []` is the rig without the field. An empty or wrong-size layer, or an entry the rig refuses, comes back as `INVALID: customParts[i]…` and nothing is written. Needs 0.34.0: an older server drops the field and returns no `customParts`.
|
|
34
34
|
- **`bakes`** — optional lattices that move the custom parts when a parameter does, which an unrigged custom part otherwise does not: `{ targets, meshes? }` (`RigBakes` in `@ikijs/editor`; it needs `customParts` and names no other part). A target `{ id?, param, parts, box?, grid: { cols, rows }, stops, mirror?, why? }` is `(cols + 1) x (rows + 1)` control points laid evenly over `box` (canvas px; absent, the union of the parts' rest boxes grown by 2 px), listed row-major from the top-left, with a `[dx, dy]` per point at each stop. Every position and displacement is in canvas px, origin top-left, y down. A stop is the part's TOTAL landed displacement from rest when `param` alone is at that value and every other parameter is at its default, so the head's own carry is inside it and a neighbour's displacement as `probe_rig` measures it is written as it is. Stop keys are values of `param` inside its range, never its default. The landing is exact at rest, at each stop and at one end key the rig writes at the range end on a side whose outermost stop is inside the range (it holds that stop's displacement); a side with no stop is not moved. Between two keys the part's offsets are blended linearly, so under the head's roll the path bows off the line (about 1 px midway over 15°): put a stop where the path matters. Each vertex takes the bilinear value of the lattice at its rest position, and a vertex outside `box` takes the nearest edge's value. `mirror: true` fills a missing stop from the one at the mirrored value, when that value is inside the parameter's range (the lattice reflected about the box's vertical centre line, `dx` negated). Targets that name the same part and parameter sum. `meshes` re-meshes a custom part first (`{ rows, cols }` or `{ cellPx }`). The written model is landed through the engine at every stop and at the range end each side holds its outermost stop to, and compared with the displacement the generator was asked for; a stop off by 0.1 px or more is `INVALID: BAKE ERROR <part> <param>=<value>: …`, and a part the bake moves at rest by as much is `INVALID: BAKE ERROR <part> at rest: …`; both mean the rig and the engine disagree (a bug in the packages, not in the input), and nothing is written, and an input the rig refuses is `INVALID: bakes…` with its path (`bakes.targets[2].stops["30"][7]`), nothing written either. Needs 0.34.0.
|
|
35
|
-
- **The custom gate** — whenever `customParts` is passed the written model is also measured, per custom part, over a pose set: the engine's fold poses, each of the part's own stops alone, and for every pair of parameters it is baked on every combination of their stops. Lengths are in face widths (the `face` part's width), so no limit is tied to one canvas; the values are the experiment's over a 402 px face. Lines: `FOLDS` (the part's least triangle area ratio, ≥ 0.1, the engine's collapse); `TIE` (at the tie and a ring around it (5 px on a 402 px face, scaled with the face width), the part's displacement less the anchor's, the largest over the poses where `ParamAngleX` is at its default, ≤ 0.005); `SLIDE` (the same length over the poses that turn the head, ≤ 0.1; and the distance from where the part lands its tie to the nearest painted point of the anchor as the anchor lands it, ≤ 0.015); `EXPOSED` (the canvas pixels within 0.15 face widths of the tie that the part and its anchor both paint: of the two, the one drawn below has art the other hides at rest; at a pose each such pixel is landed through the lower part and counted as showing when no painted point of the upper one lands there; the largest count over the poses where the head does not turn, ≤ 0.0009 face widths², with the largest over the poses that turn it printed beside it, reported and not limited, since a tie allowed to slide uncovers what lies under it;
|
|
35
|
+
- **The custom gate** — whenever `customParts` is passed the written model is also measured, per custom part, over a pose set: the engine's fold poses, each of the part's own stops alone, and for every pair of parameters it is baked on every combination of their stops (the stops of a part's `occlusion` on its key parameter count as its stops here). Lengths are in face widths (the `face` part's width), so no limit is tied to one canvas; the values are the experiment's over a 402 px face. Lines: `FOLDS` (the part's least triangle area ratio, ≥ 0.1, the engine's collapse); `TIE` (at the tie and a ring around it (5 px on a 402 px face, scaled with the face width), the part's displacement less the anchor's, the largest over the poses where `ParamAngleX` is at its default, ≤ 0.005); `SLIDE` (the same length over the poses that turn the head, ≤ 0.1; and the distance from where the part lands its tie to the nearest painted point of the anchor as the anchor lands it, ≤ 0.015); `EXPOSED` (the canvas pixels within 0.15 face widths of the tie that the part and its anchor both paint: of the two, the one drawn below has art the other hides at rest; at a pose each such pixel is landed through the lower part and counted as showing when no painted point of the upper one lands there; the largest count over the poses where the head does not turn, ≤ 0.0009 face widths², with the largest over the poses that turn it printed beside it, reported and not limited, since a tie allowed to slide uncovers what lies under it; draw order is the model's one `order` per part, so only the pair is read, and cover from any other part does not count unless the part declares an occlusion, below; rest counts 0); `RIGID` (rigid parts only: the least-squares rigid residual of the landed vertices against rest, over the pose set and the midpoint of each neighbouring pair of the part's stops, ≤ 0.0025); `HIDDEN` (only for a part that declares `occlusion`: the occluders, which of them give cover, the key parameter, the amount at rest, where the amount leaves its rest value and where it first reaches 1 on each side of the parameter's default, and how many of the part's poses `TIE` and `SLIDE` left out; reported, no limit, printed after `EXPOSED`); and `TIP` (per baked parameter, at the parameter's ends: where the part's free end lands, where it lands with the part's warps removed, the distance between and the travel end to end; reported, no limit). **What an occlusion excuses.** The gate excuses a reading only where it can establish that the player hides what the reading measures, and keeps the check everywhere else. Cover is an occluder's layer paint as that occluder lands at the pose, and only from an occluder the player draws at full alpha in every pose: colour alpha 1, no transform opacity under 1 and no `opacity` binding, so `mouth_open`, a blush and a pose forearm give none. A pose is left out only when the part is fully hidden across the stretches to the neighbouring sampled values of the key parameter on both sides (the amount is 1 at the pose, at both neighbours and at every occlusion stop between them; the sampled values are the ones the part's pose set takes, the default, its bake stops and its occlusion's stops included): a reading between two samples is bounded by the readings at its ends, so a stretch where the part is drawn keeps both poses it bounds in. For a left-out pose, `TIE` and `SLIDE` leave it out when every ring point lies on the part's mesh and under cover (it is then not counted among `SLIDE`'s turning poses; a line whose every pose is left out says so); `EXPOSED` does not count a hidden-art pixel whose landed spot is under cover, and counts every other pixel as before. An amount under 1 is judged in full, and so is a part whose tie is not under cover. `FOLDS`, `RIGID` and `TIP` read every pose, and the occlusion's stops are sampled like bake stops, so a bake key at one changes no verdict. Each line gives the worst value in px and face widths and its pose, then `pass` or `FAIL: <reason>`; the text ends with `CUSTOM GATE pass` or `CUSTOM GATE FAIL: <part LINE, …>`, always the text's last line. `FOLDS`, `TIE`, `SLIDE`, `EXPOSED` and `RIGID` each fail the gate, `TIP` never does; a tie no ring point of which lies on both the part and its anchor fails `TIE` with that reason. The model is written either way, and the folds and physics reports for the rest of the model stay report-only. `HIDDEN` needs 0.35.0. Needs 0.34.0: from then on `customParts` always carries `gate`, so a result without `customParts` is from an older server and was never gated. A gate that throws still writes the file and returns the path, with `gate.ok` false, `gate.failed` `["gate error: <message>"]` and the text ending `CUSTOM GATE FAIL: gate error: <message>`.
|
|
36
36
|
- **Result** — on success the result text is the written file path, then one `RIGPLAN: turn.amount=1 …` line (every plan field's effective value, each annotated with `(requested …, clamped at …)` where the art's room cut it or `(fitted by turnTargets.…)` where a cue fitted it), then one `PATCH <i> <target> at <Param=v …>: <moved> of <of> points (cols a-b, rows c-d), largest move <maxPx> model px` line per patch op (`(vertices)` in place of the columns and rows for a mesh part), then the rig's fold report lines and its `PHYSICS` lines (as `render_poses` prints them), then, with side locks and a `nose` (which `turn` needs), the `HAIRSIDE` lines, then one `CUSTOM <id>: box x,y WxH px, mesh N vertices M triangles, order O, atlas page P` line per custom part, then, with `bakes`, one `BAKE <part> <param>: N vertices, stops …, error E px` line per part and parameter (E: the engine's landing against the asked displacement, under 0.1 px; carried as `customParts.bakes`), then, with `customParts`, the custom gate's `CUSTOM <id> <LINE>: …` lines and `CUSTOM GATE pass` or `CUSTOM GATE FAIL: …` last (carried as `customParts.gate`: `ok`, `limits`, `parts` with each measure, `failed`), and `structuredContent` carries `{ ok: true, path, canvas, partCount, atlasBytes, headHalfWidth?, headHalfWidthApplied, headEdges?, strandEdges?, noseCore?, turn?, patches?, folds, physics, rigPlan, customParts? }`. `rigPlan` is `{ requested, effective, clamped, overriddenBy }` — the plan as passed, every field's value the rig built with, the plan-owned fields the room cut (`{ field, bound }`) and the fields a `turnTargets` cue fitted instead (path to cue); it is always present on a rigged model, and a result without it comes from a server before 0.30.0. `patches` is what each op moved (`index`, `target`, `at`, `moved`, `of`, `cols`/`rows` for a grid, `maxPx`) and is present whenever `patches` was passed, `[]` included. `customParts` is `{ parts, bakes?, gate }`, each part `{ id, box, mesh: { vertices, triangles }, order, page }` (`box` the layer's alpha box in canvas px, `page` the last atlas page), present whenever `customParts` was passed, `[]` included; `bakes` (`{ part, param, vertices, stops, errorPx }` per baked part and parameter) is present only when `bakes` was passed. `atlasBytes` is the embedded atlas's data-URI length, summed over every page: the nose's own, when it has one, and the custom parts' page. `headHalfWidth` is the head measured here rather than asked for: the layers' own opaque union at the eye row, under the same `alpha >= 128` rule and ±10-row band `measure_turn_reference` spans a render with, so the rig's own rest render measures that span back; it is **absent** when that union has no span there at all (translucent art painted below alpha 128 — still a valid layer set, just with nothing to measure). `headHalfWidthApplied` is `false` when the measured value is absent, or no wider than the face plate (a hairless set, or one widest at the plate itself) — the generator will not take such a head, so the plate stands in for it and the rig is still produced either way. `headEdges` is a companion to a measured, applied `headHalfWidth` (absent otherwise): every role with an opaque pixel in that same eye-row band, per side, each with its own rest x there — passed straight to the generator's own `options.headEdges` so it can tell which part's own deformation actually carries the union's outermost pixel through the turn. `strandEdges` is each side's iris and the `hair_front` run it would slide under on the turn, measured whenever the layers include `hair_front`, `iris_L` and `iris_R`: the iris's opaque span and the run's outer and face-side ends as pixel edges on the row holding the iris's centre (a run that reaches the other iris's centre, a fringe spanning the face, has `runFace: null`; a run narrower than half the iris's painted width on that row is hair detail the iris may cross, and is skipped as if clear) — passed straight to the generator's own `options.strandEdges`, which keeps the far iris from sliding under the bangs any further than it is painted. `turn` is what the solve settled on — `{ radius, holdBase, depths, achieved: { eyeShift, farEyeRatio, silhouetteRatio }, clamped, strandOverlap? }`, where `achieved` is what the rig does reach and `clamped` names every target the rig cut down: the turn (`eyeShift`, passed or the profile's own) where the face plate's edge or the strand cut it short, and a profile `noseShift` / `mouthShift` past its room. `strandOverlap` gives, per side whose far iris the bangs still cover at some far stop, the covered width — how much of the iris's painted row the run covers where that is largest (`deg`, `px`, and `hh` in head half-widths), how much it covers at rest (`restPx`), and whether the bound held (`held`: `true` means the iris is kept no deeper under the run than it is painted; `false` means the art left no room to — always so for a fringe spanning the face — and `px` is what stays covered); it is absent when nothing is covered. `noseCore` is the nose's dense core in canvas px — its pixels at alpha >= 128, not grown, the box handed to the generator as the nose layer's `denseCore` and its turn landmark — absent without a `nose` layer, when it has no pixel at that threshold (painted wholly translucent), or when that core is a speck of the nose's crop (under a quarter of its width or height, such as a lone nostril mark), and in both of the last two cases the crop stands in for it. `hairSide` (inside `turn`, present only with a side lock) is `{ left?, right? }` by screen side — `left` the lock at −x (`hair_side_R`), `right` at +x — each `{ role, cover?, tail?, unavailable? }`, report-only, measured as the far lock at its side's far stops (−15 and −30 on the left, 15 and 30 on the right), px, every x landed through the rendered rig: `cover` is `{ deg, px, y, rest }`, the least over the lock's rows on the face plate that cover the head's edge at rest (a root under the bangs, or the rows an ear shows beside the lock, lie inside it by design and do not count) and over the far stops of the lock's outer edge minus the head's edge (the plate's painted edge, with any ear replaced by the head's edge beneath it, so an ear does not count as cheek the lock covers), positive still covering it and negative the turn baring cheek the lock hides at rest, `rest` that row's cover at rest (≥ 0, read off the geometry; `px` may exceed it), `y` the row where it is least in model space (the canvas centre the origin, +y up — the line also gives it as model px from the top, the row of the layer PNG); `tail` is `{ deg, eyeToLock, lashToLock?, eyeToPlate }` for the far eye's outer corner on the eye's centre row at the stop where `eyeToLock` is least — the corner against the lock's face-side edge, positive a gap and negative under the lock (intended), `lashToLock` the same for the lash box with a `lash_*` layer, and `eyeToPlate` the corner's signed distance from that head edge (positive: inside it; negative: past it). A metric that cannot be read is omitted; a lock measured without `rowRuns` (never the case through this tool) carries `unavailable` (a reason) and nothing else. The result text prints them as `HAIRSIDE cover <role>: …` / `HAIRSIDE tail <role>: …` lines, one per metric present, the lock named by its role (`hair_side_R` hangs on the screen left), the pose as the setting that reproduces it (`ParamAngleX=-30`) and every edge distance signed to one decimal in model px (`+0.0` for zero); a lock with neither prints `HAIRSIDE <role>: no cover or tail row`, one carrying `unavailable` prints `HAIRSIDE <role>: unavailable — <why>`; a set with no side lock prints none. `turn` is absent without a `nose` layer. `folds` is the written model's fold report, the engine's `checkFolds` over its own pose set (`{ poses, thresholds, targets, offenders }`, described under `render_poses`); it never refuses a rig — a model that folds is still written and returned — and each fold names its pose by its parameter settings, which a host reproduces by setting those parameters on a player (`IkiPlayer.setParameter`). `physics` is the written model's physics report, the engine's `checkPhysics` over its rigs (`{ thresholds, targets, offenders }`, described under `render_poses`) — the hair springs a `hair_front` layer brings (two for the front hair and, with `hair_back`, one for the back), or none — and never refuses a rig either. The (potentially multi-MB) model is written to disk, not inlined. Invalid input (a `patches` op the rig refuses — `INVALID: patches[i]…`, naming the stops, targets or roles there are; unknown/missing role, an arm without a `body`, empty layer, mismatched sizes, bad path, an atlas page over 4096 px on a side, or an atlas over 12 MiB; art the rig cannot build on, such as a body's hips with no room under its pivots for a row line or for the body's motion, or an arm too short to hang an elbow under its shoulder; a `turnTargets` field that is unknown or that this layer set cannot reach — any passed field other than an `eyeShift` past the art's room; a `rigPlan` field out of range or unknown, or the removed `style` input; the message names the field and the attainable range) returns `{ ok: false, error }` with a `INVALID: …` text — not a protocol error. An argument the tool's input schema refuses — a `turnTargets` or `rigPlan` that is not an object, or one of their named fields that is not a number — never reaches the tool: the MCP SDK answers with an `isError` result whose text is `MCP error -32602: Input validation error: …`, and no `structuredContent`.
|
|
37
37
|
|
|
38
38
|
The decode/atlas pipeline runs in Node via `sharp` (a native dependency confined to this package); it mirrors the browser editor app's import flow and reuses the pure `@ikijs/editor` model + atlas math, so both paths produce the same rig. The fold and physics checks run the workspace `@ikijs/engine`, inlined into this package's Node build (as it already is into the `render_poses` page script), while `@ikijs/format` stays an external dependency.
|
|
@@ -90,7 +90,7 @@ Renders a rigged `.iki` into the pose PNGs the character loop reviews, with the
|
|
|
90
90
|
- **`poses`** — optional caller-named poses rendered instead of the standard set, each `{ name, values, crop? }`: `name` becomes `<outDir>/<name>.png` (letters, digits, `_`, `.`, `-`; unique ignoring case), `values` are parameter settings (the rest at their defaults), and `crop` `{ x, y, w, h }` is a rectangle in model px from the top-left — the frame of `describe_iki`'s boxes and the `FOLD` lines — clamped to the canvas and drawn 720 px wide (an empty list, a bad or repeated name, a non-finite value, or a crop that misses the canvas or would draw under 1 or over 8192 px tall is `INVALID: poses…`; a parameter id the model lacks is ignored). Each pose is also added to the fold sweep, after the engine's own poses.
|
|
91
91
|
- **`sweep`** — optional `{ name, preset: "turn", crop? }`, rendered in addition to the poses: `ParamAngleX` eased 0 → −30 → +30 → 0 over 3 s (sinusoidal, so it never pauses at a stop and crosses 0 at its top speed), at 30 fps on a 60 Hz clock, with the hair physics running through `IkiMotion` and the idle, clips and expressions off (only the physics outputs reach the player), every other parameter at its default, after a 0.5 s warm-up at rest. The frames share one fixed framing: `crop` (model px, as a pose's) or the standard shots. `name` becomes the directory `<outDir>/<name>/` — it starts with a letter or digit, then letters, digits, `_`, `.`, `-`; the tool creates it, refuses a symbolic link or a non-directory there; every run clears the dir's earlier `fNNN.png`, `sheet.png`, `kymograph.png`, `manifest.json` and `index.html` (by name, nothing else) before writing, so the dir is always this run's sweep. Written: `fNNN.png` (90 frames), `manifest.json` (version 2: `parameters`, and per frame `i`, `file`, `t` and `values`, the effective value of every scripted parameter and every physics output), `sheet.png` (nine frames of the −30 → +30 leg, chronological in a 3 × 3 grid, labelled with angle and time only, at most 2000 px a side), `kymograph.png` (the eye row of every frame, three px each, stacked in time: a bend at the centre is a kink, a trailing curve the hair's lag) and `index.html` (a flipbook that opens from disk; `?b=<relative dir of another sweep>` plays two side by side). A sweep adds about 4–5 s on a bust (measured on the corpus characters). A server before 0.31.0 strips `sweep` and renders the stills alone.
|
|
92
92
|
- **`sweeps`** — optional list of more sweeps rendered after `sweep`, each `{ name, preset: "turn" | "turn-nod" | "roll", crop? }` into its own `<outDir>/<name>/` with its own manifest, sheet and flipbook; an uncropped entry is framed like `sweep` (the standard shots, the middle square on a full body). Names are distinct from `sweep`'s and each other's ignoring case and presets are distinct, so there is at most one of each (an empty list, a repeat or a bad crop is `INVALID: sweeps…`). `turn` is `sweep`'s preset. `turn-nod` is the box (0,0) → (0,−30) → (−30,−30) → (−30,+30) → (+30,+30) → (+30,−30) → (0,−30) → (0,0) of `ParamAngleX` × `ParamAngleY` through all eight non-rest grid stops, each leg eased by a half-cosine (so every corner is held at zero speed), at 50°/s: 6 s, 180 frames at 30 fps, with the hair physics running and the idle off. Every stop lands exactly on a captured frame (f018 (0,−30), f036 (−30,−30), f054 (−30,0), f072 (−30,+30), f090 (0,+30), f108 (+30,+30), f126 (+30,0), f144 (+30,−30)). Its `sheet.png` is a 3 × 3 grid BY ANGLE — columns AngleX −30/0/+30, rows AngleY +30/0/−30, rest in the centre, cells labelled `X`, `Y` and `t` only — so a column is the nod at one turn; it has no kymograph (a fixed eye row stops showing the eyes on a nod). `roll` is the turn's eased curve (0 → −30 → +30 → 0 over 3 s, 90 frames) on `ParamAngleZ`, with the hair physics running and the idle off; its `sheet.png` is the nine frames nearest the turn sheet's angles on the −30 → +30 leg, cells labelled `Z` and `t`, and it has no kymograph (the eye row moves with the roll). It goes through `sweeps` only (`sweep` stays `turn`), and a roll adds no `SWEEP` line of its own and changes none (the lines are read from the model). A `turn-nod` sweep adds about 9 s, twice a `turn`'s, and the two face-cropped together (a `turn` and a `turn-nod` in one call) about 14–16 s, measured on the corpus characters. A server before 0.32.0 strips `sweeps` and renders the rest; a server before 0.31.0 still strips `sweep`.
|
|
93
|
-
- **`hideParts`** — optional part ids left out of the drawn frames of the call, poses and sweeps alike: the page is handed the model without them, while the fold, physics and sweep reports still read the whole model. It renders a character without its custom parts, so `measure_turn_reference` reads the rig's own head (a custom part crossing the eye row widens the head it measures, as it does on a drawn reference). An id the model lacks, or one that is the clip mask of a part that stays, is `INVALID: hideParts[i]
|
|
93
|
+
- **`hideParts`** — optional part ids left out of the drawn frames of the call, poses and sweeps alike: the page is handed the model without them, while the fold, physics and sweep reports still read the whole model. It renders a character without its custom parts, so `measure_turn_reference` reads the rig's own head (a custom part crossing the eye row widens the head it measures, as it does on a drawn reference). An id the model lacks, or one that is the clip mask of a part that stays, or one a part that stays names in its `occlusion.by`, is `INVALID: hideParts[i] …` (hide both). A server before 0.34.0 strips it and draws every part.
|
|
94
94
|
- **What is written** — the model decides the set. A bust gets 560 × 560 shots: `rest`, `turn-m30`, `turn-p30`, `turn-15`, `nod-15`, `blink`, `blink-half`, `gaze`, `combined` (`ParamAngleX`/`Y`/`Z` all at 30), `stress` (`ParamAngleX`/`Y`/`Z` all at −30, `ParamMouthOpenY` 1, `ParamEyeLOpen` and `ParamEyeROpen` 0.5, `ParamBrowLY` −1, `ParamBrowRY` 1, `ParamBrowLAngle` 1, `ParamBrowRAngle` −1, and each of `ParamBodyAngleX`/`Y`/`Z` the model declares at −10: moves that each look fine alone, stacked). A model with a `mouth` or `mouth_inner` adds 720 × 480 mouth crops (`mouth-open-*-form-*`, `mouth-laugh`, `mouth-surprised`, `mouth-turn-p30-half`). A full body (canvas taller than wide) shoots the same squares from the model's top (the head), centred horizontally, and adds whole-canvas `full-*` shots (body, arm and elbow poses) at 1400 px wide; one with a pose forearm (`ParamArmPoseR`) adds the `full-pose-*` shots.
|
|
95
95
|
- **Result** — the text is the written paths, one per line (then, with `sweep` and then each of `sweeps`, its directory, `sheet.png`, `kymograph.png` when it has one, `index.html` and `manifest.json`), then the model's fold report, then its physics report, then the `SWEEP` lines. `failedTextures` lists the atlas pages the engine could not load; their parts are missing from the renders. `structuredContent` is `{ ok: true, outDir, canvas, fullBody, mouth?, failedTextures, poses: [{ name, path }], modelCanvas, folds, physics, sweep?, sweeps? }`; `sweep` is `{ name, preset, dir, fps, frames, manifest, sheet, kymograph?, flipbook, report, nod }` (`kymograph` absent for `turn-nod` and `roll`), and `sweeps` is a list of objects of that same shape, in request order, absent from a server before 0.32.0. A missing model, an `outDir` that is missing or outside the working directory, or a file that is not a valid model returns `{ ok: false, error }` with `INVALID: …` text.
|
|
96
96
|
- **Folds** — `folds` is the engine's `checkFolds` over its own pose set (`foldPoses`: rest, each parameter alone at its min and max, and the corners of the head and body angles crossed with the eyes, the mouth, the arms and the elbows), not over the rendered shots: `{ poses, thresholds: { flip: 0, collapse: 0.1 }, targets, offenders }`, one target per warp deformer (its grid cells) and per mesh part (its triangles), each `{ target: { kind, id }, kind, worst?, expected? }`: `worst` and `expected` are the least ratio of an area at a pose to the same at rest over the poses that are not, and that are, a by-design closure (below), each with its cell or triangle, its pose and its rest point; `kind` (`flip`, `collapse` or `ok`) is read off `worst` alone, and `offenders` are the targets that are not `ok`. The text prints one `FOLD` line per offender, worst first — `flip` (ratio ≤ 0) or `collapse` (under 0.1), `deformer` or `part`, its id, `cell (col,row)` or `triangle i`, the ratio (two significant figures under 0.01, so a flip never reads `-0.00`), the pose in brackets as its sorted `id=value` settings (`rest` for none), and where it sits at rest in model space and in model px from the top-left of `modelCanvas` (the layer PNGs' own pixels, not a render's) — or `FOLDS: none over N poses`. Then, when one folds, a `FOLDS expected:` line names the closures the auto-rig draws on purpose, each by part id, ratio and the parameter that shuts it: `eye_L` and `lash_lower_L` while `ParamEyeLOpen` is 0, `eye_R` and `lash_lower_R` while `ParamEyeROpen` is 0, and the lip set (`mouth_inner`, `mouth_tongue`, `mouth_teeth`, `lip_lower`, `lip_upper`) while `ParamMouthOpenY` is 0, read as each pose's effective value, its default included. The sweep covers the engine's pose set plus the caller's `poses`; a caller's pose is named in the `FOLD` lines by its sorted `id=value` settings (`rest` when empty), never by its PNG name, so a host reproduces any fold by setting those parameters on a player. Report-only: a fold never fails the render.
|
|
@@ -413,6 +413,22 @@ function resolveDeformers(deformers, params) {
|
|
|
413
413
|
return { worlds, grids };
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
// ../engine/src/occlusion.ts
|
|
417
|
+
function occlusionAmount(occlusion, value) {
|
|
418
|
+
const { stops } = occlusion;
|
|
419
|
+
const first = stops[0];
|
|
420
|
+
if (value <= first.value) return first.amount;
|
|
421
|
+
for (let i = 1; i < stops.length; i++) {
|
|
422
|
+
const hi = stops[i];
|
|
423
|
+
if (value <= hi.value) {
|
|
424
|
+
const lo = stops[i - 1];
|
|
425
|
+
const t = (value - lo.value) / (hi.value - lo.value);
|
|
426
|
+
return lo.amount * (1 - t) + hi.amount * t;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return stops[stops.length - 1].amount;
|
|
430
|
+
}
|
|
431
|
+
|
|
416
432
|
// ../engine/src/idle-motion.ts
|
|
417
433
|
import { StandardParameter } from "@ikijs/format";
|
|
418
434
|
|
|
@@ -2260,6 +2276,49 @@ function triangleGrid(posed, indices, bounds) {
|
|
|
2260
2276
|
Math.floor((x - bounds.x0) / cell) + Math.floor((y - bounds.y0) / cell) * cols
|
|
2261
2277
|
) ?? [];
|
|
2262
2278
|
}
|
|
2279
|
+
function paintedUnder(posed, mesh, paint, points) {
|
|
2280
|
+
if (points.length === 0) return [];
|
|
2281
|
+
const bounds = { x0: Infinity, y0: Infinity, x1: -Infinity, y1: -Infinity };
|
|
2282
|
+
for (const [x, y] of points) {
|
|
2283
|
+
bounds.x0 = Math.min(bounds.x0, x);
|
|
2284
|
+
bounds.y0 = Math.min(bounds.y0, y);
|
|
2285
|
+
bounds.x1 = Math.max(bounds.x1, x);
|
|
2286
|
+
bounds.y1 = Math.max(bounds.y1, y);
|
|
2287
|
+
}
|
|
2288
|
+
const find = triangleGrid(posed, mesh.indices, bounds);
|
|
2289
|
+
return points.map(([x, y]) => {
|
|
2290
|
+
for (const t of find(x, y)) {
|
|
2291
|
+
const tri = [
|
|
2292
|
+
mesh.indices[t * 3],
|
|
2293
|
+
mesh.indices[t * 3 + 1],
|
|
2294
|
+
mesh.indices[t * 3 + 2]
|
|
2295
|
+
];
|
|
2296
|
+
const w = locate(posed, tri, x, y);
|
|
2297
|
+
if (!w) continue;
|
|
2298
|
+
let rx = 0;
|
|
2299
|
+
let ry = 0;
|
|
2300
|
+
for (let k = 0; k < 3; k++) {
|
|
2301
|
+
rx += w[k] * mesh.rest[tri[k] * 2];
|
|
2302
|
+
ry += w[k] * mesh.rest[tri[k] * 2 + 1];
|
|
2303
|
+
}
|
|
2304
|
+
return paintedAt(paint, rx, ry);
|
|
2305
|
+
}
|
|
2306
|
+
return false;
|
|
2307
|
+
});
|
|
2308
|
+
}
|
|
2309
|
+
function hiddenSide(occlusion, from, direction) {
|
|
2310
|
+
const at = (v) => occlusionAmount(occlusion, v);
|
|
2311
|
+
const rest = at(from);
|
|
2312
|
+
const marks = occlusion.stops.map((s) => s.value).filter((v) => (v - from) * direction > 0).sort((a, b) => (a - b) * direction);
|
|
2313
|
+
const run2 = [from, ...marks];
|
|
2314
|
+
let leaves = null;
|
|
2315
|
+
let full = rest === 1 ? from : null;
|
|
2316
|
+
for (let i = 0; i + 1 < run2.length; i++) {
|
|
2317
|
+
if (leaves === null && at(run2[i + 1]) !== rest) leaves = run2[i];
|
|
2318
|
+
if (full === null && at(run2[i + 1]) === 1) full = run2[i + 1];
|
|
2319
|
+
}
|
|
2320
|
+
return { leaves, full };
|
|
2321
|
+
}
|
|
2263
2322
|
function posesOf(model, baked, base) {
|
|
2264
2323
|
const byName = new Map(base.map((p) => [p.name, p]));
|
|
2265
2324
|
const add = (values) => {
|
|
@@ -2332,7 +2391,16 @@ function checkCustomGate(model, parts, paints, options = {}) {
|
|
|
2332
2391
|
if (!model.parts.some((p) => p.id === part.id)) {
|
|
2333
2392
|
throw new Error(`custom gate: the model has no part "${part.id}"`);
|
|
2334
2393
|
}
|
|
2335
|
-
|
|
2394
|
+
if (options.poses) return options.poses;
|
|
2395
|
+
const sampledOf = bakedOf(part.id);
|
|
2396
|
+
const occ = model.parts.find((p) => p.id === part.id).occlusion;
|
|
2397
|
+
if (occ !== void 0) {
|
|
2398
|
+
const at = sampledOf.get(occ.parameter) ?? [];
|
|
2399
|
+
sampledOf.set(occ.parameter, [
|
|
2400
|
+
.../* @__PURE__ */ new Set([...at, ...occ.stops.map((s) => s.value)])
|
|
2401
|
+
]);
|
|
2402
|
+
}
|
|
2403
|
+
return posesOf(model, sampledOf, base);
|
|
2336
2404
|
});
|
|
2337
2405
|
const all = new Map(poseSets.flat().map((p) => [p.name, p]));
|
|
2338
2406
|
const reports = parts.map((part, n) => {
|
|
@@ -2417,6 +2485,45 @@ function checkCustomGate(model, parts, paints, options = {}) {
|
|
|
2417
2485
|
const hiddenOn = locatePoints(lowerMesh, hidden).filter(
|
|
2418
2486
|
(l, i) => l !== null && onAnchorMesh[i] !== null
|
|
2419
2487
|
);
|
|
2488
|
+
const occlusion = ownPart.occlusion;
|
|
2489
|
+
const coverParts = [];
|
|
2490
|
+
if (occlusion !== void 0) {
|
|
2491
|
+
for (const role of part.occludedBy ?? []) {
|
|
2492
|
+
for (const id of partIdsOfRole(role)) {
|
|
2493
|
+
const o = model.parts.find((p) => p.id === id);
|
|
2494
|
+
if (o === void 0 || !occlusion.by.includes(id)) continue;
|
|
2495
|
+
const steady = o.color[3] === 1 && (o.transform.opacity ?? 1) >= 1 && !(o.bindings ?? []).some((b) => b.channel === "opacity");
|
|
2496
|
+
if (!steady) continue;
|
|
2497
|
+
const paint = paints.get(role);
|
|
2498
|
+
if (paint === void 0) {
|
|
2499
|
+
throw new Error(`custom gate: no paint for "${role}"`);
|
|
2500
|
+
}
|
|
2501
|
+
coverParts.push({ id, mesh: restMesh(model, cache, id), paint });
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
const coverIds = new Set(coverParts.map((c) => c.id));
|
|
2506
|
+
const keyParam = occlusion === void 0 ? void 0 : model.parameters.find((p) => p.id === occlusion.parameter);
|
|
2507
|
+
const keyOf = (values) => Math.min(
|
|
2508
|
+
keyParam.max,
|
|
2509
|
+
Math.max(keyParam.min, values[keyParam.id] ?? keyParam.default)
|
|
2510
|
+
);
|
|
2511
|
+
const sampled = keyParam === void 0 ? [] : [
|
|
2512
|
+
.../* @__PURE__ */ new Set([
|
|
2513
|
+
keyParam.default,
|
|
2514
|
+
...poses.map((p) => keyOf(p.values))
|
|
2515
|
+
])
|
|
2516
|
+
].sort((a, b) => a - b);
|
|
2517
|
+
const fullyHidden = (lo, hi) => occlusion.stops.every(
|
|
2518
|
+
(st) => st.value <= lo || st.value >= hi || st.amount === 1
|
|
2519
|
+
) && occlusionAmount(occlusion, lo) === 1 && occlusionAmount(occlusion, hi) === 1;
|
|
2520
|
+
const hiddenAt = (v) => fullyHidden(
|
|
2521
|
+
sampled.filter((x) => x < v).at(-1) ?? v,
|
|
2522
|
+
sampled.find((x) => x > v) ?? v
|
|
2523
|
+
);
|
|
2524
|
+
let leftOut = 0;
|
|
2525
|
+
let leftOutTurning = 0;
|
|
2526
|
+
let readNoTurn = 0;
|
|
2420
2527
|
const stops = bakedOf(part.id);
|
|
2421
2528
|
const worstOf = {
|
|
2422
2529
|
tie: { v: -1, pose: "rest" },
|
|
@@ -2445,21 +2552,54 @@ function checkCustomGate(model, parts, paints, options = {}) {
|
|
|
2445
2552
|
keep(worstOf.rigid, rigidResidual(restPoints, moved), pose.name);
|
|
2446
2553
|
};
|
|
2447
2554
|
for (const pose of poses) {
|
|
2448
|
-
const
|
|
2555
|
+
const hiding = occlusion !== void 0 && hiddenAt(keyOf(pose.values));
|
|
2556
|
+
const landed = landParts(model, pose.values, [
|
|
2557
|
+
.../* @__PURE__ */ new Set([
|
|
2558
|
+
part.id,
|
|
2559
|
+
anchorId,
|
|
2560
|
+
...hiding && coverIds.size > 0 ? coverIds : []
|
|
2561
|
+
])
|
|
2562
|
+
]);
|
|
2449
2563
|
const partPosed = toCanvas(model, landed.get(part.id));
|
|
2450
2564
|
const anchorPosed = toCanvas(model, landed.get(anchorId));
|
|
2565
|
+
const canvasOf = /* @__PURE__ */ new Map();
|
|
2566
|
+
const underCover = (points, skip) => {
|
|
2567
|
+
const covered = points.map(() => false);
|
|
2568
|
+
if (!hiding) return covered;
|
|
2569
|
+
for (const c of coverParts) {
|
|
2570
|
+
if (c.id === skip) continue;
|
|
2571
|
+
let posed = canvasOf.get(c.id);
|
|
2572
|
+
if (posed === void 0) {
|
|
2573
|
+
posed = toCanvas(model, landed.get(c.id));
|
|
2574
|
+
canvasOf.set(c.id, posed);
|
|
2575
|
+
}
|
|
2576
|
+
const under = paintedUnder(posed, c.mesh, c.paint, points);
|
|
2577
|
+
under.forEach((u, i) => {
|
|
2578
|
+
if (u) covered[i] = true;
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
return covered;
|
|
2582
|
+
};
|
|
2451
2583
|
const turning = turns(pose);
|
|
2452
|
-
|
|
2584
|
+
const ringLands = onPart.map(
|
|
2585
|
+
(l) => l === null ? null : landLocated(partPosed, l)
|
|
2586
|
+
);
|
|
2587
|
+
const ringHidden = hiding && ringLands.every((p) => p !== null) && underCover(ringLands).every(Boolean);
|
|
2588
|
+
if (ringHidden) {
|
|
2589
|
+
leftOut++;
|
|
2590
|
+
if (turning) leftOutTurning++;
|
|
2591
|
+
} else if (turning) turningPoses++;
|
|
2592
|
+
else readNoTurn++;
|
|
2453
2593
|
let gap = 0;
|
|
2454
2594
|
for (const i of shared) {
|
|
2455
2595
|
const a = landLocated(partPosed, onPart[i]);
|
|
2456
2596
|
const b = landLocated(anchorPosed, onAnchor[i]);
|
|
2457
2597
|
gap = Math.max(gap, Math.hypot(a[0] - b[0], a[1] - b[1]));
|
|
2458
2598
|
}
|
|
2459
|
-
if (shared.length > 0) {
|
|
2599
|
+
if (shared.length > 0 && !ringHidden) {
|
|
2460
2600
|
keep(turning ? worstOf.slide : worstOf.tie, gap, pose.name);
|
|
2461
2601
|
}
|
|
2462
|
-
if (turning) {
|
|
2602
|
+
if (turning && !ringHidden) {
|
|
2463
2603
|
const at = landLocated(partPosed, tieOnPart);
|
|
2464
2604
|
let nearest = null;
|
|
2465
2605
|
if (at !== null) {
|
|
@@ -2475,43 +2615,18 @@ function checkCustomGate(model, parts, paints, options = {}) {
|
|
|
2475
2615
|
if (hiddenOn.length > 0) {
|
|
2476
2616
|
const lowerPosed = lowerId === part.id ? partPosed : anchorPosed;
|
|
2477
2617
|
const upperPosed = upperId === part.id ? partPosed : anchorPosed;
|
|
2478
|
-
const upperIndices = upperMesh.indices;
|
|
2479
2618
|
const lands = hiddenOn.map((l) => landLocated(lowerPosed, l));
|
|
2480
|
-
const
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
bounds.x0 = Math.min(bounds.x0, x);
|
|
2488
|
-
bounds.y0 = Math.min(bounds.y0, y);
|
|
2489
|
-
bounds.x1 = Math.max(bounds.x1, x);
|
|
2490
|
-
bounds.y1 = Math.max(bounds.y1, y);
|
|
2491
|
-
}
|
|
2492
|
-
const find = triangleGrid(upperPosed, upperIndices, bounds);
|
|
2619
|
+
const underUpper = paintedUnder(
|
|
2620
|
+
upperPosed,
|
|
2621
|
+
upperMesh,
|
|
2622
|
+
upperPaint,
|
|
2623
|
+
lands
|
|
2624
|
+
);
|
|
2625
|
+
const underHider = coverIds.has(lowerId) ? lands.map(() => hiding) : underCover(lands, upperId);
|
|
2493
2626
|
let showing = 0;
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
const tri = [
|
|
2498
|
-
upperIndices[t * 3],
|
|
2499
|
-
upperIndices[t * 3 + 1],
|
|
2500
|
-
upperIndices[t * 3 + 2]
|
|
2501
|
-
];
|
|
2502
|
-
const w = locate(upperPosed, tri, at[0], at[1]);
|
|
2503
|
-
if (!w) continue;
|
|
2504
|
-
let rx = 0;
|
|
2505
|
-
let ry = 0;
|
|
2506
|
-
for (let k = 0; k < 3; k++) {
|
|
2507
|
-
rx += w[k] * upperMesh.rest[tri[k] * 2];
|
|
2508
|
-
ry += w[k] * upperMesh.rest[tri[k] * 2 + 1];
|
|
2509
|
-
}
|
|
2510
|
-
covered = paintedAt(upperPaint, rx, ry);
|
|
2511
|
-
break;
|
|
2512
|
-
}
|
|
2513
|
-
if (!covered) showing++;
|
|
2514
|
-
}
|
|
2627
|
+
lands.forEach((_, i) => {
|
|
2628
|
+
if (!underUpper[i] && !underHider[i]) showing++;
|
|
2629
|
+
});
|
|
2515
2630
|
keep(
|
|
2516
2631
|
turning ? worstOf.exposedTurn : worstOf.exposed,
|
|
2517
2632
|
showing,
|
|
@@ -2649,6 +2764,21 @@ function checkCustomGate(model, parts, paints, options = {}) {
|
|
|
2649
2764
|
},
|
|
2650
2765
|
...rigidReading === void 0 ? {} : { rigid: rigidReading },
|
|
2651
2766
|
tip,
|
|
2767
|
+
...occlusion === void 0 ? {} : {
|
|
2768
|
+
hidden: {
|
|
2769
|
+
by: occlusion.by,
|
|
2770
|
+
cover: [...coverIds],
|
|
2771
|
+
parameter: occlusion.parameter,
|
|
2772
|
+
default: keyParam.default,
|
|
2773
|
+
atRest: occlusionAmount(occlusion, keyParam.default),
|
|
2774
|
+
below: hiddenSide(occlusion, keyParam.default, -1),
|
|
2775
|
+
above: hiddenSide(occlusion, keyParam.default, 1),
|
|
2776
|
+
leftOut,
|
|
2777
|
+
leftOutTurning,
|
|
2778
|
+
readNoTurn,
|
|
2779
|
+
poses: poses.length
|
|
2780
|
+
}
|
|
2781
|
+
},
|
|
2652
2782
|
ok
|
|
2653
2783
|
};
|
|
2654
2784
|
});
|
|
@@ -2679,18 +2809,26 @@ function formatCustomGate(report) {
|
|
|
2679
2809
|
lines.push(
|
|
2680
2810
|
`${at} FOLDS: least triangle area ratio ${r.folds.ratio.toFixed(3)} at [${r.folds.pose}] (limit >= ${r.folds.limit}) ${verdict(r.folds.pass, r.folds.reason)}`
|
|
2681
2811
|
);
|
|
2812
|
+
const noTurnLeftOut = r.hidden !== void 0 && r.hidden.readNoTurn === 0 && r.hidden.leftOut > r.hidden.leftOutTurning;
|
|
2682
2813
|
lines.push(
|
|
2683
|
-
`${at} TIE: at the tie and the ring around it, ${r.id} against ${r.anchor}, poses that do not turn the head: max ${both(w, r.tie.px)} at [${r.tie.pose}] (limit <= ${limit(r.tie.limit)}) ${verdict(r.tie.pass, r.tie.reason)}`
|
|
2814
|
+
noTurnLeftOut ? `${at} TIE: every pose that does not turn the head is left out as hidden (see HIDDEN) ${verdict(r.tie.pass, r.tie.reason)}` : `${at} TIE: at the tie and the ring around it, ${r.id} against ${r.anchor}, poses that do not turn the head: max ${both(w, r.tie.px)} at [${r.tie.pose}] (limit <= ${limit(r.tie.limit)}) ${verdict(r.tie.pass, r.tie.reason)}`
|
|
2684
2815
|
);
|
|
2685
2816
|
const s = r.slide;
|
|
2686
2817
|
lines.push(
|
|
2687
|
-
s.turningPoses === 0 ? `${at} SLIDE: no pose turns the head pass` : `${at} SLIDE: poses that turn the head, the same length: max ${both(w, s.slide.px)} at [${s.slide.pose}] (limit <= ${limit(s.slide.limit)}); the tie's distance to the nearest painted point of ${r.anchor} as landed: max ${both(w, s.onAnchor.px)} at [${s.onAnchor.pose}] (limit <= ${limit(s.onAnchor.limit)}) ${verdict(s.pass, s.slide.pass ? s.onAnchor.reason : s.slide.reason)}`
|
|
2818
|
+
s.turningPoses === 0 ? r.hidden !== void 0 && r.hidden.leftOutTurning > 0 ? `${at} SLIDE: every pose that turns the head is left out as hidden (see HIDDEN) pass` : `${at} SLIDE: no pose turns the head pass` : `${at} SLIDE: poses that turn the head, the same length: max ${both(w, s.slide.px)} at [${s.slide.pose}] (limit <= ${limit(s.slide.limit)}); the tie's distance to the nearest painted point of ${r.anchor} as landed: max ${both(w, s.onAnchor.px)} at [${s.onAnchor.pose}] (limit <= ${limit(s.onAnchor.limit)}) ${verdict(s.pass, s.slide.pass ? s.onAnchor.reason : s.slide.reason)}`
|
|
2688
2819
|
);
|
|
2689
2820
|
const e = r.exposed;
|
|
2690
2821
|
const turnText = e.turning === null ? "no pose turns the head" : `max ${e.turning.px2.toFixed(0)} px\xB2 (${e.turning.value.toFixed(5)} face widths\xB2) at [${e.turning.pose}] (reported, no limit)`;
|
|
2691
2822
|
lines.push(
|
|
2692
2823
|
`${at} EXPOSED: ${e.hiddenPx} px of art both ${r.id} and ${r.anchor} paint near the tie, the lower one's hidden at rest; showing where the head does not turn: max ${(e.noTurn.px2 ?? 0).toFixed(0)} px\xB2 (${(e.noTurn.value ?? 0).toFixed(5)} face widths\xB2) at [${e.noTurn.pose}] (limit <= ${e.noTurn.limit} face widths\xB2, ${(e.noTurn.limit * w * w).toFixed(0)} px\xB2) ${verdict(e.pass, e.noTurn.reason)}; where it turns: ${turnText}`
|
|
2693
2824
|
);
|
|
2825
|
+
if (r.hidden) {
|
|
2826
|
+
const h = r.hidden;
|
|
2827
|
+
const side = (name, s2) => h.atRest === 1 ? `${name} ${h.default} the amount is 1 at rest and ${s2.leaves === null ? "stays 1" : `leaves it at ${s2.leaves}`}` : `${name} ${h.default} the amount ${s2.leaves === null ? `never leaves ${h.atRest}` : `leaves ${h.atRest} at ${s2.leaves}`} and ${s2.full === null ? "never reaches 1" : `reaches 1 at ${s2.full}`}`;
|
|
2828
|
+
lines.push(
|
|
2829
|
+
`${at} HIDDEN: hidden by ${h.by.join(",")} on ${h.parameter}, cover from ${h.cover.length === 0 ? "none of them" : h.cover.join(",")}${h.cover.length === h.by.length ? "" : " (the rest fade or are roles not passed, and give none)"}; amount ${h.atRest} at rest; ${side("below", h.below)}; ${side("above", h.above)}; left out of TIE and SLIDE: ${h.leftOut} of ${h.poses} poses (reported, no limit)`
|
|
2830
|
+
);
|
|
2831
|
+
}
|
|
2694
2832
|
if (r.rigid) {
|
|
2695
2833
|
lines.push(
|
|
2696
2834
|
`${at} RIGID: bend against rest: max ${both(w, r.rigid.px)} at [${r.rigid.pose}] (limit <= ${limit(r.rigid.limit)}) ${verdict(r.rigid.pass, r.rigid.reason)}`
|
|
@@ -3487,6 +3625,14 @@ function withoutParts(model, hideParts) {
|
|
|
3487
3625
|
`hideParts[${i}] ${JSON.stringify(id)} masks ${JSON.stringify(kept.id)}, which stays; hide ${JSON.stringify(kept.id)} too`
|
|
3488
3626
|
);
|
|
3489
3627
|
}
|
|
3628
|
+
const occluded = model.parts.find(
|
|
3629
|
+
(p) => !hidden.has(p.id) && p.occlusion?.by.includes(id)
|
|
3630
|
+
);
|
|
3631
|
+
if (occluded) {
|
|
3632
|
+
throw new AutoRigInputError(
|
|
3633
|
+
`hideParts[${i}] ${JSON.stringify(id)} occludes ${JSON.stringify(occluded.id)}, which stays; hide ${JSON.stringify(occluded.id)} too`
|
|
3634
|
+
);
|
|
3635
|
+
}
|
|
3490
3636
|
});
|
|
3491
3637
|
return { ...model, parts: model.parts.filter((p) => !hidden.has(p.id)) };
|
|
3492
3638
|
}
|
|
@@ -4460,7 +4606,9 @@ async function autoRigFromLayers(input) {
|
|
|
4460
4606
|
let measurer;
|
|
4461
4607
|
const crops = [];
|
|
4462
4608
|
const paints = /* @__PURE__ */ new Map();
|
|
4463
|
-
const anchorRoles = new Set(
|
|
4609
|
+
const anchorRoles = new Set(
|
|
4610
|
+
customEntries.flatMap((e) => [e.anchor, ...e.occlusion?.by ?? []])
|
|
4611
|
+
);
|
|
4464
4612
|
for (let i = 0; i < resolvedLayers.length; i++) {
|
|
4465
4613
|
const { resolved, fileName } = resolvedLayers[i];
|
|
4466
4614
|
const png = await decodePng(resolved);
|
|
@@ -4672,11 +4820,12 @@ async function autoRigFromLayers(input) {
|
|
|
4672
4820
|
try {
|
|
4673
4821
|
gate = checkCustomGate(
|
|
4674
4822
|
finalModel,
|
|
4675
|
-
customEntries.map(({ id, anchor, tie, rigid }) => ({
|
|
4823
|
+
customEntries.map(({ id, anchor, tie, rigid, occlusion }) => ({
|
|
4676
4824
|
id,
|
|
4677
4825
|
anchor,
|
|
4678
4826
|
tie,
|
|
4679
|
-
...rigid === void 0 ? {} : { rigid }
|
|
4827
|
+
...rigid === void 0 ? {} : { rigid },
|
|
4828
|
+
...occlusion === void 0 ? {} : { occludedBy: occlusion.by }
|
|
4680
4829
|
})),
|
|
4681
4830
|
paints
|
|
4682
4831
|
);
|
|
@@ -4712,7 +4861,8 @@ async function autoRigFromLayers(input) {
|
|
|
4712
4861
|
triangles: part.mesh.indices.length / 3
|
|
4713
4862
|
},
|
|
4714
4863
|
order: part.order,
|
|
4715
|
-
page: part.texture.index
|
|
4864
|
+
page: part.texture.index,
|
|
4865
|
+
...part.occlusion === void 0 ? {} : { occlusion: part.occlusion }
|
|
4716
4866
|
};
|
|
4717
4867
|
}),
|
|
4718
4868
|
...bakes === void 0 ? {} : { bakes },
|
|
@@ -7700,9 +7850,12 @@ function formatPatchReports(reports) {
|
|
|
7700
7850
|
});
|
|
7701
7851
|
}
|
|
7702
7852
|
function formatCustomPartReports(parts) {
|
|
7703
|
-
return parts.map(
|
|
7704
|
-
|
|
7705
|
-
|
|
7853
|
+
return parts.map((p) => {
|
|
7854
|
+
const line = `CUSTOM ${p.id}: box ${p.box.x},${p.box.y} ${p.box.w}x${p.box.h} px, mesh ${p.mesh.vertices} vertices ${p.mesh.triangles} triangles, order ${p.order}, atlas page ${p.page}`;
|
|
7855
|
+
if (p.occlusion === void 0) return line;
|
|
7856
|
+
const { by, parameter, stops } = p.occlusion;
|
|
7857
|
+
return `${line}, hidden by ${by.join(",")} on ${parameter} at ${stops.map((s) => `${s.value}:${s.amount}`).join(" ")}`;
|
|
7858
|
+
});
|
|
7706
7859
|
}
|
|
7707
7860
|
function formatBakeChecks(bakes) {
|
|
7708
7861
|
return bakes.map(
|
|
@@ -7710,7 +7863,7 @@ function formatBakeChecks(bakes) {
|
|
|
7710
7863
|
);
|
|
7711
7864
|
}
|
|
7712
7865
|
function createIkiMcpServer() {
|
|
7713
|
-
const server = new McpServer({ name: "iki", version: "0.
|
|
7866
|
+
const server = new McpServer({ name: "iki", version: "0.35.1" });
|
|
7714
7867
|
server.registerTool(
|
|
7715
7868
|
"validate_iki",
|
|
7716
7869
|
{
|
|
@@ -7802,7 +7955,7 @@ function createIkiMcpServer() {
|
|
|
7802
7955
|
server.registerTool(
|
|
7803
7956
|
"auto_rig_from_layers",
|
|
7804
7957
|
{
|
|
7805
|
-
description: "Auto-rigs role-named PNG layers (face, eye_L/eye_R and either mouth or the lip set (mouth_inner + lip_lower + lip_upper, a mouth that folds open instead of crossfading) required; iris_L/R, brow_L/R, hair_front, body, arm_L/arm_R, forearm_pose_L/forearm_pose_R, hair_side_L/hair_side_R, mouth_tongue/mouth_teeth (only with the lip set: drawn under its lips and clipped to mouth_inner), etc. optional; an arm needs the body, a pose forearm needs its arm, a side lock needs hair_front, and a partial lip set, one mixed with mouth/mouth_open, or mouth_tongue/mouth_teeth without it is refused) into a renderable .iki written to disk. Pass full-canvas PNG file paths; returns the output path + summary (the model is NOT inlined). Filenames map to roles unless `fileName` is given. The result's `folds` is the written rig's fold report, printed after the path the way render_poses prints it, and report-only: a fold never refuses the rig. The `RIGPLAN:` line (the result's `rigPlan`: `effective`, `clamped`, `overriddenBy`) follows the path and precedes the `PATCH` lines. The `PHYSICS` lines follow the fold report (the result's `physics`), one per physics rig output \u2014 a spring's, or each chain segment's \u2014 reading ok, frozen or unstable with the step and idle amplitudes, or `PHYSICS: no rigs`; report-only too. With side locks and a `nose` (which `turn` needs) the `HAIRSIDE` lines follow the `PHYSICS` lines (the result's `turn.hairSide`), each naming the lock's role, report-only as well. `patches` (see its field) adds displacements to existing keyform stops of the freshly generated rig; each op then prints one line between the path and the fold report \u2014 `PATCH <i> <target> at <Param=v \u2026>: <moved> of <of> points (cols a-b, rows c-d), largest move <maxPx> model px`, with `(vertices)` in place of the columns and rows for a mesh part \u2014 and the result's `patches` carries the same reports (`index`, `target`, `at`, `moved`, `of`, `cols`/`rows` for a grid, `maxPx`), present whenever `patches` was passed, `[]` included. An op the input schema accepts but the rig refuses comes back as `INVALID: patches[i]\u2026` and nothing is written; an op with a missing field or a field of the wrong type is the SDK's input validation error. `customParts` adds parts the rig has no role for (a twin tail, a hairpin), each from a canvas-sized PNG of its own, as an unrigged mesh on `headDeformer` after its `after` role's parts; it needs @ikijs/mcp 0.34.0, and an older server drops the field and returns no `customParts`. The result's `customParts` (`parts`: `id`, rest `box`, `mesh`, `order`, atlas `page`) is present whenever the input was passed, `[]` included, and one `CUSTOM <id>: \u2026` line per part follows the `HAIRSIDE` lines. `bakes` (see its field) moves the custom parts with a parameter and needs `customParts`; each part and parameter it moves then prints one `BAKE <part> <param>: <n> vertices, stops <values>, error <px> px` line after the `CUSTOM` lines (the result's `customParts.bakes`: `part`, `param`, `vertices`, `stops`, `errorPx`), the written model having been landed through the engine, and a stop off by 0.1 px or more comes back as `INVALID: BAKE ERROR <part> <param>=<value>: \u2026`, and a part the bake moves at rest as `INVALID: BAKE ERROR <part> at rest: \u2026`, with nothing written (the rig and the engine disagree: report it as a bug in the packages). Whenever `customParts` was passed, the written model is also measured per custom part (the result's `customParts.gate`: `ok`, `limits`, `parts`, `failed`) and the text ends with its lines, `CUSTOM <id> FOLDS|TIE|SLIDE|EXPOSED|RIGID|TIP: \u2026` then `CUSTOM GATE pass` or `CUSTOM GATE FAIL: <part LINE, \u2026>`, always the last line: a part's least triangle area ratio, its tie's displacement against the anchor where the head does not turn and where it does, the hidden art showing, how far a rigid part bends and where its free end lands, each in px and face widths with its worst pose; `TIP` never fails the gate and the other lines do. The model is written either way; from 0.34.0 on `customParts` always carries `gate` (a gate that throws still writes the file and ends the text `CUSTOM GATE FAIL: gate error: <message>`), so a result without `customParts` is from an older server and was never gated. The custom layers are not role layers: they are left out of the head's width and turn measurements, and an empty or wrong-size one, or an entry the rig refuses, comes back as `INVALID: customParts[i]\u2026` with nothing written. A missing field or one of the wrong type (a `tie` that is not two numbers, say) is refused by the schema itself, as the SDK's input validation error.",
|
|
7958
|
+
description: "Auto-rigs role-named PNG layers (face, eye_L/eye_R and either mouth or the lip set (mouth_inner + lip_lower + lip_upper, a mouth that folds open instead of crossfading) required; iris_L/R, brow_L/R, hair_front, body, arm_L/arm_R, forearm_pose_L/forearm_pose_R, hair_side_L/hair_side_R, mouth_tongue/mouth_teeth (only with the lip set: drawn under its lips and clipped to mouth_inner), etc. optional; an arm needs the body, a pose forearm needs its arm, a side lock needs hair_front, and a partial lip set, one mixed with mouth/mouth_open, or mouth_tongue/mouth_teeth without it is refused) into a renderable .iki written to disk. Pass full-canvas PNG file paths; returns the output path + summary (the model is NOT inlined). Filenames map to roles unless `fileName` is given. The result's `folds` is the written rig's fold report, printed after the path the way render_poses prints it, and report-only: a fold never refuses the rig. The `RIGPLAN:` line (the result's `rigPlan`: `effective`, `clamped`, `overriddenBy`) follows the path and precedes the `PATCH` lines. The `PHYSICS` lines follow the fold report (the result's `physics`), one per physics rig output \u2014 a spring's, or each chain segment's \u2014 reading ok, frozen or unstable with the step and idle amplitudes, or `PHYSICS: no rigs`; report-only too. With side locks and a `nose` (which `turn` needs) the `HAIRSIDE` lines follow the `PHYSICS` lines (the result's `turn.hairSide`), each naming the lock's role, report-only as well. `patches` (see its field) adds displacements to existing keyform stops of the freshly generated rig; each op then prints one line between the path and the fold report \u2014 `PATCH <i> <target> at <Param=v \u2026>: <moved> of <of> points (cols a-b, rows c-d), largest move <maxPx> model px`, with `(vertices)` in place of the columns and rows for a mesh part \u2014 and the result's `patches` carries the same reports (`index`, `target`, `at`, `moved`, `of`, `cols`/`rows` for a grid, `maxPx`), present whenever `patches` was passed, `[]` included. An op the input schema accepts but the rig refuses comes back as `INVALID: patches[i]\u2026` and nothing is written; an op with a missing field or a field of the wrong type is the SDK's input validation error. `customParts` adds parts the rig has no role for (a twin tail, a hairpin), each from a canvas-sized PNG of its own, as an unrigged mesh on `headDeformer` after its `after` role's parts; it needs @ikijs/mcp 0.34.0, and an older server drops the field and returns no `customParts`. A part can declare `occlusion` (hidden where named roles' paint covers it, by an amount keyed on a parameter; it needs 0.35.0, and an older server refuses the key as `INVALID: customParts[i]\u2026`); its `CUSTOM <id>:` line then ends `, hidden by <id>,<id>\u2026 on <parameter> at <value>:<amount> <value>:<amount>\u2026`, and the result's part carries `occlusion` (`by` as the part ids written, `parameter`, `stops`). The result's `customParts` (`parts`: `id`, rest `box`, `mesh`, `order`, atlas `page`) is present whenever the input was passed, `[]` included, and one `CUSTOM <id>: \u2026` line per part follows the `HAIRSIDE` lines. `bakes` (see its field) moves the custom parts with a parameter and needs `customParts`; each part and parameter it moves then prints one `BAKE <part> <param>: <n> vertices, stops <values>, error <px> px` line after the `CUSTOM` lines (the result's `customParts.bakes`: `part`, `param`, `vertices`, `stops`, `errorPx`), the written model having been landed through the engine, and a stop off by 0.1 px or more comes back as `INVALID: BAKE ERROR <part> <param>=<value>: \u2026`, and a part the bake moves at rest as `INVALID: BAKE ERROR <part> at rest: \u2026`, with nothing written (the rig and the engine disagree: report it as a bug in the packages). Whenever `customParts` was passed, the written model is also measured per custom part (the result's `customParts.gate`: `ok`, `limits`, `parts`, `failed`) and the text ends with its lines, `CUSTOM <id> FOLDS|TIE|SLIDE|EXPOSED|RIGID|TIP: \u2026` then `CUSTOM GATE pass` or `CUSTOM GATE FAIL: <part LINE, \u2026>`, always the last line: a part's least triangle area ratio, its tie's displacement against the anchor where the head does not turn and where it does, the hidden art showing, how far a rigid part bends and where its free end lands, each in px and face widths with its worst pose; `TIP` never fails the gate and the other lines do. The model is written either way; from 0.34.0 on `customParts` always carries `gate` (a gate that throws still writes the file and ends the text `CUSTOM GATE FAIL: gate error: <message>`), so a result without `customParts` is from an older server and was never gated. The custom layers are not role layers: they are left out of the head's width and turn measurements, and an empty or wrong-size one, or an entry the rig refuses, comes back as `INVALID: customParts[i]\u2026` with nothing written. A missing field or one of the wrong type (a `tie` that is not two numbers, say) is refused by the schema itself, as the SDK's input validation error.",
|
|
7806
7959
|
inputSchema: {
|
|
7807
7960
|
layers: z.array(
|
|
7808
7961
|
z.object({
|
|
@@ -7866,10 +8019,30 @@ function createIkiMcpServer() {
|
|
|
7866
8019
|
),
|
|
7867
8020
|
rigid: z.boolean().optional().describe(
|
|
7868
8021
|
"The art does not bend (a hairpin, a ribbon): a bake that bends it by more than 0.0025 face widths at a stop, from its best-fit rotation and translation, is refused as `INVALID: bakes\u2026` with nothing written. Give a rigid part one displacement for every control point, or a rotation."
|
|
8022
|
+
),
|
|
8023
|
+
occlusion: z.object({
|
|
8024
|
+
by: z.array(z.string()).describe(
|
|
8025
|
+
"Roles of the set whose paint hides the part (an arm role is its three parts); a non-empty list with no role repeated, each a role of the set. A role with a clipped or meshless part (`iris_L`, `forearm_pose_L`) is refused."
|
|
8026
|
+
),
|
|
8027
|
+
parameter: z.string().describe(
|
|
8028
|
+
"Any declared parameter but a physics output (a spring's or a chain segment's)."
|
|
8029
|
+
),
|
|
8030
|
+
stops: z.array(
|
|
8031
|
+
z.object({
|
|
8032
|
+
value: z.number(),
|
|
8033
|
+
amount: z.number().describe(
|
|
8034
|
+
"0 to 1: 1 hides the part wherever the roles' paint lies over it."
|
|
8035
|
+
)
|
|
8036
|
+
}).passthrough()
|
|
8037
|
+
).describe(
|
|
8038
|
+
"At least one, `value` strictly ascending and inside the parameter's range. The amount is linear between stops and held before the first and after the last."
|
|
8039
|
+
)
|
|
8040
|
+
}).passthrough().optional().describe(
|
|
8041
|
+
"Hide the part where the named roles' paint covers it, by an amount keyed on a parameter: `{ by, parameter, stops: [{ value, amount }] }`. Cover is where a role's drawn alpha at that pose is at least 0.5, a hard edge; a role that fades (`mouth_open`, a blush, a pose forearm) covers only while drawn at half strength or more. Use the stops as a short switch starting a degree or more past the idle sway, the hiding's progress coming from the part's baked motion. Needs @ikijs/mcp 0.35.0; an older server refuses the key as an unknown key (`INVALID: customParts[i]\u2026`). An unknown key, a bad stop or a part the key cannot be written for comes back as `INVALID: customParts[i].occlusion\u2026` with nothing written."
|
|
7869
8042
|
)
|
|
7870
8043
|
}).passthrough()
|
|
7871
8044
|
).optional().describe(
|
|
7872
|
-
"Parts the auto-rigger has no role for, each `{ id, path, anchor, tie, after, deformer?, rigid? }`. A custom layer is read apart from `layers`: never role-parsed or measured, so its name is free and it does not widen the head the turn is fitted to; it counts toward the layer and pixel limits. All custom parts share one extra atlas page, the last, quantized on a palette of its own, so the other pages keep their bytes. An entry the rig refuses (an unknown key, a bad tie) comes back as `INVALID: customParts[i]\u2026` with nothing written; a missing field or one of the wrong type (a `tie` that is not two numbers, say) is refused by the schema itself, as the SDK's input validation error. `[]` is the same rig as leaving the field out, plus an empty `customParts` in the result."
|
|
8045
|
+
"Parts the auto-rigger has no role for, each `{ id, path, anchor, tie, after, deformer?, rigid?, occlusion? }`. A custom layer is read apart from `layers`: never role-parsed or measured, so its name is free and it does not widen the head the turn is fitted to; it counts toward the layer and pixel limits. All custom parts share one extra atlas page, the last, quantized on a palette of its own, so the other pages keep their bytes. An entry the rig refuses (an unknown key, a bad tie) comes back as `INVALID: customParts[i]\u2026` with nothing written; a missing field or one of the wrong type (a `tie` that is not two numbers, say) is refused by the schema itself, as the SDK's input validation error. `[]` is the same rig as leaving the field out, plus an empty `customParts` in the result."
|
|
7873
8046
|
),
|
|
7874
8047
|
bakes: z.object({
|
|
7875
8048
|
targets: z.array(
|
|
@@ -8122,7 +8295,7 @@ function createIkiMcpServer() {
|
|
|
8122
8295
|
"More sweeps rendered after `sweep`, each `{ name, preset, crop? }` into its own `<outDir>/<name>/` (files and `crop` as `sweep`'s). Names are distinct from `sweep`'s and from each other's ignoring case, and presets are distinct (at most one of each). `turn` is `sweep`'s. `roll` is the same eased curve on `ParamAngleZ` (0 to -30 to +30 to 0 over 3 s, 90 frames, physics running, idle off); its `sheet.png` is the nine frames nearest the turn sheet's angles on the -30 to +30 leg, labelled with the angle (Z) and time, and it has no kymograph (the eye row moves with the roll). `turn-nod` is the box (0,0) -> (0,-30) -> (-30,-30) -> (-30,+30) -> (+30,+30) -> (+30,-30) -> (0,-30) -> (0,0) of `ParamAngleX` x `ParamAngleY`, each leg eased, 6 s, 180 frames; its `sheet.png` is a 3 x 3 grid BY ANGLE (columns AngleX -30/0/+30, rows AngleY +30/0/-30, rest in the centre, cells labelled X, Y and t) and it has no kymograph. `manifest.json` is version 2 (`parameters`, and per frame `t` and `values`). A sweep dir's earlier frames, sheet, kymograph, manifest and flipbook are cleared first. An empty list, a repeated name or preset, or a bad crop comes back as `INVALID: sweeps...`. A server before 0.32.0 strips `sweeps` and renders the rest. The `SWEEP nod` lines (the eye-pair and iris-pair gap range and the mouth width range along the nod at each turn, in face widths) and `SWEEP corner` lines (the additivity residual per landmark at the four corners, the rest term included; 0 on an additive rig) print once per call whenever `sweep` or `sweeps` was asked for, report-only like `FOLD` and `PHYSICS`. A `roll` adds no `SWEEP` line of its own and changes none: they are read from the model. `roll` needs @ikijs/mcp 0.34.0; an older server refuses it as an input validation error."
|
|
8123
8296
|
),
|
|
8124
8297
|
hideParts: z.array(z.string()).optional().describe(
|
|
8125
|
-
"Part ids left out of the drawn frames (poses and sweeps); the fold, physics and sweep reports still read the whole model. Use it to render a character without its custom parts, so `measure_turn_reference` reads the rig's own head (a custom part crossing the eye row widens the head it measures, as it does on a drawn reference). An id the model lacks, or one that is the clip mask of a part that stays, comes back as `INVALID: hideParts[i] \u2026` and nothing is rendered. Needs @ikijs/mcp 0.34.0; an older server drops the field and draws every part."
|
|
8298
|
+
"Part ids left out of the drawn frames (poses and sweeps); the fold, physics and sweep reports still read the whole model. Use it to render a character without its custom parts, so `measure_turn_reference` reads the rig's own head (a custom part crossing the eye row widens the head it measures, as it does on a drawn reference). An id the model lacks, or one that is the clip mask of a part that stays, or one a part that stays names in its `occlusion.by` (hide that part too), comes back as `INVALID: hideParts[i] \u2026` and nothing is rendered. Needs @ikijs/mcp 0.34.0; an older server drops the field and draws every part."
|
|
8126
8299
|
)
|
|
8127
8300
|
}
|
|
8128
8301
|
},
|
|
@@ -8239,4 +8412,4 @@ export {
|
|
|
8239
8412
|
formatPhysicsReport,
|
|
8240
8413
|
createIkiMcpServer
|
|
8241
8414
|
};
|
|
8242
|
-
//# sourceMappingURL=chunk-
|
|
8415
|
+
//# sourceMappingURL=chunk-Y36XOSK4.mjs.map
|