@ikijs/mcp 0.27.0 → 0.28.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 +1 -1
- package/dist/{chunk-7POOGY7U.mjs → chunk-D2OLX5S7.mjs} +93 -32
- package/dist/chunk-D2OLX5S7.mjs.map +1 -0
- package/dist/cli.js +147 -90
- 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 +147 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/render-page.global.js +6 -1
- package/package.json +4 -4
- package/dist/chunk-7POOGY7U.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -81,7 +81,10 @@ interface PhysicsTarget {
|
|
|
81
81
|
id: string;
|
|
82
82
|
segment: number;
|
|
83
83
|
};
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* The spring's inputs, in rig order; for a chain, every parameter that turns
|
|
86
|
+
* its anchor.
|
|
87
|
+
*/
|
|
85
88
|
input: string[];
|
|
86
89
|
/** The driven parameter. */
|
|
87
90
|
output: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,10 @@ interface PhysicsTarget {
|
|
|
81
81
|
id: string;
|
|
82
82
|
segment: number;
|
|
83
83
|
};
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* The spring's inputs, in rig order; for a chain, every parameter that turns
|
|
86
|
+
* its anchor.
|
|
87
|
+
*/
|
|
85
88
|
input: string[];
|
|
86
89
|
/** The driven parameter. */
|
|
87
90
|
output: string;
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
|
55
55
|
// src/tools.ts
|
|
56
56
|
var import_node_fs4 = require("fs");
|
|
57
57
|
var import_node_path4 = __toESM(require("path"));
|
|
58
|
-
var
|
|
58
|
+
var import_format9 = require("@ikijs/format");
|
|
59
59
|
var import_editor3 = require("@ikijs/editor");
|
|
60
60
|
|
|
61
61
|
// ../engine/src/math.ts
|
|
@@ -530,6 +530,10 @@ var SWAY_Y_AMP_DEG = 1.6;
|
|
|
530
530
|
var SWAY_Y_PERIOD_MS = 7300;
|
|
531
531
|
var SWAY_Z_AMP_DEG = 1.1;
|
|
532
532
|
var SWAY_Z_PERIOD_MS = 11300;
|
|
533
|
+
var AMBIENT_AMP_A = 0.6;
|
|
534
|
+
var AMBIENT_PERIOD_A_MS = 2900;
|
|
535
|
+
var AMBIENT_AMP_B = 0.4;
|
|
536
|
+
var AMBIENT_PERIOD_B_MS = 4300;
|
|
533
537
|
function blinkEnvelope(phase) {
|
|
534
538
|
const ms = phase * BLINK_DURATION_MS;
|
|
535
539
|
if (ms <= 0) return 1;
|
|
@@ -561,7 +565,8 @@ var IdleMotion = class {
|
|
|
561
565
|
import_format.StandardParameter.EyeballY,
|
|
562
566
|
import_format.StandardParameter.AngleX,
|
|
563
567
|
import_format.StandardParameter.AngleY,
|
|
564
|
-
import_format.StandardParameter.AngleZ
|
|
568
|
+
import_format.StandardParameter.AngleZ,
|
|
569
|
+
import_format.StandardParameter.AmbientSway
|
|
565
570
|
];
|
|
566
571
|
sink;
|
|
567
572
|
rng;
|
|
@@ -625,6 +630,7 @@ var IdleMotion = class {
|
|
|
625
630
|
this.sink(import_format.StandardParameter.AngleX, this.swayX());
|
|
626
631
|
this.sink(import_format.StandardParameter.AngleY, this.swayY());
|
|
627
632
|
this.sink(import_format.StandardParameter.AngleZ, this.swayZ());
|
|
633
|
+
this.sink(import_format.StandardParameter.AmbientSway, this.ambientSway());
|
|
628
634
|
}
|
|
629
635
|
// ---------------------------------------------------------------------------
|
|
630
636
|
// Private helpers
|
|
@@ -638,6 +644,7 @@ var IdleMotion = class {
|
|
|
638
644
|
this.sink(import_format.StandardParameter.AngleX, 0);
|
|
639
645
|
this.sink(import_format.StandardParameter.AngleY, 0);
|
|
640
646
|
this.sink(import_format.StandardParameter.AngleZ, 0);
|
|
647
|
+
this.sink(import_format.StandardParameter.AmbientSway, 0);
|
|
641
648
|
}
|
|
642
649
|
/** Returns the current eye-open value (0..1) and advances blink state. */
|
|
643
650
|
advanceBlink() {
|
|
@@ -673,6 +680,11 @@ var IdleMotion = class {
|
|
|
673
680
|
swayZ() {
|
|
674
681
|
return SWAY_Z_AMP_DEG * Math.sin(2 * Math.PI * this.clockMs / SWAY_Z_PERIOD_MS);
|
|
675
682
|
}
|
|
683
|
+
/** Ambient sway (-1..1), pure function of the internal clock. */
|
|
684
|
+
ambientSway() {
|
|
685
|
+
const t = 2 * Math.PI * this.clockMs;
|
|
686
|
+
return AMBIENT_AMP_A * Math.sin(t / AMBIENT_PERIOD_A_MS) + AMBIENT_AMP_B * Math.sin(t / AMBIENT_PERIOD_B_MS);
|
|
687
|
+
}
|
|
676
688
|
/** Ease gaze current toward target; pick a new target on the internal clock. */
|
|
677
689
|
advanceGaze(dt) {
|
|
678
690
|
if (this.clockMs >= this.nextGazeRetargetMs) {
|
|
@@ -688,6 +700,7 @@ var IdleMotion = class {
|
|
|
688
700
|
};
|
|
689
701
|
|
|
690
702
|
// ../engine/src/physics-motion.ts
|
|
703
|
+
var import_format2 = require("@ikijs/format");
|
|
691
704
|
function signedNormalized(value, param) {
|
|
692
705
|
const rest = clamp(param.default, param.min, param.max);
|
|
693
706
|
const den = Math.max(Math.abs(param.max - rest), Math.abs(rest - param.min));
|
|
@@ -705,6 +718,7 @@ var PhysicsMotion = class {
|
|
|
705
718
|
resets;
|
|
706
719
|
resetCounts;
|
|
707
720
|
rigs;
|
|
721
|
+
inputs;
|
|
708
722
|
read;
|
|
709
723
|
sink;
|
|
710
724
|
params;
|
|
@@ -713,10 +727,17 @@ var PhysicsMotion = class {
|
|
|
713
727
|
clock = new FixedStepClock();
|
|
714
728
|
constructor(rigs, params, read, sink) {
|
|
715
729
|
this.rigs = rigs;
|
|
730
|
+
this.inputs = rigs.map(
|
|
731
|
+
(rig) => (0, import_format2.physicsInputs)(rig).map(({ parameter, weight, mode }) => ({
|
|
732
|
+
parameter,
|
|
733
|
+
weight,
|
|
734
|
+
lag: mode === "lag"
|
|
735
|
+
}))
|
|
736
|
+
);
|
|
716
737
|
this.read = read;
|
|
717
738
|
this.sink = sink;
|
|
718
739
|
this.params = new Map(params.map((p) => [p.id, p]));
|
|
719
|
-
this.state = rigs.map(() => ({ x: 0, v: 0 }));
|
|
740
|
+
this.state = rigs.map(() => ({ x: 0, v: 0, lag: 0 }));
|
|
720
741
|
this.drivenParameterIds = rigs.map((rig) => rig.output.parameter);
|
|
721
742
|
this.resetCounts = rigs.map(() => 0);
|
|
722
743
|
this.resets = this.resetCounts;
|
|
@@ -725,8 +746,12 @@ var PhysicsMotion = class {
|
|
|
725
746
|
* Advance every rig to the given wall-clock timestamp (milliseconds).
|
|
726
747
|
*
|
|
727
748
|
* First call: seed each spring to rest AT its current target (so a model
|
|
728
|
-
* loaded with a nonzero input does not kick
|
|
729
|
-
* return without integrating —
|
|
749
|
+
* loaded with a nonzero input does not kick: a lag input emits rest, a follow
|
|
750
|
+
* input its value), emit that output, and return without integrating —
|
|
751
|
+
* mirroring IdleMotion's first-frame behavior.
|
|
752
|
+
*
|
|
753
|
+
* A non-finite `nowMs` after that is a dropped frame: every rig re-emits its
|
|
754
|
+
* last output from its stored state without reading its inputs.
|
|
730
755
|
*
|
|
731
756
|
* Subsequent calls: {@link FixedStepClock} folds the clamped frame delta into
|
|
732
757
|
* its accumulator and returns how many {@link FIXED_DT_S} sub-steps are due;
|
|
@@ -739,35 +764,52 @@ var PhysicsMotion = class {
|
|
|
739
764
|
this.clock.advance(nowMs);
|
|
740
765
|
for (let i = 0; i < this.rigs.length; i++) {
|
|
741
766
|
const st = this.state[i];
|
|
742
|
-
|
|
767
|
+
const { target: target2, lag } = this.targetFor(i);
|
|
768
|
+
st.x = target2;
|
|
743
769
|
st.v = 0;
|
|
770
|
+
st.lag = lag;
|
|
744
771
|
this.emit(i, st);
|
|
745
772
|
}
|
|
746
773
|
return;
|
|
747
774
|
}
|
|
775
|
+
if (!Number.isFinite(nowMs)) {
|
|
776
|
+
for (let i = 0; i < this.rigs.length; i++) this.emit(i, this.state[i]);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
748
779
|
const steps = this.clock.advance(nowMs);
|
|
749
|
-
const targets = this.rigs.map((
|
|
780
|
+
const targets = this.rigs.map((_, i) => this.targetFor(i));
|
|
750
781
|
for (let s = 0; s < steps; s++) {
|
|
751
782
|
for (let i = 0; i < this.rigs.length; i++) {
|
|
752
|
-
this.step(this.rigs[i], this.state[i], targets[i]);
|
|
783
|
+
this.step(this.rigs[i], this.state[i], targets[i].target);
|
|
753
784
|
}
|
|
754
785
|
}
|
|
755
786
|
for (let i = 0; i < this.rigs.length; i++) {
|
|
756
787
|
const st = this.state[i];
|
|
788
|
+
const { target: target2, lag } = targets[i];
|
|
757
789
|
if (!Number.isFinite(st.x) || !Number.isFinite(st.v)) {
|
|
758
|
-
st.x = Number.isFinite(
|
|
790
|
+
st.x = Number.isFinite(target2) ? target2 : 0;
|
|
759
791
|
st.v = 0;
|
|
760
792
|
this.resetCounts[i]++;
|
|
761
793
|
}
|
|
794
|
+
st.lag = lag;
|
|
762
795
|
this.emit(i, st);
|
|
763
796
|
}
|
|
764
797
|
}
|
|
765
|
-
/**
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
798
|
+
/**
|
|
799
|
+
* Rig `index`'s spring target `T` = Σ signed-normalized input value × weight,
|
|
800
|
+
* and `L`, the lag inputs' share of it. Reads each input once.
|
|
801
|
+
*/
|
|
802
|
+
targetFor(index) {
|
|
803
|
+
let target2 = 0;
|
|
804
|
+
let lag = 0;
|
|
805
|
+
for (const input of this.inputs[index]) {
|
|
806
|
+
const param = this.params.get(input.parameter);
|
|
807
|
+
const value = this.read(input.parameter);
|
|
808
|
+
const share = (param ? signedNormalized(value, param) : 0) * input.weight;
|
|
809
|
+
target2 += share;
|
|
810
|
+
if (input.lag) lag += share;
|
|
811
|
+
}
|
|
812
|
+
return { target: target2, lag };
|
|
771
813
|
}
|
|
772
814
|
/** One semi-implicit (symplectic) Euler sub-step of FIXED_DT_S seconds. */
|
|
773
815
|
step(rig, st, target2) {
|
|
@@ -775,12 +817,12 @@ var PhysicsMotion = class {
|
|
|
775
817
|
st.v += accel * FIXED_DT_S;
|
|
776
818
|
st.x += st.v * FIXED_DT_S;
|
|
777
819
|
}
|
|
778
|
-
/** Write outputDefault + x * scale onto the output param via the sink. */
|
|
820
|
+
/** Write outputDefault + (x − L) * scale onto the output param via the sink. */
|
|
779
821
|
emit(index, st) {
|
|
780
822
|
const rig = this.rigs[index];
|
|
781
823
|
const outParam = this.params.get(rig.output.parameter);
|
|
782
824
|
const outDefault = outParam ? clamp(outParam.default, outParam.min, outParam.max) : 0;
|
|
783
|
-
const value = outDefault + st.x * rig.output.scale;
|
|
825
|
+
const value = outDefault + (st.x - st.lag) * rig.output.scale;
|
|
784
826
|
const finite = Number.isFinite(value);
|
|
785
827
|
if (!finite) this.resetCounts[index]++;
|
|
786
828
|
this.sink(rig.output.parameter, finite ? value : outDefault);
|
|
@@ -942,25 +984,25 @@ var HairChainMotion = class {
|
|
|
942
984
|
};
|
|
943
985
|
|
|
944
986
|
// ../engine/src/iki-motion.ts
|
|
945
|
-
var
|
|
987
|
+
var import_format5 = require("@ikijs/format");
|
|
946
988
|
|
|
947
989
|
// ../engine/src/clip-player.ts
|
|
948
|
-
var
|
|
990
|
+
var import_format3 = require("@ikijs/format");
|
|
949
991
|
|
|
950
992
|
// ../engine/src/expression-player.ts
|
|
951
|
-
var
|
|
993
|
+
var import_format4 = require("@ikijs/format");
|
|
952
994
|
|
|
953
995
|
// ../engine/src/iki-motion.ts
|
|
954
996
|
var HEAD_AND_GAZE = /* @__PURE__ */ new Set([
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
997
|
+
import_format5.StandardParameter.AngleX,
|
|
998
|
+
import_format5.StandardParameter.AngleY,
|
|
999
|
+
import_format5.StandardParameter.AngleZ,
|
|
1000
|
+
import_format5.StandardParameter.EyeballX,
|
|
1001
|
+
import_format5.StandardParameter.EyeballY
|
|
960
1002
|
]);
|
|
961
1003
|
|
|
962
1004
|
// ../engine/src/folds.ts
|
|
963
|
-
var
|
|
1005
|
+
var import_format6 = require("@ikijs/format");
|
|
964
1006
|
|
|
965
1007
|
// ../engine/src/land.ts
|
|
966
1008
|
function staticDeformers(model) {
|
|
@@ -1020,19 +1062,19 @@ function landPart(landing, store, { worlds, grids }) {
|
|
|
1020
1062
|
var FLIP = 0;
|
|
1021
1063
|
var COLLAPSE = 0.1;
|
|
1022
1064
|
var ANGLES = [
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1065
|
+
import_format6.StandardParameter.AngleX,
|
|
1066
|
+
import_format6.StandardParameter.AngleY,
|
|
1067
|
+
import_format6.StandardParameter.AngleZ,
|
|
1068
|
+
import_format6.StandardParameter.BodyAngleX,
|
|
1069
|
+
import_format6.StandardParameter.BodyAngleY,
|
|
1070
|
+
import_format6.StandardParameter.BodyAngleZ
|
|
1029
1071
|
];
|
|
1030
1072
|
var CROSSES = [
|
|
1031
|
-
[
|
|
1032
|
-
[
|
|
1033
|
-
[
|
|
1034
|
-
[
|
|
1035
|
-
[
|
|
1073
|
+
[import_format6.StandardParameter.EyeOpenLeft],
|
|
1074
|
+
[import_format6.StandardParameter.EyeOpenRight],
|
|
1075
|
+
[import_format6.StandardParameter.MouthOpen],
|
|
1076
|
+
[import_format6.StandardParameter.ArmLeft, import_format6.StandardParameter.ArmRight],
|
|
1077
|
+
[import_format6.StandardParameter.ElbowLeft, import_format6.StandardParameter.ElbowRight]
|
|
1036
1078
|
];
|
|
1037
1079
|
function foldPoses(model) {
|
|
1038
1080
|
const byId = new Map(
|
|
@@ -1249,6 +1291,9 @@ function classify(worst) {
|
|
|
1249
1291
|
return "ok";
|
|
1250
1292
|
}
|
|
1251
1293
|
|
|
1294
|
+
// ../engine/src/physics-check.ts
|
|
1295
|
+
var import_format7 = require("@ikijs/format");
|
|
1296
|
+
|
|
1252
1297
|
// ../engine/src/physics-runs.ts
|
|
1253
1298
|
var FRAME_MS = FIXED_DT_S * 1e3 * (1 + 1e-9);
|
|
1254
1299
|
var STEP_FRAMES = 300;
|
|
@@ -1427,26 +1472,34 @@ function checkPhysics(model) {
|
|
|
1427
1472
|
};
|
|
1428
1473
|
const param = (id) => model.parameters.find((p) => p.id === id);
|
|
1429
1474
|
const springs = (model.physics ?? []).map((rig) => {
|
|
1430
|
-
const
|
|
1475
|
+
const inputs = (0, import_format7.physicsInputs)(rig).map((i) => param(i.parameter));
|
|
1476
|
+
const ids = inputs.map((p) => p.id);
|
|
1431
1477
|
const output = param(rig.output.parameter);
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
values
|
|
1440
|
-
|
|
1478
|
+
const ranged = inputs.flatMap((input) => {
|
|
1479
|
+
const far = farEnd(input);
|
|
1480
|
+
return far === void 0 ? [] : [{ [input.id]: far }];
|
|
1481
|
+
});
|
|
1482
|
+
const settings = ranged.length === 0 ? [{}] : ranged;
|
|
1483
|
+
const steps = settings.map((values) => {
|
|
1484
|
+
const reading = stepRun(model, [rig], [], values).get(output.id);
|
|
1485
|
+
const setting = inputs.length === 1 ? [] : Object.entries(values).map(([id, v]) => `${id}=${v}`);
|
|
1486
|
+
return {
|
|
1487
|
+
name: ["the step", ...setting].join(" "),
|
|
1488
|
+
reading,
|
|
1489
|
+
displacementPx: displace(output, reading.values),
|
|
1490
|
+
values
|
|
1491
|
+
};
|
|
1492
|
+
});
|
|
1441
1493
|
const atIdle = idleExcitation(output);
|
|
1494
|
+
const clean = steps.filter((s) => !unstableWhy(output, [s]));
|
|
1442
1495
|
return target(model, {
|
|
1443
1496
|
rig: { kind: "spring", id: rig.id },
|
|
1444
|
-
input:
|
|
1497
|
+
input: ids,
|
|
1445
1498
|
output,
|
|
1446
|
-
step,
|
|
1499
|
+
step: mostMoving(clean.length > 0 ? clean : steps),
|
|
1447
1500
|
idle: atIdle,
|
|
1448
|
-
unstable: springWhy(rig) ?? unstableWhy(output, [
|
|
1449
|
-
inert:
|
|
1501
|
+
unstable: springWhy(rig) ?? unstableWhy(output, [...steps, atIdle]),
|
|
1502
|
+
inert: ranged.length === 0 ? `${ids.join(", ")} ${ids.length === 1 ? "has" : "have"} no range` : void 0
|
|
1450
1503
|
});
|
|
1451
1504
|
});
|
|
1452
1505
|
const chains = (model.physicsChains ?? []).flatMap((chain) => {
|
|
@@ -1694,7 +1747,7 @@ function ratioText(ratio) {
|
|
|
1694
1747
|
// src/render-poses.ts
|
|
1695
1748
|
var import_node_fs3 = require("fs");
|
|
1696
1749
|
var import_node_path3 = __toESM(require("path"));
|
|
1697
|
-
var
|
|
1750
|
+
var import_format8 = require("@ikijs/format");
|
|
1698
1751
|
|
|
1699
1752
|
// src/limits.ts
|
|
1700
1753
|
var import_node_fs = __toESM(require("fs"));
|
|
@@ -2195,9 +2248,9 @@ function planRenders(model, requested) {
|
|
|
2195
2248
|
}
|
|
2196
2249
|
const bodyAngles = Object.fromEntries(
|
|
2197
2250
|
[
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2251
|
+
import_format8.StandardParameter.BodyAngleX,
|
|
2252
|
+
import_format8.StandardParameter.BodyAngleY,
|
|
2253
|
+
import_format8.StandardParameter.BodyAngleZ
|
|
2201
2254
|
].filter((id) => model.parameters.some((p) => p.id === id)).map((id) => [id, -10])
|
|
2202
2255
|
);
|
|
2203
2256
|
const poses = [
|
|
@@ -2283,7 +2336,7 @@ function planRenders(model, requested) {
|
|
|
2283
2336
|
whole("full-elbow-r-45", { ParamElbowR: 45 }),
|
|
2284
2337
|
whole("full-elbow-r-90", { ParamElbowR: 90 })
|
|
2285
2338
|
);
|
|
2286
|
-
if (model.parameters.some((p) => p.id ===
|
|
2339
|
+
if (model.parameters.some((p) => p.id === import_format8.StandardParameter.ArmPoseRight)) {
|
|
2287
2340
|
poses.push(
|
|
2288
2341
|
whole("full-pose-l", { ParamArmPoseL: 1 }),
|
|
2289
2342
|
whole("full-pose-r", { ParamArmPoseR: 1 }),
|
|
@@ -2348,7 +2401,7 @@ async function renderPoses(input) {
|
|
|
2348
2401
|
input.modelPath
|
|
2349
2402
|
);
|
|
2350
2403
|
const outDir = resolveOutputDir(input.outDir);
|
|
2351
|
-
const model = (0,
|
|
2404
|
+
const model = (0, import_format8.loadIkiModel)((0, import_node_fs3.readFileSync)(modelFile, "utf8"));
|
|
2352
2405
|
const plan = planRenders(model, input.poses);
|
|
2353
2406
|
const browser = findBrowser();
|
|
2354
2407
|
if (!browser) return { ok: false, error: NO_BROWSER_MESSAGE };
|
|
@@ -2398,7 +2451,7 @@ async function renderPoses(input) {
|
|
|
2398
2451
|
physics
|
|
2399
2452
|
};
|
|
2400
2453
|
} catch (error) {
|
|
2401
|
-
if (error instanceof AutoRigInputError || error instanceof
|
|
2454
|
+
if (error instanceof AutoRigInputError || error instanceof import_format8.IkiFormatError) {
|
|
2402
2455
|
return { ok: false, error: error.message };
|
|
2403
2456
|
}
|
|
2404
2457
|
throw error;
|
|
@@ -2475,10 +2528,10 @@ async function renderAtlasToDataUri(crops, layout, quantizeColors) {
|
|
|
2475
2528
|
// src/tools.ts
|
|
2476
2529
|
function coerceModel(model) {
|
|
2477
2530
|
try {
|
|
2478
|
-
const parsed = typeof model === "string" ? (0,
|
|
2531
|
+
const parsed = typeof model === "string" ? (0, import_format9.loadIkiModel)(model) : (0, import_format9.parseIkiModel)(model);
|
|
2479
2532
|
return { ok: true, model: parsed };
|
|
2480
2533
|
} catch (e) {
|
|
2481
|
-
if (e instanceof
|
|
2534
|
+
if (e instanceof import_format9.IkiFormatError) return { ok: false, error: e.message };
|
|
2482
2535
|
throw e;
|
|
2483
2536
|
}
|
|
2484
2537
|
}
|
|
@@ -2595,115 +2648,119 @@ function describeIkiAt(modelPath) {
|
|
|
2595
2648
|
}
|
|
2596
2649
|
var STANDARD_PARAMETER_INFO = [
|
|
2597
2650
|
{
|
|
2598
|
-
id:
|
|
2651
|
+
id: import_format9.StandardParameter.MouthOpen,
|
|
2599
2652
|
description: "Mouth open amount for lip-sync (0 closed .. 1 open)."
|
|
2600
2653
|
},
|
|
2601
2654
|
{
|
|
2602
|
-
id:
|
|
2655
|
+
id: import_format9.StandardParameter.MouthForm,
|
|
2603
2656
|
description: "Mouth form / smile (-1 .. 1)."
|
|
2604
2657
|
},
|
|
2605
2658
|
{
|
|
2606
|
-
id:
|
|
2659
|
+
id: import_format9.StandardParameter.EyeOpenLeft,
|
|
2607
2660
|
description: "Left eye open (0 closed .. 1 open). Drive with the right eye for a blink."
|
|
2608
2661
|
},
|
|
2609
2662
|
{
|
|
2610
|
-
id:
|
|
2663
|
+
id: import_format9.StandardParameter.EyeOpenRight,
|
|
2611
2664
|
description: "Right eye open (0 closed .. 1 open)."
|
|
2612
2665
|
},
|
|
2613
2666
|
{
|
|
2614
|
-
id:
|
|
2667
|
+
id: import_format9.StandardParameter.EyeballX,
|
|
2615
2668
|
description: "Eyeball gaze, horizontal (-1 .. 1)."
|
|
2616
2669
|
},
|
|
2617
2670
|
{
|
|
2618
|
-
id:
|
|
2671
|
+
id: import_format9.StandardParameter.EyeballY,
|
|
2619
2672
|
description: "Eyeball gaze, vertical (-1 .. 1)."
|
|
2620
2673
|
},
|
|
2621
2674
|
{
|
|
2622
|
-
id:
|
|
2675
|
+
id: import_format9.StandardParameter.AngleX,
|
|
2623
2676
|
description: "Head angle, horizontal degrees."
|
|
2624
2677
|
},
|
|
2625
2678
|
{
|
|
2626
|
-
id:
|
|
2679
|
+
id: import_format9.StandardParameter.AngleY,
|
|
2627
2680
|
description: "Head angle, vertical degrees."
|
|
2628
2681
|
},
|
|
2629
2682
|
{
|
|
2630
|
-
id:
|
|
2683
|
+
id: import_format9.StandardParameter.AngleZ,
|
|
2631
2684
|
description: "Head tilt / roll degrees; positive tilts the top of the head toward the viewer's right (clockwise), as in Live2D."
|
|
2632
2685
|
},
|
|
2633
2686
|
{
|
|
2634
|
-
id:
|
|
2687
|
+
id: import_format9.StandardParameter.BodyAngleX,
|
|
2635
2688
|
description: "Body turn, degrees (-10 .. 10); positive turns the body toward the viewer's right, as AngleX does the head."
|
|
2636
2689
|
},
|
|
2637
2690
|
{
|
|
2638
|
-
id:
|
|
2691
|
+
id: import_format9.StandardParameter.BodyAngleY,
|
|
2639
2692
|
description: "Body lean, degrees (-10 .. 10); positive moves the upper body up, negative bows."
|
|
2640
2693
|
},
|
|
2641
2694
|
{
|
|
2642
|
-
id:
|
|
2695
|
+
id: import_format9.StandardParameter.BodyAngleZ,
|
|
2643
2696
|
description: "Body tilt, degrees (-10 .. 10); positive tilts the top toward the viewer's right (clockwise), as AngleZ does the head."
|
|
2644
2697
|
},
|
|
2645
2698
|
{
|
|
2646
|
-
id:
|
|
2699
|
+
id: import_format9.StandardParameter.Breath,
|
|
2647
2700
|
description: "Idle breath (0 .. 1), cycled by the host."
|
|
2648
2701
|
},
|
|
2649
2702
|
{
|
|
2650
|
-
id:
|
|
2703
|
+
id: import_format9.StandardParameter.AmbientSway,
|
|
2704
|
+
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."
|
|
2705
|
+
},
|
|
2706
|
+
{
|
|
2707
|
+
id: import_format9.StandardParameter.BrowLeftY,
|
|
2651
2708
|
description: "Left brow raise/lower (-1 .. 1)."
|
|
2652
2709
|
},
|
|
2653
2710
|
{
|
|
2654
|
-
id:
|
|
2711
|
+
id: import_format9.StandardParameter.BrowRightY,
|
|
2655
2712
|
description: "Right brow raise/lower (-1 .. 1)."
|
|
2656
2713
|
},
|
|
2657
2714
|
{
|
|
2658
|
-
id:
|
|
2715
|
+
id: import_format9.StandardParameter.BrowLeftAngle,
|
|
2659
2716
|
description: "Left brow tilt/angle (-1 .. 1)."
|
|
2660
2717
|
},
|
|
2661
2718
|
{
|
|
2662
|
-
id:
|
|
2719
|
+
id: import_format9.StandardParameter.BrowRightAngle,
|
|
2663
2720
|
description: "Right brow tilt/angle (-1 .. 1)."
|
|
2664
2721
|
},
|
|
2665
2722
|
{
|
|
2666
|
-
id:
|
|
2723
|
+
id: import_format9.StandardParameter.Cheek,
|
|
2667
2724
|
description: "Cheek blush strength (0 .. 1), raised by an expression."
|
|
2668
2725
|
},
|
|
2669
2726
|
{
|
|
2670
|
-
id:
|
|
2727
|
+
id: import_format9.StandardParameter.HairSwayX,
|
|
2671
2728
|
description: "Horizontal hair-sway driver. Physics OUTPUT \u2014 driven by the spring, hosts should not set it directly."
|
|
2672
2729
|
},
|
|
2673
2730
|
{
|
|
2674
|
-
id:
|
|
2731
|
+
id: import_format9.StandardParameter.HairSwayZ,
|
|
2675
2732
|
description: "Hair-sway driver behind a head tilt. Physics OUTPUT \u2014 driven by the spring, hosts should not set it directly."
|
|
2676
2733
|
},
|
|
2677
2734
|
{
|
|
2678
|
-
id:
|
|
2735
|
+
id: import_format9.StandardParameter.ArmLeft,
|
|
2679
2736
|
description: "Left shoulder, degrees; positive raises the arm outward (mirrored on the right)."
|
|
2680
2737
|
},
|
|
2681
2738
|
{
|
|
2682
|
-
id:
|
|
2739
|
+
id: import_format9.StandardParameter.ArmRight,
|
|
2683
2740
|
description: "Right shoulder, degrees; positive raises the arm outward (mirrored on the left)."
|
|
2684
2741
|
},
|
|
2685
2742
|
{
|
|
2686
|
-
id:
|
|
2743
|
+
id: import_format9.StandardParameter.ElbowLeft,
|
|
2687
2744
|
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)."
|
|
2688
2745
|
},
|
|
2689
2746
|
{
|
|
2690
|
-
id:
|
|
2747
|
+
id: import_format9.StandardParameter.ElbowRight,
|
|
2691
2748
|
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)."
|
|
2692
2749
|
},
|
|
2693
2750
|
{
|
|
2694
|
-
id:
|
|
2751
|
+
id: import_format9.StandardParameter.ArmPoseLeft,
|
|
2695
2752
|
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."
|
|
2696
2753
|
},
|
|
2697
2754
|
{
|
|
2698
|
-
id:
|
|
2755
|
+
id: import_format9.StandardParameter.ArmPoseRight,
|
|
2699
2756
|
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."
|
|
2700
2757
|
},
|
|
2701
2758
|
{
|
|
2702
|
-
id:
|
|
2759
|
+
id: import_format9.StandardParameter.ArmPoseAngleLeft,
|
|
2703
2760
|
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)."
|
|
2704
2761
|
},
|
|
2705
2762
|
{
|
|
2706
|
-
id:
|
|
2763
|
+
id: import_format9.StandardParameter.ArmPoseAngleRight,
|
|
2707
2764
|
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)."
|
|
2708
2765
|
}
|
|
2709
2766
|
];
|
|
@@ -2903,7 +2960,7 @@ async function autoRigFromLayers(input) {
|
|
|
2903
2960
|
patched.parts.find((p) => p.id === partId).texture.index = 1;
|
|
2904
2961
|
}
|
|
2905
2962
|
}
|
|
2906
|
-
const finalModel = (0,
|
|
2963
|
+
const finalModel = (0, import_format9.parseIkiModel)(patched);
|
|
2907
2964
|
writeFileAtomic(outPath, JSON.stringify(finalModel));
|
|
2908
2965
|
const folds = checkModelFolds(finalModel);
|
|
2909
2966
|
const physics = checkPhysics(finalModel);
|
|
@@ -5624,7 +5681,7 @@ function formatPatchReports(reports) {
|
|
|
5624
5681
|
});
|
|
5625
5682
|
}
|
|
5626
5683
|
function createIkiMcpServer() {
|
|
5627
|
-
const server = new import_mcp.McpServer({ name: "iki", version: "0.
|
|
5684
|
+
const server = new import_mcp.McpServer({ name: "iki", version: "0.28.0" });
|
|
5628
5685
|
server.registerTool(
|
|
5629
5686
|
"validate_iki",
|
|
5630
5687
|
{
|