@ikijs/mcp 0.27.0 → 0.29.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 +2 -2
- package/dist/{chunk-7POOGY7U.mjs → chunk-IG2FZKTW.mjs} +108 -34
- package/dist/chunk-IG2FZKTW.mjs.map +1 -0
- package/dist/cli.js +162 -92
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +162 -92
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/render-page.global.js +10 -3
- package/package.json +4 -4
- package/dist/chunk-7POOGY7U.mjs.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -34,7 +34,7 @@ var import_zod = require("zod");
|
|
|
34
34
|
// src/tools.ts
|
|
35
35
|
var import_node_fs4 = require("fs");
|
|
36
36
|
var import_node_path4 = __toESM(require("path"));
|
|
37
|
-
var
|
|
37
|
+
var import_format9 = require("@ikijs/format");
|
|
38
38
|
var import_editor3 = require("@ikijs/editor");
|
|
39
39
|
|
|
40
40
|
// ../engine/src/math.ts
|
|
@@ -466,6 +466,14 @@ var FixedStepClock = class {
|
|
|
466
466
|
get isSeedFrame() {
|
|
467
467
|
return this.prevNowMs === void 0;
|
|
468
468
|
}
|
|
469
|
+
/**
|
|
470
|
+
* Time carried in the accumulator, in seconds: how far the frame's timestamp is
|
|
471
|
+
* past the last whole sub-step. Drivers extrapolate their state by it so what
|
|
472
|
+
* they emit is the state at the frame's time, not at the last sub-step.
|
|
473
|
+
*/
|
|
474
|
+
get remainderS() {
|
|
475
|
+
return this.accumulatorS;
|
|
476
|
+
}
|
|
469
477
|
/**
|
|
470
478
|
* Fold `nowMs` into the accumulator and return how many {@link FIXED_DT_S}
|
|
471
479
|
* sub-steps to run this frame. On the seed frame it only records the
|
|
@@ -509,6 +517,10 @@ var SWAY_Y_AMP_DEG = 1.6;
|
|
|
509
517
|
var SWAY_Y_PERIOD_MS = 7300;
|
|
510
518
|
var SWAY_Z_AMP_DEG = 1.1;
|
|
511
519
|
var SWAY_Z_PERIOD_MS = 11300;
|
|
520
|
+
var AMBIENT_AMP_A = 0.6;
|
|
521
|
+
var AMBIENT_PERIOD_A_MS = 2900;
|
|
522
|
+
var AMBIENT_AMP_B = 0.4;
|
|
523
|
+
var AMBIENT_PERIOD_B_MS = 4300;
|
|
512
524
|
function blinkEnvelope(phase) {
|
|
513
525
|
const ms = phase * BLINK_DURATION_MS;
|
|
514
526
|
if (ms <= 0) return 1;
|
|
@@ -540,7 +552,8 @@ var IdleMotion = class {
|
|
|
540
552
|
import_format.StandardParameter.EyeballY,
|
|
541
553
|
import_format.StandardParameter.AngleX,
|
|
542
554
|
import_format.StandardParameter.AngleY,
|
|
543
|
-
import_format.StandardParameter.AngleZ
|
|
555
|
+
import_format.StandardParameter.AngleZ,
|
|
556
|
+
import_format.StandardParameter.AmbientSway
|
|
544
557
|
];
|
|
545
558
|
sink;
|
|
546
559
|
rng;
|
|
@@ -604,6 +617,7 @@ var IdleMotion = class {
|
|
|
604
617
|
this.sink(import_format.StandardParameter.AngleX, this.swayX());
|
|
605
618
|
this.sink(import_format.StandardParameter.AngleY, this.swayY());
|
|
606
619
|
this.sink(import_format.StandardParameter.AngleZ, this.swayZ());
|
|
620
|
+
this.sink(import_format.StandardParameter.AmbientSway, this.ambientSway());
|
|
607
621
|
}
|
|
608
622
|
// ---------------------------------------------------------------------------
|
|
609
623
|
// Private helpers
|
|
@@ -617,6 +631,7 @@ var IdleMotion = class {
|
|
|
617
631
|
this.sink(import_format.StandardParameter.AngleX, 0);
|
|
618
632
|
this.sink(import_format.StandardParameter.AngleY, 0);
|
|
619
633
|
this.sink(import_format.StandardParameter.AngleZ, 0);
|
|
634
|
+
this.sink(import_format.StandardParameter.AmbientSway, 0);
|
|
620
635
|
}
|
|
621
636
|
/** Returns the current eye-open value (0..1) and advances blink state. */
|
|
622
637
|
advanceBlink() {
|
|
@@ -652,6 +667,11 @@ var IdleMotion = class {
|
|
|
652
667
|
swayZ() {
|
|
653
668
|
return SWAY_Z_AMP_DEG * Math.sin(2 * Math.PI * this.clockMs / SWAY_Z_PERIOD_MS);
|
|
654
669
|
}
|
|
670
|
+
/** Ambient sway (-1..1), pure function of the internal clock. */
|
|
671
|
+
ambientSway() {
|
|
672
|
+
const t = 2 * Math.PI * this.clockMs;
|
|
673
|
+
return AMBIENT_AMP_A * Math.sin(t / AMBIENT_PERIOD_A_MS) + AMBIENT_AMP_B * Math.sin(t / AMBIENT_PERIOD_B_MS);
|
|
674
|
+
}
|
|
655
675
|
/** Ease gaze current toward target; pick a new target on the internal clock. */
|
|
656
676
|
advanceGaze(dt) {
|
|
657
677
|
if (this.clockMs >= this.nextGazeRetargetMs) {
|
|
@@ -667,6 +687,7 @@ var IdleMotion = class {
|
|
|
667
687
|
};
|
|
668
688
|
|
|
669
689
|
// ../engine/src/physics-motion.ts
|
|
690
|
+
var import_format2 = require("@ikijs/format");
|
|
670
691
|
function signedNormalized(value, param) {
|
|
671
692
|
const rest = clamp(param.default, param.min, param.max);
|
|
672
693
|
const den = Math.max(Math.abs(param.max - rest), Math.abs(rest - param.min));
|
|
@@ -684,6 +705,7 @@ var PhysicsMotion = class {
|
|
|
684
705
|
resets;
|
|
685
706
|
resetCounts;
|
|
686
707
|
rigs;
|
|
708
|
+
inputs;
|
|
687
709
|
read;
|
|
688
710
|
sink;
|
|
689
711
|
params;
|
|
@@ -692,10 +714,17 @@ var PhysicsMotion = class {
|
|
|
692
714
|
clock = new FixedStepClock();
|
|
693
715
|
constructor(rigs, params, read, sink) {
|
|
694
716
|
this.rigs = rigs;
|
|
717
|
+
this.inputs = rigs.map(
|
|
718
|
+
(rig) => (0, import_format2.physicsInputs)(rig).map(({ parameter, weight, mode }) => ({
|
|
719
|
+
parameter,
|
|
720
|
+
weight,
|
|
721
|
+
lag: mode === "lag"
|
|
722
|
+
}))
|
|
723
|
+
);
|
|
695
724
|
this.read = read;
|
|
696
725
|
this.sink = sink;
|
|
697
726
|
this.params = new Map(params.map((p) => [p.id, p]));
|
|
698
|
-
this.state = rigs.map(() => ({ x: 0, v: 0 }));
|
|
727
|
+
this.state = rigs.map(() => ({ x: 0, v: 0, lag: 0 }));
|
|
699
728
|
this.drivenParameterIds = rigs.map((rig) => rig.output.parameter);
|
|
700
729
|
this.resetCounts = rigs.map(() => 0);
|
|
701
730
|
this.resets = this.resetCounts;
|
|
@@ -704,8 +733,12 @@ var PhysicsMotion = class {
|
|
|
704
733
|
* Advance every rig to the given wall-clock timestamp (milliseconds).
|
|
705
734
|
*
|
|
706
735
|
* First call: seed each spring to rest AT its current target (so a model
|
|
707
|
-
* loaded with a nonzero input does not kick
|
|
708
|
-
* return without integrating —
|
|
736
|
+
* loaded with a nonzero input does not kick: a lag input emits rest, a follow
|
|
737
|
+
* input its value), emit that output, and return without integrating —
|
|
738
|
+
* mirroring IdleMotion's first-frame behavior.
|
|
739
|
+
*
|
|
740
|
+
* A non-finite `nowMs` after that is a dropped frame: every rig re-emits its
|
|
741
|
+
* last output from its stored state without reading its inputs.
|
|
709
742
|
*
|
|
710
743
|
* Subsequent calls: {@link FixedStepClock} folds the clamped frame delta into
|
|
711
744
|
* its accumulator and returns how many {@link FIXED_DT_S} sub-steps are due;
|
|
@@ -718,35 +751,52 @@ var PhysicsMotion = class {
|
|
|
718
751
|
this.clock.advance(nowMs);
|
|
719
752
|
for (let i = 0; i < this.rigs.length; i++) {
|
|
720
753
|
const st = this.state[i];
|
|
721
|
-
|
|
754
|
+
const { target: target2, lag } = this.targetFor(i);
|
|
755
|
+
st.x = target2;
|
|
722
756
|
st.v = 0;
|
|
757
|
+
st.lag = lag;
|
|
723
758
|
this.emit(i, st);
|
|
724
759
|
}
|
|
725
760
|
return;
|
|
726
761
|
}
|
|
762
|
+
if (!Number.isFinite(nowMs)) {
|
|
763
|
+
for (let i = 0; i < this.rigs.length; i++) this.emit(i, this.state[i]);
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
727
766
|
const steps = this.clock.advance(nowMs);
|
|
728
|
-
const targets = this.rigs.map((
|
|
767
|
+
const targets = this.rigs.map((_, i) => this.targetFor(i));
|
|
729
768
|
for (let s = 0; s < steps; s++) {
|
|
730
769
|
for (let i = 0; i < this.rigs.length; i++) {
|
|
731
|
-
this.step(this.rigs[i], this.state[i], targets[i]);
|
|
770
|
+
this.step(this.rigs[i], this.state[i], targets[i].target);
|
|
732
771
|
}
|
|
733
772
|
}
|
|
734
773
|
for (let i = 0; i < this.rigs.length; i++) {
|
|
735
774
|
const st = this.state[i];
|
|
775
|
+
const { target: target2, lag } = targets[i];
|
|
736
776
|
if (!Number.isFinite(st.x) || !Number.isFinite(st.v)) {
|
|
737
|
-
st.x = Number.isFinite(
|
|
777
|
+
st.x = Number.isFinite(target2) ? target2 : 0;
|
|
738
778
|
st.v = 0;
|
|
739
779
|
this.resetCounts[i]++;
|
|
740
780
|
}
|
|
781
|
+
st.lag = lag;
|
|
741
782
|
this.emit(i, st);
|
|
742
783
|
}
|
|
743
784
|
}
|
|
744
|
-
/**
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
785
|
+
/**
|
|
786
|
+
* Rig `index`'s spring target `T` = Σ signed-normalized input value × weight,
|
|
787
|
+
* and `L`, the lag inputs' share of it. Reads each input once.
|
|
788
|
+
*/
|
|
789
|
+
targetFor(index) {
|
|
790
|
+
let target2 = 0;
|
|
791
|
+
let lag = 0;
|
|
792
|
+
for (const input of this.inputs[index]) {
|
|
793
|
+
const param = this.params.get(input.parameter);
|
|
794
|
+
const value = this.read(input.parameter);
|
|
795
|
+
const share = (param ? signedNormalized(value, param) : 0) * input.weight;
|
|
796
|
+
target2 += share;
|
|
797
|
+
if (input.lag) lag += share;
|
|
798
|
+
}
|
|
799
|
+
return { target: target2, lag };
|
|
750
800
|
}
|
|
751
801
|
/** One semi-implicit (symplectic) Euler sub-step of FIXED_DT_S seconds. */
|
|
752
802
|
step(rig, st, target2) {
|
|
@@ -754,12 +804,13 @@ var PhysicsMotion = class {
|
|
|
754
804
|
st.v += accel * FIXED_DT_S;
|
|
755
805
|
st.x += st.v * FIXED_DT_S;
|
|
756
806
|
}
|
|
757
|
-
/** Write outputDefault + x * scale onto the output param via the sink. */
|
|
807
|
+
/** Write outputDefault + (x − L) * scale onto the output param via the sink. */
|
|
758
808
|
emit(index, st) {
|
|
759
809
|
const rig = this.rigs[index];
|
|
760
810
|
const outParam = this.params.get(rig.output.parameter);
|
|
761
811
|
const outDefault = outParam ? clamp(outParam.default, outParam.min, outParam.max) : 0;
|
|
762
|
-
const
|
|
812
|
+
const x = st.x + st.v * this.clock.remainderS;
|
|
813
|
+
const value = outDefault + (x - st.lag) * rig.output.scale;
|
|
763
814
|
const finite = Number.isFinite(value);
|
|
764
815
|
if (!finite) this.resetCounts[index]++;
|
|
765
816
|
this.sink(rig.output.parameter, finite ? value : outDefault);
|
|
@@ -921,25 +972,25 @@ var HairChainMotion = class {
|
|
|
921
972
|
};
|
|
922
973
|
|
|
923
974
|
// ../engine/src/iki-motion.ts
|
|
924
|
-
var
|
|
975
|
+
var import_format5 = require("@ikijs/format");
|
|
925
976
|
|
|
926
977
|
// ../engine/src/clip-player.ts
|
|
927
|
-
var
|
|
978
|
+
var import_format3 = require("@ikijs/format");
|
|
928
979
|
|
|
929
980
|
// ../engine/src/expression-player.ts
|
|
930
|
-
var
|
|
981
|
+
var import_format4 = require("@ikijs/format");
|
|
931
982
|
|
|
932
983
|
// ../engine/src/iki-motion.ts
|
|
933
984
|
var HEAD_AND_GAZE = /* @__PURE__ */ new Set([
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
985
|
+
import_format5.StandardParameter.AngleX,
|
|
986
|
+
import_format5.StandardParameter.AngleY,
|
|
987
|
+
import_format5.StandardParameter.AngleZ,
|
|
988
|
+
import_format5.StandardParameter.EyeballX,
|
|
989
|
+
import_format5.StandardParameter.EyeballY
|
|
939
990
|
]);
|
|
940
991
|
|
|
941
992
|
// ../engine/src/folds.ts
|
|
942
|
-
var
|
|
993
|
+
var import_format6 = require("@ikijs/format");
|
|
943
994
|
|
|
944
995
|
// ../engine/src/land.ts
|
|
945
996
|
function staticDeformers(model) {
|
|
@@ -999,19 +1050,19 @@ function landPart(landing, store, { worlds, grids }) {
|
|
|
999
1050
|
var FLIP = 0;
|
|
1000
1051
|
var COLLAPSE = 0.1;
|
|
1001
1052
|
var ANGLES = [
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1053
|
+
import_format6.StandardParameter.AngleX,
|
|
1054
|
+
import_format6.StandardParameter.AngleY,
|
|
1055
|
+
import_format6.StandardParameter.AngleZ,
|
|
1056
|
+
import_format6.StandardParameter.BodyAngleX,
|
|
1057
|
+
import_format6.StandardParameter.BodyAngleY,
|
|
1058
|
+
import_format6.StandardParameter.BodyAngleZ
|
|
1008
1059
|
];
|
|
1009
1060
|
var CROSSES = [
|
|
1010
|
-
[
|
|
1011
|
-
[
|
|
1012
|
-
[
|
|
1013
|
-
[
|
|
1014
|
-
[
|
|
1061
|
+
[import_format6.StandardParameter.EyeOpenLeft],
|
|
1062
|
+
[import_format6.StandardParameter.EyeOpenRight],
|
|
1063
|
+
[import_format6.StandardParameter.MouthOpen],
|
|
1064
|
+
[import_format6.StandardParameter.ArmLeft, import_format6.StandardParameter.ArmRight],
|
|
1065
|
+
[import_format6.StandardParameter.ElbowLeft, import_format6.StandardParameter.ElbowRight]
|
|
1015
1066
|
];
|
|
1016
1067
|
function foldPoses(model) {
|
|
1017
1068
|
const byId = new Map(
|
|
@@ -1228,6 +1279,9 @@ function classify(worst) {
|
|
|
1228
1279
|
return "ok";
|
|
1229
1280
|
}
|
|
1230
1281
|
|
|
1282
|
+
// ../engine/src/physics-check.ts
|
|
1283
|
+
var import_format7 = require("@ikijs/format");
|
|
1284
|
+
|
|
1231
1285
|
// ../engine/src/physics-runs.ts
|
|
1232
1286
|
var FRAME_MS = FIXED_DT_S * 1e3 * (1 + 1e-9);
|
|
1233
1287
|
var STEP_FRAMES = 300;
|
|
@@ -1406,26 +1460,34 @@ function checkPhysics(model) {
|
|
|
1406
1460
|
};
|
|
1407
1461
|
const param = (id) => model.parameters.find((p) => p.id === id);
|
|
1408
1462
|
const springs = (model.physics ?? []).map((rig) => {
|
|
1409
|
-
const
|
|
1463
|
+
const inputs = (0, import_format7.physicsInputs)(rig).map((i) => param(i.parameter));
|
|
1464
|
+
const ids = inputs.map((p) => p.id);
|
|
1410
1465
|
const output = param(rig.output.parameter);
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
values
|
|
1419
|
-
|
|
1466
|
+
const ranged = inputs.flatMap((input) => {
|
|
1467
|
+
const far = farEnd(input);
|
|
1468
|
+
return far === void 0 ? [] : [{ [input.id]: far }];
|
|
1469
|
+
});
|
|
1470
|
+
const settings = ranged.length === 0 ? [{}] : ranged;
|
|
1471
|
+
const steps = settings.map((values) => {
|
|
1472
|
+
const reading = stepRun(model, [rig], [], values).get(output.id);
|
|
1473
|
+
const setting = inputs.length === 1 ? [] : Object.entries(values).map(([id, v]) => `${id}=${v}`);
|
|
1474
|
+
return {
|
|
1475
|
+
name: ["the step", ...setting].join(" "),
|
|
1476
|
+
reading,
|
|
1477
|
+
displacementPx: displace(output, reading.values),
|
|
1478
|
+
values
|
|
1479
|
+
};
|
|
1480
|
+
});
|
|
1420
1481
|
const atIdle = idleExcitation(output);
|
|
1482
|
+
const clean = steps.filter((s) => !unstableWhy(output, [s]));
|
|
1421
1483
|
return target(model, {
|
|
1422
1484
|
rig: { kind: "spring", id: rig.id },
|
|
1423
|
-
input:
|
|
1485
|
+
input: ids,
|
|
1424
1486
|
output,
|
|
1425
|
-
step,
|
|
1487
|
+
step: mostMoving(clean.length > 0 ? clean : steps),
|
|
1426
1488
|
idle: atIdle,
|
|
1427
|
-
unstable: springWhy(rig) ?? unstableWhy(output, [
|
|
1428
|
-
inert:
|
|
1489
|
+
unstable: springWhy(rig) ?? unstableWhy(output, [...steps, atIdle]),
|
|
1490
|
+
inert: ranged.length === 0 ? `${ids.join(", ")} ${ids.length === 1 ? "has" : "have"} no range` : void 0
|
|
1429
1491
|
});
|
|
1430
1492
|
});
|
|
1431
1493
|
const chains = (model.physicsChains ?? []).flatMap((chain) => {
|
|
@@ -1673,7 +1735,7 @@ function ratioText(ratio) {
|
|
|
1673
1735
|
// src/render-poses.ts
|
|
1674
1736
|
var import_node_fs3 = require("fs");
|
|
1675
1737
|
var import_node_path3 = __toESM(require("path"));
|
|
1676
|
-
var
|
|
1738
|
+
var import_format8 = require("@ikijs/format");
|
|
1677
1739
|
|
|
1678
1740
|
// src/limits.ts
|
|
1679
1741
|
var import_node_fs = __toESM(require("fs"));
|
|
@@ -2174,9 +2236,9 @@ function planRenders(model, requested) {
|
|
|
2174
2236
|
}
|
|
2175
2237
|
const bodyAngles = Object.fromEntries(
|
|
2176
2238
|
[
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2239
|
+
import_format8.StandardParameter.BodyAngleX,
|
|
2240
|
+
import_format8.StandardParameter.BodyAngleY,
|
|
2241
|
+
import_format8.StandardParameter.BodyAngleZ
|
|
2180
2242
|
].filter((id) => model.parameters.some((p) => p.id === id)).map((id) => [id, -10])
|
|
2181
2243
|
);
|
|
2182
2244
|
const poses = [
|
|
@@ -2262,7 +2324,7 @@ function planRenders(model, requested) {
|
|
|
2262
2324
|
whole("full-elbow-r-45", { ParamElbowR: 45 }),
|
|
2263
2325
|
whole("full-elbow-r-90", { ParamElbowR: 90 })
|
|
2264
2326
|
);
|
|
2265
|
-
if (model.parameters.some((p) => p.id ===
|
|
2327
|
+
if (model.parameters.some((p) => p.id === import_format8.StandardParameter.ArmPoseRight)) {
|
|
2266
2328
|
poses.push(
|
|
2267
2329
|
whole("full-pose-l", { ParamArmPoseL: 1 }),
|
|
2268
2330
|
whole("full-pose-r", { ParamArmPoseR: 1 }),
|
|
@@ -2327,7 +2389,7 @@ async function renderPoses(input) {
|
|
|
2327
2389
|
input.modelPath
|
|
2328
2390
|
);
|
|
2329
2391
|
const outDir = resolveOutputDir(input.outDir);
|
|
2330
|
-
const model = (0,
|
|
2392
|
+
const model = (0, import_format8.loadIkiModel)((0, import_node_fs3.readFileSync)(modelFile, "utf8"));
|
|
2331
2393
|
const plan = planRenders(model, input.poses);
|
|
2332
2394
|
const browser = findBrowser();
|
|
2333
2395
|
if (!browser) return { ok: false, error: NO_BROWSER_MESSAGE };
|
|
@@ -2377,7 +2439,7 @@ async function renderPoses(input) {
|
|
|
2377
2439
|
physics
|
|
2378
2440
|
};
|
|
2379
2441
|
} catch (error) {
|
|
2380
|
-
if (error instanceof AutoRigInputError || error instanceof
|
|
2442
|
+
if (error instanceof AutoRigInputError || error instanceof import_format8.IkiFormatError) {
|
|
2381
2443
|
return { ok: false, error: error.message };
|
|
2382
2444
|
}
|
|
2383
2445
|
throw error;
|
|
@@ -2454,10 +2516,10 @@ async function renderAtlasToDataUri(crops, layout, quantizeColors) {
|
|
|
2454
2516
|
// src/tools.ts
|
|
2455
2517
|
function coerceModel(model) {
|
|
2456
2518
|
try {
|
|
2457
|
-
const parsed = typeof model === "string" ? (0,
|
|
2519
|
+
const parsed = typeof model === "string" ? (0, import_format9.loadIkiModel)(model) : (0, import_format9.parseIkiModel)(model);
|
|
2458
2520
|
return { ok: true, model: parsed };
|
|
2459
2521
|
} catch (e) {
|
|
2460
|
-
if (e instanceof
|
|
2522
|
+
if (e instanceof import_format9.IkiFormatError) return { ok: false, error: e.message };
|
|
2461
2523
|
throw e;
|
|
2462
2524
|
}
|
|
2463
2525
|
}
|
|
@@ -2574,115 +2636,123 @@ function describeIkiAt(modelPath) {
|
|
|
2574
2636
|
}
|
|
2575
2637
|
var STANDARD_PARAMETER_INFO = [
|
|
2576
2638
|
{
|
|
2577
|
-
id:
|
|
2639
|
+
id: import_format9.StandardParameter.MouthOpen,
|
|
2578
2640
|
description: "Mouth open amount for lip-sync (0 closed .. 1 open)."
|
|
2579
2641
|
},
|
|
2580
2642
|
{
|
|
2581
|
-
id:
|
|
2643
|
+
id: import_format9.StandardParameter.MouthForm,
|
|
2582
2644
|
description: "Mouth form / smile (-1 .. 1)."
|
|
2583
2645
|
},
|
|
2584
2646
|
{
|
|
2585
|
-
id:
|
|
2647
|
+
id: import_format9.StandardParameter.EyeOpenLeft,
|
|
2586
2648
|
description: "Left eye open (0 closed .. 1 open). Drive with the right eye for a blink."
|
|
2587
2649
|
},
|
|
2588
2650
|
{
|
|
2589
|
-
id:
|
|
2651
|
+
id: import_format9.StandardParameter.EyeOpenRight,
|
|
2590
2652
|
description: "Right eye open (0 closed .. 1 open)."
|
|
2591
2653
|
},
|
|
2592
2654
|
{
|
|
2593
|
-
id:
|
|
2655
|
+
id: import_format9.StandardParameter.EyeballX,
|
|
2594
2656
|
description: "Eyeball gaze, horizontal (-1 .. 1)."
|
|
2595
2657
|
},
|
|
2596
2658
|
{
|
|
2597
|
-
id:
|
|
2659
|
+
id: import_format9.StandardParameter.EyeballY,
|
|
2598
2660
|
description: "Eyeball gaze, vertical (-1 .. 1)."
|
|
2599
2661
|
},
|
|
2600
2662
|
{
|
|
2601
|
-
id:
|
|
2663
|
+
id: import_format9.StandardParameter.AngleX,
|
|
2602
2664
|
description: "Head angle, horizontal degrees."
|
|
2603
2665
|
},
|
|
2604
2666
|
{
|
|
2605
|
-
id:
|
|
2667
|
+
id: import_format9.StandardParameter.AngleY,
|
|
2606
2668
|
description: "Head angle, vertical degrees."
|
|
2607
2669
|
},
|
|
2608
2670
|
{
|
|
2609
|
-
id:
|
|
2671
|
+
id: import_format9.StandardParameter.AngleZ,
|
|
2610
2672
|
description: "Head tilt / roll degrees; positive tilts the top of the head toward the viewer's right (clockwise), as in Live2D."
|
|
2611
2673
|
},
|
|
2612
2674
|
{
|
|
2613
|
-
id:
|
|
2675
|
+
id: import_format9.StandardParameter.BodyAngleX,
|
|
2614
2676
|
description: "Body turn, degrees (-10 .. 10); positive turns the body toward the viewer's right, as AngleX does the head."
|
|
2615
2677
|
},
|
|
2616
2678
|
{
|
|
2617
|
-
id:
|
|
2679
|
+
id: import_format9.StandardParameter.BodyAngleY,
|
|
2618
2680
|
description: "Body lean, degrees (-10 .. 10); positive moves the upper body up, negative bows."
|
|
2619
2681
|
},
|
|
2620
2682
|
{
|
|
2621
|
-
id:
|
|
2683
|
+
id: import_format9.StandardParameter.BodyAngleZ,
|
|
2622
2684
|
description: "Body tilt, degrees (-10 .. 10); positive tilts the top toward the viewer's right (clockwise), as AngleZ does the head."
|
|
2623
2685
|
},
|
|
2624
2686
|
{
|
|
2625
|
-
id:
|
|
2687
|
+
id: import_format9.StandardParameter.Breath,
|
|
2626
2688
|
description: "Idle breath (0 .. 1), cycled by the host."
|
|
2627
2689
|
},
|
|
2628
2690
|
{
|
|
2629
|
-
id:
|
|
2691
|
+
id: import_format9.StandardParameter.AmbientSway,
|
|
2692
|
+
description: "Ambient sway (-1 .. 1): a slow zero-mean drift the idle writes for physics rigs to follow (the auto-rig's hair in idle). Not a wind: no bias. Stays procedural under a declared Idle group, as Breath does."
|
|
2693
|
+
},
|
|
2694
|
+
{
|
|
2695
|
+
id: import_format9.StandardParameter.BrowLeftY,
|
|
2630
2696
|
description: "Left brow raise/lower (-1 .. 1)."
|
|
2631
2697
|
},
|
|
2632
2698
|
{
|
|
2633
|
-
id:
|
|
2699
|
+
id: import_format9.StandardParameter.BrowRightY,
|
|
2634
2700
|
description: "Right brow raise/lower (-1 .. 1)."
|
|
2635
2701
|
},
|
|
2636
2702
|
{
|
|
2637
|
-
id:
|
|
2703
|
+
id: import_format9.StandardParameter.BrowLeftAngle,
|
|
2638
2704
|
description: "Left brow tilt/angle (-1 .. 1)."
|
|
2639
2705
|
},
|
|
2640
2706
|
{
|
|
2641
|
-
id:
|
|
2707
|
+
id: import_format9.StandardParameter.BrowRightAngle,
|
|
2642
2708
|
description: "Right brow tilt/angle (-1 .. 1)."
|
|
2643
2709
|
},
|
|
2644
2710
|
{
|
|
2645
|
-
id:
|
|
2711
|
+
id: import_format9.StandardParameter.Cheek,
|
|
2646
2712
|
description: "Cheek blush strength (0 .. 1), raised by an expression."
|
|
2647
2713
|
},
|
|
2648
2714
|
{
|
|
2649
|
-
id:
|
|
2650
|
-
description: "
|
|
2715
|
+
id: import_format9.StandardParameter.HairSwayX,
|
|
2716
|
+
description: "Front hair's horizontal sway driver. Physics OUTPUT \u2014 driven by the spring, hosts should not set it directly."
|
|
2717
|
+
},
|
|
2718
|
+
{
|
|
2719
|
+
id: import_format9.StandardParameter.HairSwayZ,
|
|
2720
|
+
description: "Front hair's sway driver behind a head tilt. Physics OUTPUT \u2014 driven by the spring, hosts should not set it directly."
|
|
2651
2721
|
},
|
|
2652
2722
|
{
|
|
2653
|
-
id:
|
|
2654
|
-
description: "
|
|
2723
|
+
id: import_format9.StandardParameter.HairBackSway,
|
|
2724
|
+
description: "Back hair's sway driver behind the head turn, tilt and ambient drift, one spring slower than the front hair's so the two swing out of phase. Physics OUTPUT \u2014 driven by the spring, hosts should not set it directly."
|
|
2655
2725
|
},
|
|
2656
2726
|
{
|
|
2657
|
-
id:
|
|
2727
|
+
id: import_format9.StandardParameter.ArmLeft,
|
|
2658
2728
|
description: "Left shoulder, degrees; positive raises the arm outward (mirrored on the right)."
|
|
2659
2729
|
},
|
|
2660
2730
|
{
|
|
2661
|
-
id:
|
|
2731
|
+
id: import_format9.StandardParameter.ArmRight,
|
|
2662
2732
|
description: "Right shoulder, degrees; positive raises the arm outward (mirrored on the left)."
|
|
2663
2733
|
},
|
|
2664
2734
|
{
|
|
2665
|
-
id:
|
|
2735
|
+
id: import_format9.StandardParameter.ElbowLeft,
|
|
2666
2736
|
description: "Left elbow, degrees; positive bends the forearm toward the body (the flexion of a hanging arm), negative a little outward (mirrored on the right)."
|
|
2667
2737
|
},
|
|
2668
2738
|
{
|
|
2669
|
-
id:
|
|
2739
|
+
id: import_format9.StandardParameter.ElbowRight,
|
|
2670
2740
|
description: "Right elbow, degrees; positive bends the forearm toward the body (the flexion of a hanging arm), negative a little outward (mirrored on the left)."
|
|
2671
2741
|
},
|
|
2672
2742
|
{
|
|
2673
|
-
id:
|
|
2743
|
+
id: import_format9.StandardParameter.ArmPoseLeft,
|
|
2674
2744
|
description: "Left pose-forearm switch, 0..1; 0 the hanging forearm, 1 the drawn pose forearm, between them a crossfade of the two. Declared by auto-rigged models with a pose forearm."
|
|
2675
2745
|
},
|
|
2676
2746
|
{
|
|
2677
|
-
id:
|
|
2747
|
+
id: import_format9.StandardParameter.ArmPoseRight,
|
|
2678
2748
|
description: "Right pose-forearm switch, 0..1; 0 the hanging forearm, 1 the drawn pose forearm, between them a crossfade of the two. Declared by auto-rigged models with a pose forearm."
|
|
2679
2749
|
},
|
|
2680
2750
|
{
|
|
2681
|
-
id:
|
|
2751
|
+
id: import_format9.StandardParameter.ArmPoseAngleLeft,
|
|
2682
2752
|
description: "Left pose forearm's own small rotation about the elbow, degrees; positive tips the raised hand outward, away from the body (mirrored on the right)."
|
|
2683
2753
|
},
|
|
2684
2754
|
{
|
|
2685
|
-
id:
|
|
2755
|
+
id: import_format9.StandardParameter.ArmPoseAngleRight,
|
|
2686
2756
|
description: "Right pose forearm's own small rotation about the elbow, degrees; positive tips the raised hand outward, away from the body (mirrored on the left)."
|
|
2687
2757
|
}
|
|
2688
2758
|
];
|
|
@@ -2882,7 +2952,7 @@ async function autoRigFromLayers(input) {
|
|
|
2882
2952
|
patched.parts.find((p) => p.id === partId).texture.index = 1;
|
|
2883
2953
|
}
|
|
2884
2954
|
}
|
|
2885
|
-
const finalModel = (0,
|
|
2955
|
+
const finalModel = (0, import_format9.parseIkiModel)(patched);
|
|
2886
2956
|
writeFileAtomic(outPath, JSON.stringify(finalModel));
|
|
2887
2957
|
const folds = checkModelFolds(finalModel);
|
|
2888
2958
|
const physics = checkPhysics(finalModel);
|
|
@@ -5601,7 +5671,7 @@ function formatPatchReports(reports) {
|
|
|
5601
5671
|
});
|
|
5602
5672
|
}
|
|
5603
5673
|
function createIkiMcpServer() {
|
|
5604
|
-
const server = new import_mcp.McpServer({ name: "iki", version: "0.
|
|
5674
|
+
const server = new import_mcp.McpServer({ name: "iki", version: "0.29.0" });
|
|
5605
5675
|
server.registerTool(
|
|
5606
5676
|
"validate_iki",
|
|
5607
5677
|
{
|