@ikijs/mcp 0.24.0 → 0.26.0
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 +19 -16
- package/dist/{chunk-GEXOSC5O.mjs → chunk-K2CWU4AL.mjs} +4340 -3352
- package/dist/chunk-K2CWU4AL.mjs.map +1 -0
- package/dist/cli.js +4272 -3295
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +151 -8
- package/dist/index.d.ts +151 -8
- package/dist/index.js +4278 -3295
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/render-page.global.js +18 -2
- package/package.json +3 -3
- package/dist/chunk-GEXOSC5O.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,57 @@
|
|
|
1
|
-
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
1
|
+
import { TurnTargets, RigStyle, RigPatch, IrisStrand, TurnSolveReport, PatchReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
|
+
import { IkiModel } from '@ikijs/format';
|
|
3
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
5
|
|
|
6
|
+
/** A parameter setting to check the rig at; every other parameter rests at its default. */
|
|
7
|
+
interface FoldPose {
|
|
8
|
+
/** Its sorted `id=value` pairs joined by one space; `rest` when empty. */
|
|
9
|
+
name: string;
|
|
10
|
+
values: Record<string, number>;
|
|
11
|
+
}
|
|
12
|
+
/** Where and when a target comes nearest to folding over one class of poses. */
|
|
13
|
+
interface FoldHit {
|
|
14
|
+
/** Doubled signed area at the pose over the same at rest. */
|
|
15
|
+
ratio: number;
|
|
16
|
+
/** The warp grid's cell, or the part mesh's triangle (its index into `mesh.indices` / 3). */
|
|
17
|
+
where: {
|
|
18
|
+
col: number;
|
|
19
|
+
row: number;
|
|
20
|
+
} | {
|
|
21
|
+
triangle: number;
|
|
22
|
+
};
|
|
23
|
+
pose: FoldPose;
|
|
24
|
+
/** Where it sits at rest, model space, through the static matrix chain. */
|
|
25
|
+
rest: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface FoldTarget {
|
|
31
|
+
target: {
|
|
32
|
+
kind: "deformer" | "part";
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
/** Read off `worst` alone; `ok` when it is absent. */
|
|
36
|
+
kind: "flip" | "collapse" | "ok";
|
|
37
|
+
/** Least ratio over the poses `expected` rejects (every pose without it). */
|
|
38
|
+
worst?: FoldHit;
|
|
39
|
+
/** Least ratio over the poses `expected` accepts. */
|
|
40
|
+
expected?: FoldHit;
|
|
41
|
+
}
|
|
42
|
+
interface FoldReport {
|
|
43
|
+
/** How many poses were checked. */
|
|
44
|
+
poses: number;
|
|
45
|
+
thresholds: {
|
|
46
|
+
flip: 0;
|
|
47
|
+
collapse: 0.1;
|
|
48
|
+
};
|
|
49
|
+
/** One per warp deformer, then one per mesh part, each in model order. */
|
|
50
|
+
targets: FoldTarget[];
|
|
51
|
+
/** The targets that are not `ok`, worst first. */
|
|
52
|
+
offenders: FoldTarget[];
|
|
53
|
+
}
|
|
54
|
+
|
|
5
55
|
type ValidateResult = {
|
|
6
56
|
ok: true;
|
|
7
57
|
} | {
|
|
@@ -20,12 +70,12 @@ interface IkiSummary {
|
|
|
20
70
|
max: number;
|
|
21
71
|
default: number;
|
|
22
72
|
}[];
|
|
23
|
-
parts:
|
|
24
|
-
id: string;
|
|
25
|
-
order: number;
|
|
26
|
-
deformer?: string;
|
|
27
|
-
}[];
|
|
73
|
+
parts: PartSummary[];
|
|
28
74
|
deformers: DeformerSummary[];
|
|
75
|
+
/** The `face` part's width in model px: the unit a rig patch op's `by` and `falloff` are measured in. */
|
|
76
|
+
faceWidth?: number;
|
|
77
|
+
/** Bust-render px per model px (`BUST_SIZE / canvas.width`). */
|
|
78
|
+
bustScale: number;
|
|
29
79
|
/** Each expression's id and the description a host picks it by. */
|
|
30
80
|
expressions: {
|
|
31
81
|
id: string;
|
|
@@ -34,6 +84,30 @@ interface IkiSummary {
|
|
|
34
84
|
/** Each motion group's clip descriptions, by clip index. */
|
|
35
85
|
motions: Record<string, string[]>;
|
|
36
86
|
}
|
|
87
|
+
interface PartSummary {
|
|
88
|
+
id: string;
|
|
89
|
+
order: number;
|
|
90
|
+
deformer?: string;
|
|
91
|
+
/** Rest box in model px from the canvas top-left, y down; the frame of the fold lines and `layout.json`. */
|
|
92
|
+
box: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
w: number;
|
|
96
|
+
h: number;
|
|
97
|
+
};
|
|
98
|
+
/** The same box in bust-render px, including the padding above a landscape model. */
|
|
99
|
+
bustBox: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
w: number;
|
|
103
|
+
h: number;
|
|
104
|
+
};
|
|
105
|
+
/** The part's own warps: parameter and the keyform stop values. */
|
|
106
|
+
warps?: {
|
|
107
|
+
parameter: string;
|
|
108
|
+
stops: number[];
|
|
109
|
+
}[];
|
|
110
|
+
}
|
|
37
111
|
interface DeformerSummary {
|
|
38
112
|
id: string;
|
|
39
113
|
kind: "matrix" | "warp";
|
|
@@ -47,6 +121,8 @@ interface DeformerSummary {
|
|
|
47
121
|
parameterY: string;
|
|
48
122
|
gridX: number;
|
|
49
123
|
gridY: number;
|
|
124
|
+
stopsX: number[];
|
|
125
|
+
stopsY: number[];
|
|
50
126
|
};
|
|
51
127
|
}
|
|
52
128
|
type DescribeResult = {
|
|
@@ -62,6 +138,12 @@ interface StandardParameterInfo {
|
|
|
62
138
|
}
|
|
63
139
|
declare function validateIki(model: unknown): ValidateResult;
|
|
64
140
|
declare function describeIki(model: unknown): DescribeResult;
|
|
141
|
+
/**
|
|
142
|
+
* `describeIki` on a written model, read from `modelPath` (confined to the
|
|
143
|
+
* working directory like `renderPoses`), so a large model never crosses an
|
|
144
|
+
* agent's context inline.
|
|
145
|
+
*/
|
|
146
|
+
declare function describeIkiAt(modelPath: string): DescribeResult;
|
|
65
147
|
declare function listStandardParameters(): StandardParameterInfo[];
|
|
66
148
|
/** One role-named PNG layer; role is derived from `fileName ?? basename(path)`. */
|
|
67
149
|
interface AutoRigLayerInput {
|
|
@@ -83,6 +165,10 @@ interface AutoRigInput {
|
|
|
83
165
|
/** Per-character tuning from the profile's defaults (see
|
|
84
166
|
* @ikijs/editor's `RigStyle`). */
|
|
85
167
|
style?: RigStyle;
|
|
168
|
+
/** Displacements added to existing keyform stops of the freshly generated
|
|
169
|
+
* rig, replayed on every rig of these inputs (see @ikijs/editor's
|
|
170
|
+
* `RigPatch`). */
|
|
171
|
+
patches?: RigPatch[];
|
|
86
172
|
}
|
|
87
173
|
/** The turn cues a caller may pass, which is every one but `headHalfWidth`:
|
|
88
174
|
* the pixels the shift fractions are fractions of are measured off the layers
|
|
@@ -162,6 +248,14 @@ type AutoRigResult = {
|
|
|
162
248
|
* (`strandOverlap`). Absent for a layer set with no nose, which solves
|
|
163
249
|
* no turn at all. */
|
|
164
250
|
turn?: TurnSolveReport;
|
|
251
|
+
/** The written model's folds over the engine's pose set, its eyes and
|
|
252
|
+
* mouth shutting on purpose set apart as `expected`. Report-only: a
|
|
253
|
+
* fold never refuses the rig. */
|
|
254
|
+
folds: FoldReport;
|
|
255
|
+
/** What each of `input.patches` moved on this rig, in order — present
|
|
256
|
+
* whenever `patches` was passed, `[]` included, so a caller can tell
|
|
257
|
+
* this server from one that drops the field. */
|
|
258
|
+
patches?: PatchReport[];
|
|
165
259
|
} | {
|
|
166
260
|
ok: false;
|
|
167
261
|
error: string;
|
|
@@ -178,7 +272,10 @@ type AutoRigResult = {
|
|
|
178
272
|
* and hair layers' opaque runs and the nose's dense core, returned as
|
|
179
273
|
* `noseCore`); what the solve settled on comes back in `turn`. Under
|
|
180
274
|
* `quantizeColors` the nose is atlased alone on a second, lossless page, which
|
|
181
|
-
* the palette would otherwise rim; `atlasBytes` sums both pages.
|
|
275
|
+
* the palette would otherwise rim; `atlasBytes` sums both pages. The
|
|
276
|
+
* generator replays `input.patches` on the fresh rig before it validates and
|
|
277
|
+
* reports the turn, and what each op moved comes back in `patches`; a refused
|
|
278
|
+
* op writes nothing.
|
|
182
279
|
*
|
|
183
280
|
* Re-host of examples/editor/src/store.ts `importLayerSet` with the three DOM
|
|
184
281
|
* pixel functions swapped for the sharp-backed ./node-images helpers; the pure
|
|
@@ -572,6 +669,31 @@ type ComposeResult = {
|
|
|
572
669
|
*/
|
|
573
670
|
declare function composeLayersFromParts(input: ComposeInput): Promise<ComposeResult>;
|
|
574
671
|
|
|
672
|
+
/**
|
|
673
|
+
* The fold check `auto_rig_from_layers` and `render_poses` report: the
|
|
674
|
+
* engine's `checkFolds` with the auto-rig's by-design closures set apart, and
|
|
675
|
+
* the text lines both tools print it as.
|
|
676
|
+
*/
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* `checkFolds` over `foldPoses(model)` then one pose per `extraValues` set,
|
|
680
|
+
* appended as given (a set equal to a default pose is checked twice), with
|
|
681
|
+
* the auto-rig's by-design closures (`SHUT_BY`) kept out of `worst`.
|
|
682
|
+
*/
|
|
683
|
+
declare function checkModelFolds(model: IkiModel, extraValues?: Record<string, number>[]): FoldReport;
|
|
684
|
+
/**
|
|
685
|
+
* `report` as text lines: one `FOLD` line per offender, worst first, or
|
|
686
|
+
* `FOLDS: none over N poses`; then, when a by-design closure folds, one
|
|
687
|
+
* `FOLDS expected:` line naming each such part, its ratio and the parameter
|
|
688
|
+
* that shuts it. A `FOLD` line gives its rest point in model space and in
|
|
689
|
+
* model px from the top-left of the model's `canvas` — the layer PNGs' own
|
|
690
|
+
* pixels, the frame `RenderPlan.mouth` is in, not a render's.
|
|
691
|
+
*/
|
|
692
|
+
declare function formatFoldReport(report: FoldReport, canvas: {
|
|
693
|
+
width: number;
|
|
694
|
+
height: number;
|
|
695
|
+
}): string[];
|
|
696
|
+
|
|
575
697
|
/**
|
|
576
698
|
* Measure the head-turn cues in a PAIR of images of the same character — one
|
|
577
699
|
* facing front, one turned — and report them as three ratios. It is how a
|
|
@@ -729,11 +851,26 @@ interface RenderPlan {
|
|
|
729
851
|
};
|
|
730
852
|
poses: RenderPose[];
|
|
731
853
|
}
|
|
854
|
+
/** A pose the caller names, rendered in place of the model's own set. */
|
|
855
|
+
interface RequestedPose {
|
|
856
|
+
/** Written as `<outDir>/<name>.png`. */
|
|
857
|
+
name: string;
|
|
858
|
+
values: Record<string, number>;
|
|
859
|
+
/** Model px from the top-left; absent = framed as the standard shots. */
|
|
860
|
+
crop?: {
|
|
861
|
+
x: number;
|
|
862
|
+
y: number;
|
|
863
|
+
w: number;
|
|
864
|
+
h: number;
|
|
865
|
+
};
|
|
866
|
+
}
|
|
732
867
|
interface RenderPosesInput {
|
|
733
868
|
/** The rigged `.iki` to render (resolved against cwd). */
|
|
734
869
|
modelPath: string;
|
|
735
870
|
/** Existing directory under cwd the pose PNGs are written into. */
|
|
736
871
|
outDir: string;
|
|
872
|
+
/** Rendered in place of the model's own set; each is also fold-checked. */
|
|
873
|
+
poses?: RequestedPose[];
|
|
737
874
|
}
|
|
738
875
|
type RenderPosesResult = {
|
|
739
876
|
ok: true;
|
|
@@ -747,6 +884,12 @@ type RenderPosesResult = {
|
|
|
747
884
|
name: string;
|
|
748
885
|
path: string;
|
|
749
886
|
}[];
|
|
887
|
+
/** The model's own canvas, which `folds`' rest points are placed on in
|
|
888
|
+
* the text (`canvas` is the render's). */
|
|
889
|
+
modelCanvas: IkiModel["canvas"];
|
|
890
|
+
/** The model's folds, as `auto_rig_from_layers` reports them.
|
|
891
|
+
* Report-only: a fold never fails the render. */
|
|
892
|
+
folds: FoldReport;
|
|
750
893
|
} | {
|
|
751
894
|
ok: false;
|
|
752
895
|
error: string;
|
|
@@ -760,4 +903,4 @@ declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult
|
|
|
760
903
|
|
|
761
904
|
declare function createIkiMcpServer(): McpServer;
|
|
762
905
|
|
|
763
|
-
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type RenderPosesInput, type RenderPosesResult, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, composeLayersFromParts, createIkiMcpServer, describeIki, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
|
906
|
+
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type PartSummary, type RenderPosesInput, type RenderPosesResult, type RequestedPose, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, formatFoldReport, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,57 @@
|
|
|
1
|
-
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
1
|
+
import { TurnTargets, RigStyle, RigPatch, IrisStrand, TurnSolveReport, PatchReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
|
+
import { IkiModel } from '@ikijs/format';
|
|
3
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
5
|
|
|
6
|
+
/** A parameter setting to check the rig at; every other parameter rests at its default. */
|
|
7
|
+
interface FoldPose {
|
|
8
|
+
/** Its sorted `id=value` pairs joined by one space; `rest` when empty. */
|
|
9
|
+
name: string;
|
|
10
|
+
values: Record<string, number>;
|
|
11
|
+
}
|
|
12
|
+
/** Where and when a target comes nearest to folding over one class of poses. */
|
|
13
|
+
interface FoldHit {
|
|
14
|
+
/** Doubled signed area at the pose over the same at rest. */
|
|
15
|
+
ratio: number;
|
|
16
|
+
/** The warp grid's cell, or the part mesh's triangle (its index into `mesh.indices` / 3). */
|
|
17
|
+
where: {
|
|
18
|
+
col: number;
|
|
19
|
+
row: number;
|
|
20
|
+
} | {
|
|
21
|
+
triangle: number;
|
|
22
|
+
};
|
|
23
|
+
pose: FoldPose;
|
|
24
|
+
/** Where it sits at rest, model space, through the static matrix chain. */
|
|
25
|
+
rest: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface FoldTarget {
|
|
31
|
+
target: {
|
|
32
|
+
kind: "deformer" | "part";
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
/** Read off `worst` alone; `ok` when it is absent. */
|
|
36
|
+
kind: "flip" | "collapse" | "ok";
|
|
37
|
+
/** Least ratio over the poses `expected` rejects (every pose without it). */
|
|
38
|
+
worst?: FoldHit;
|
|
39
|
+
/** Least ratio over the poses `expected` accepts. */
|
|
40
|
+
expected?: FoldHit;
|
|
41
|
+
}
|
|
42
|
+
interface FoldReport {
|
|
43
|
+
/** How many poses were checked. */
|
|
44
|
+
poses: number;
|
|
45
|
+
thresholds: {
|
|
46
|
+
flip: 0;
|
|
47
|
+
collapse: 0.1;
|
|
48
|
+
};
|
|
49
|
+
/** One per warp deformer, then one per mesh part, each in model order. */
|
|
50
|
+
targets: FoldTarget[];
|
|
51
|
+
/** The targets that are not `ok`, worst first. */
|
|
52
|
+
offenders: FoldTarget[];
|
|
53
|
+
}
|
|
54
|
+
|
|
5
55
|
type ValidateResult = {
|
|
6
56
|
ok: true;
|
|
7
57
|
} | {
|
|
@@ -20,12 +70,12 @@ interface IkiSummary {
|
|
|
20
70
|
max: number;
|
|
21
71
|
default: number;
|
|
22
72
|
}[];
|
|
23
|
-
parts:
|
|
24
|
-
id: string;
|
|
25
|
-
order: number;
|
|
26
|
-
deformer?: string;
|
|
27
|
-
}[];
|
|
73
|
+
parts: PartSummary[];
|
|
28
74
|
deformers: DeformerSummary[];
|
|
75
|
+
/** The `face` part's width in model px: the unit a rig patch op's `by` and `falloff` are measured in. */
|
|
76
|
+
faceWidth?: number;
|
|
77
|
+
/** Bust-render px per model px (`BUST_SIZE / canvas.width`). */
|
|
78
|
+
bustScale: number;
|
|
29
79
|
/** Each expression's id and the description a host picks it by. */
|
|
30
80
|
expressions: {
|
|
31
81
|
id: string;
|
|
@@ -34,6 +84,30 @@ interface IkiSummary {
|
|
|
34
84
|
/** Each motion group's clip descriptions, by clip index. */
|
|
35
85
|
motions: Record<string, string[]>;
|
|
36
86
|
}
|
|
87
|
+
interface PartSummary {
|
|
88
|
+
id: string;
|
|
89
|
+
order: number;
|
|
90
|
+
deformer?: string;
|
|
91
|
+
/** Rest box in model px from the canvas top-left, y down; the frame of the fold lines and `layout.json`. */
|
|
92
|
+
box: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
w: number;
|
|
96
|
+
h: number;
|
|
97
|
+
};
|
|
98
|
+
/** The same box in bust-render px, including the padding above a landscape model. */
|
|
99
|
+
bustBox: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
w: number;
|
|
103
|
+
h: number;
|
|
104
|
+
};
|
|
105
|
+
/** The part's own warps: parameter and the keyform stop values. */
|
|
106
|
+
warps?: {
|
|
107
|
+
parameter: string;
|
|
108
|
+
stops: number[];
|
|
109
|
+
}[];
|
|
110
|
+
}
|
|
37
111
|
interface DeformerSummary {
|
|
38
112
|
id: string;
|
|
39
113
|
kind: "matrix" | "warp";
|
|
@@ -47,6 +121,8 @@ interface DeformerSummary {
|
|
|
47
121
|
parameterY: string;
|
|
48
122
|
gridX: number;
|
|
49
123
|
gridY: number;
|
|
124
|
+
stopsX: number[];
|
|
125
|
+
stopsY: number[];
|
|
50
126
|
};
|
|
51
127
|
}
|
|
52
128
|
type DescribeResult = {
|
|
@@ -62,6 +138,12 @@ interface StandardParameterInfo {
|
|
|
62
138
|
}
|
|
63
139
|
declare function validateIki(model: unknown): ValidateResult;
|
|
64
140
|
declare function describeIki(model: unknown): DescribeResult;
|
|
141
|
+
/**
|
|
142
|
+
* `describeIki` on a written model, read from `modelPath` (confined to the
|
|
143
|
+
* working directory like `renderPoses`), so a large model never crosses an
|
|
144
|
+
* agent's context inline.
|
|
145
|
+
*/
|
|
146
|
+
declare function describeIkiAt(modelPath: string): DescribeResult;
|
|
65
147
|
declare function listStandardParameters(): StandardParameterInfo[];
|
|
66
148
|
/** One role-named PNG layer; role is derived from `fileName ?? basename(path)`. */
|
|
67
149
|
interface AutoRigLayerInput {
|
|
@@ -83,6 +165,10 @@ interface AutoRigInput {
|
|
|
83
165
|
/** Per-character tuning from the profile's defaults (see
|
|
84
166
|
* @ikijs/editor's `RigStyle`). */
|
|
85
167
|
style?: RigStyle;
|
|
168
|
+
/** Displacements added to existing keyform stops of the freshly generated
|
|
169
|
+
* rig, replayed on every rig of these inputs (see @ikijs/editor's
|
|
170
|
+
* `RigPatch`). */
|
|
171
|
+
patches?: RigPatch[];
|
|
86
172
|
}
|
|
87
173
|
/** The turn cues a caller may pass, which is every one but `headHalfWidth`:
|
|
88
174
|
* the pixels the shift fractions are fractions of are measured off the layers
|
|
@@ -162,6 +248,14 @@ type AutoRigResult = {
|
|
|
162
248
|
* (`strandOverlap`). Absent for a layer set with no nose, which solves
|
|
163
249
|
* no turn at all. */
|
|
164
250
|
turn?: TurnSolveReport;
|
|
251
|
+
/** The written model's folds over the engine's pose set, its eyes and
|
|
252
|
+
* mouth shutting on purpose set apart as `expected`. Report-only: a
|
|
253
|
+
* fold never refuses the rig. */
|
|
254
|
+
folds: FoldReport;
|
|
255
|
+
/** What each of `input.patches` moved on this rig, in order — present
|
|
256
|
+
* whenever `patches` was passed, `[]` included, so a caller can tell
|
|
257
|
+
* this server from one that drops the field. */
|
|
258
|
+
patches?: PatchReport[];
|
|
165
259
|
} | {
|
|
166
260
|
ok: false;
|
|
167
261
|
error: string;
|
|
@@ -178,7 +272,10 @@ type AutoRigResult = {
|
|
|
178
272
|
* and hair layers' opaque runs and the nose's dense core, returned as
|
|
179
273
|
* `noseCore`); what the solve settled on comes back in `turn`. Under
|
|
180
274
|
* `quantizeColors` the nose is atlased alone on a second, lossless page, which
|
|
181
|
-
* the palette would otherwise rim; `atlasBytes` sums both pages.
|
|
275
|
+
* the palette would otherwise rim; `atlasBytes` sums both pages. The
|
|
276
|
+
* generator replays `input.patches` on the fresh rig before it validates and
|
|
277
|
+
* reports the turn, and what each op moved comes back in `patches`; a refused
|
|
278
|
+
* op writes nothing.
|
|
182
279
|
*
|
|
183
280
|
* Re-host of examples/editor/src/store.ts `importLayerSet` with the three DOM
|
|
184
281
|
* pixel functions swapped for the sharp-backed ./node-images helpers; the pure
|
|
@@ -572,6 +669,31 @@ type ComposeResult = {
|
|
|
572
669
|
*/
|
|
573
670
|
declare function composeLayersFromParts(input: ComposeInput): Promise<ComposeResult>;
|
|
574
671
|
|
|
672
|
+
/**
|
|
673
|
+
* The fold check `auto_rig_from_layers` and `render_poses` report: the
|
|
674
|
+
* engine's `checkFolds` with the auto-rig's by-design closures set apart, and
|
|
675
|
+
* the text lines both tools print it as.
|
|
676
|
+
*/
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* `checkFolds` over `foldPoses(model)` then one pose per `extraValues` set,
|
|
680
|
+
* appended as given (a set equal to a default pose is checked twice), with
|
|
681
|
+
* the auto-rig's by-design closures (`SHUT_BY`) kept out of `worst`.
|
|
682
|
+
*/
|
|
683
|
+
declare function checkModelFolds(model: IkiModel, extraValues?: Record<string, number>[]): FoldReport;
|
|
684
|
+
/**
|
|
685
|
+
* `report` as text lines: one `FOLD` line per offender, worst first, or
|
|
686
|
+
* `FOLDS: none over N poses`; then, when a by-design closure folds, one
|
|
687
|
+
* `FOLDS expected:` line naming each such part, its ratio and the parameter
|
|
688
|
+
* that shuts it. A `FOLD` line gives its rest point in model space and in
|
|
689
|
+
* model px from the top-left of the model's `canvas` — the layer PNGs' own
|
|
690
|
+
* pixels, the frame `RenderPlan.mouth` is in, not a render's.
|
|
691
|
+
*/
|
|
692
|
+
declare function formatFoldReport(report: FoldReport, canvas: {
|
|
693
|
+
width: number;
|
|
694
|
+
height: number;
|
|
695
|
+
}): string[];
|
|
696
|
+
|
|
575
697
|
/**
|
|
576
698
|
* Measure the head-turn cues in a PAIR of images of the same character — one
|
|
577
699
|
* facing front, one turned — and report them as three ratios. It is how a
|
|
@@ -729,11 +851,26 @@ interface RenderPlan {
|
|
|
729
851
|
};
|
|
730
852
|
poses: RenderPose[];
|
|
731
853
|
}
|
|
854
|
+
/** A pose the caller names, rendered in place of the model's own set. */
|
|
855
|
+
interface RequestedPose {
|
|
856
|
+
/** Written as `<outDir>/<name>.png`. */
|
|
857
|
+
name: string;
|
|
858
|
+
values: Record<string, number>;
|
|
859
|
+
/** Model px from the top-left; absent = framed as the standard shots. */
|
|
860
|
+
crop?: {
|
|
861
|
+
x: number;
|
|
862
|
+
y: number;
|
|
863
|
+
w: number;
|
|
864
|
+
h: number;
|
|
865
|
+
};
|
|
866
|
+
}
|
|
732
867
|
interface RenderPosesInput {
|
|
733
868
|
/** The rigged `.iki` to render (resolved against cwd). */
|
|
734
869
|
modelPath: string;
|
|
735
870
|
/** Existing directory under cwd the pose PNGs are written into. */
|
|
736
871
|
outDir: string;
|
|
872
|
+
/** Rendered in place of the model's own set; each is also fold-checked. */
|
|
873
|
+
poses?: RequestedPose[];
|
|
737
874
|
}
|
|
738
875
|
type RenderPosesResult = {
|
|
739
876
|
ok: true;
|
|
@@ -747,6 +884,12 @@ type RenderPosesResult = {
|
|
|
747
884
|
name: string;
|
|
748
885
|
path: string;
|
|
749
886
|
}[];
|
|
887
|
+
/** The model's own canvas, which `folds`' rest points are placed on in
|
|
888
|
+
* the text (`canvas` is the render's). */
|
|
889
|
+
modelCanvas: IkiModel["canvas"];
|
|
890
|
+
/** The model's folds, as `auto_rig_from_layers` reports them.
|
|
891
|
+
* Report-only: a fold never fails the render. */
|
|
892
|
+
folds: FoldReport;
|
|
750
893
|
} | {
|
|
751
894
|
ok: false;
|
|
752
895
|
error: string;
|
|
@@ -760,4 +903,4 @@ declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult
|
|
|
760
903
|
|
|
761
904
|
declare function createIkiMcpServer(): McpServer;
|
|
762
905
|
|
|
763
|
-
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type RenderPosesInput, type RenderPosesResult, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, composeLayersFromParts, createIkiMcpServer, describeIki, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
|
906
|
+
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type PartSummary, type RenderPosesInput, type RenderPosesResult, type RequestedPose, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, formatFoldReport, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|