@hypersoniclabs/helix-cli 0.1.28-helix3.719 → 0.1.28-helix3.721

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.
Files changed (33) hide show
  1. package/dist/bridge/internal/builtInExecution.js +3 -0
  2. package/dist/bridge/internal/builtInExecution.js.map +1 -1
  3. package/dist/character/fitGarmentFile.d.ts +10 -0
  4. package/dist/character/fitGarmentFile.js +18 -0
  5. package/dist/character/fitGarmentFile.js.map +1 -1
  6. package/dist/character/importCharacter.d.ts +3 -0
  7. package/dist/character/importCharacter.js +8 -0
  8. package/dist/character/importCharacter.js.map +1 -1
  9. package/dist/character/stages/seatWaistClearance.d.ts +49 -0
  10. package/dist/character/stages/seatWaistClearance.js +115 -0
  11. package/dist/character/stages/seatWaistClearance.js.map +1 -0
  12. package/dist/index.js +95 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/tsconfig.build.tsbuildinfo +1 -1
  15. package/dist/wearable.d.ts +55 -0
  16. package/dist/wearable.js +93 -0
  17. package/dist/wearable.js.map +1 -0
  18. package/package.json +1 -1
  19. package/plugins/beamng-vehicle/bin/__pycache__/beamng_abs.cpython-312.pyc +0 -0
  20. package/plugins/beamng-vehicle/bin/__pycache__/beamng_audio.cpython-312.pyc +0 -0
  21. package/plugins/beamng-vehicle/bin/__pycache__/beamng_engine.cpython-312.pyc +0 -0
  22. package/plugins/beamng-vehicle/bin/__pycache__/beamng_expression.cpython-312.pyc +0 -0
  23. package/plugins/beamng-vehicle/bin/__pycache__/beamng_jbeam.cpython-312.pyc +0 -0
  24. package/plugins/beamng-vehicle/bin/__pycache__/beamng_materials.cpython-312.pyc +0 -0
  25. package/plugins/beamng-vehicle/bin/__pycache__/beamng_stock_events.cpython-312.pyc +0 -0
  26. package/plugins/beamng-vehicle/bin/__pycache__/fmod_studio.cpython-312.pyc +0 -0
  27. package/plugins/beamng-vehicle/bin/__pycache__/fsb5.cpython-312.pyc +0 -0
  28. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio.cpython-312.pyc +0 -0
  29. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_ac.cpython-312.pyc +0 -0
  30. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_beamng.cpython-312.pyc +0 -0
  31. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_fixtures.cpython-312.pyc +0 -0
  32. package/plugins/beamng-vehicle/bin/__pycache__/test_beamng_engine.cpython-312.pyc +0 -0
  33. package/plugins/beamng-vehicle/bin/__pycache__/test_sim_audio.cpython-312.pyc +0 -0
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_SEAT_FADE_MM = exports.DEFAULT_SEAT_OFFSET_MM = void 0;
4
+ exports.seatWaistClearance = seatWaistClearance;
5
+ exports.seatClearanceForSlotType = seatClearanceForSlotType;
6
+ const bodyRegionHide_1 = require("../bodyRegionHide");
7
+ const model_1 = require("./poseFit/model");
8
+ exports.DEFAULT_SEAT_OFFSET_MM = 16;
9
+ exports.DEFAULT_SEAT_FADE_MM = 80;
10
+ function smoothstep(t) {
11
+ const x = Math.min(1, Math.max(0, t));
12
+ return x * x * (3 - 2 * x);
13
+ }
14
+ /** Inverse of a row-major 3x3, or null when (near) singular. */
15
+ function invert3(m, o) {
16
+ const a = m[o], b = m[o + 1], c = m[o + 2], d = m[o + 3], e = m[o + 4], f = m[o + 5], g = m[o + 6], h = m[o + 7], i = m[o + 8];
17
+ const A = e * i - f * h, B = f * g - d * i, C = d * h - e * g;
18
+ const det = a * A + b * B + c * C;
19
+ if (!(Math.abs(det) > 1e-9))
20
+ return null;
21
+ const k = 1 / det;
22
+ return [A * k, (c * h - b * i) * k, (b * f - c * e) * k, B * k, (a * i - c * g) * k, (c * d - a * f) * k, C * k, (b * g - a * h) * k, (a * e - b * d) * k];
23
+ }
24
+ /** Mutates `garment`'s POSITION accessors (rest pose) when the zone exists; otherwise leaves it untouched. */
25
+ function seatWaistClearance(garment, body, options = {}) {
26
+ const offsetMm = options.offsetMm ?? exports.DEFAULT_SEAT_OFFSET_MM;
27
+ const fadeMm = options.fadeMm ?? exports.DEFAULT_SEAT_FADE_MM;
28
+ const region = options.region ?? 'body_hip';
29
+ const pose = options.pose ?? 'idle';
30
+ const log = options.onProgress ?? (() => { });
31
+ const report = { outcome: 'skipped', reason: null, offsetMm, fadeMm, units: [] };
32
+ if (!(offsetMm > 0) || !(fadeMm > 0)) {
33
+ report.reason = 'offset/fade is zero';
34
+ return report;
35
+ }
36
+ const bodyModel = (0, model_1.buildBodyModel)(body, [pose]);
37
+ const bp = bodyModel.poses.get(pose);
38
+ if (!bp.normals) {
39
+ report.reason = 'the base body has no normals';
40
+ return report;
41
+ }
42
+ const hip = [];
43
+ for (let i = 0; i < bodyModel.vertexCount; i++)
44
+ if (bodyModel.regions[i] === region)
45
+ hip.push(i);
46
+ if (hip.length === 0) {
47
+ report.reason = `the base body has no ${region} skin`;
48
+ return report;
49
+ }
50
+ const fadeM = fadeMm / 1000, offsetM = offsetMm / 1000;
51
+ const P = bp.positions, N = bp.normals;
52
+ const garmentModel = (0, model_1.buildGarmentModel)(garment, [pose]);
53
+ for (const unit of garmentModel.units) {
54
+ const posed = unit.poses.get(pose);
55
+ const stat = { vertices: unit.vertexCount, moved: 0, maxMm: 0 };
56
+ const delta = new Float64Array(unit.vertexCount * 3);
57
+ for (let v = 0; v < unit.vertexCount; v++) {
58
+ const px = posed.posedRest[v * 3], py = posed.posedRest[v * 3 + 1], pz = posed.posedRest[v * 3 + 2];
59
+ let dh = Infinity;
60
+ for (const i of hip) {
61
+ const d = Math.hypot(P[i * 3] - px, P[i * 3 + 1] - py, P[i * 3 + 2] - pz);
62
+ if (d < dh)
63
+ dh = d;
64
+ }
65
+ if (dh >= fadeM)
66
+ continue;
67
+ // The body's own outward normal at the nearest body vertex (any region: the cloth may sit just past the hip edge).
68
+ let best = Infinity, bi = -1;
69
+ for (let i = 0; i < bodyModel.vertexCount; i++) {
70
+ const dx = P[i * 3] - px, dy = P[i * 3 + 1] - py, dz = P[i * 3 + 2] - pz;
71
+ const d = dx * dx + dy * dy + dz * dz;
72
+ if (d < best) {
73
+ best = d;
74
+ bi = i;
75
+ }
76
+ }
77
+ if (bi < 0)
78
+ continue;
79
+ const w = smoothstep(1 - dh / fadeM) * offsetM;
80
+ const inv = invert3(posed.linear, v * 9);
81
+ if (!inv)
82
+ continue;
83
+ const nx = N[bi * 3] * w, ny = N[bi * 3 + 1] * w, nz = N[bi * 3 + 2] * w;
84
+ delta[v * 3] = inv[0] * nx + inv[1] * ny + inv[2] * nz;
85
+ delta[v * 3 + 1] = inv[3] * nx + inv[4] * ny + inv[5] * nz;
86
+ delta[v * 3 + 2] = inv[6] * nx + inv[7] * ny + inv[8] * nz;
87
+ stat.moved++;
88
+ stat.maxMm = Math.max(stat.maxMm, w * 1000);
89
+ }
90
+ report.units.push(stat);
91
+ if (stat.moved === 0)
92
+ continue;
93
+ unit.accessors.forEach((accessor, a) => {
94
+ const base = unit.accessorBase[a];
95
+ const out = new Float32Array(accessor.getCount() * 3);
96
+ for (let i = 0; i < accessor.getCount(); i++)
97
+ for (let c = 0; c < 3; c++)
98
+ out[i * 3 + c] = unit.rest[(base + i) * 3 + c] + delta[(base + i) * 3 + c];
99
+ accessor.setArray(out);
100
+ });
101
+ }
102
+ const moved = report.units.reduce((s, u) => s + u.moved, 0);
103
+ if (moved === 0) {
104
+ report.reason = `no garment vertex lies within ${fadeMm} mm of the ${region} skin`;
105
+ return report;
106
+ }
107
+ report.outcome = 'applied';
108
+ log(`seat-clearance: ${moved} garment vertex(es) lifted up to ${offsetMm} mm off ${region} (fade ${fadeMm} mm), per LOD ${report.units.map((u) => `${u.moved}/${u.vertices}`).join(' ')}`);
109
+ return report;
110
+ }
111
+ /** Options for `slotType` when the platform grants it the hip skin (bottom, outfit), else `false` (nothing is lifted). */
112
+ function seatClearanceForSlotType(slotType) {
113
+ return (0, bodyRegionHide_1.defaultHideRegionsForSlotType)(slotType).includes('body_hip') ? {} : false;
114
+ }
115
+ //# sourceMappingURL=seatWaistClearance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seatWaistClearance.js","sourceRoot":"","sources":["../../../src/character/stages/seatWaistClearance.ts"],"names":[],"mappings":";;;AAgEA,gDA+DC;AAGD,4DAEC;AAnID,sDAAkE;AAClE,2CAAoE;AA2CvD,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAC5B,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAEvC,SAAS,UAAU,CAAC,CAAS;IAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED,gEAAgE;AAChE,SAAS,OAAO,CAAC,CAAoB,EAAE,CAAS;IAC9C,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC;IACxI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,C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AI,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAE,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAE,CAAC;YACvJ,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5D,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAAC,MAAM,CAAC,MAAM,GAAG,iCAAiC,MAAM,cAAc,MAAM,OAAO,CAAC;QAAC,OAAO,MAAM,CAAC;IAAC,CAAC;IACvH,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,mBAAmB,KAAK,oCAAoC,QAAQ,WAAW,MAAM,UAAU,MAAM,iBAAiB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3L,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,0HAA0H;AAC1H,SAAgB,wBAAwB,CAAC,QAAgB;IACvD,OAAO,IAAA,8CAA6B,EAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACnF,CAAC"}
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  require("./stdioBlocking");
38
38
  const itemSetVersion_1 = require("./itemSetVersion");
39
39
  const itemPublishVersion_1 = require("./itemPublishVersion");
40
+ const wearable_1 = require("./wearable");
40
41
  const moveUx_1 = require("./visualQa/moveUx");
41
42
  const validate_1 = require("./vehicle/validate");
42
43
  const commander_1 = require("commander");
@@ -2153,6 +2154,76 @@ item
2153
2154
  fail(error instanceof lib_1.ApiError ? (0, itemSetVersion_1.renderSetVersionError)(error) : `✖ ${error instanceof Error ? error.message : String(error)}`);
2154
2155
  }
2155
2156
  });
2157
+ // HELIX-39 parity U: creators publish Base Human wearables (fitted, head-bound, rigid accessory, look param). The server
2158
+ // runs the gates and the fit cook and answers the verdict; the item lands as a personal draft you own.
2159
+ const wearable = item.command('wearable').description('Base Human wearables: kit (slot classes + caps), publish a GLB or param.json, status (verdict)');
2160
+ wearable
2161
+ .command('kit')
2162
+ .description('Print the slot classes, per-slot caps, authored bodies, rigid socket limits and the param schema')
2163
+ .option('--json', 'machine-readable output')
2164
+ .action(async (opts) => {
2165
+ const creds = requireAuth();
2166
+ try {
2167
+ const kit = await (0, wearable_1.wearableKit)(lib_1.HelixApi.forCredentials(creds));
2168
+ if (opts.json)
2169
+ console.log(JSON.stringify(kit, null, 2));
2170
+ else
2171
+ for (const [slot, info] of Object.entries(kit.slots))
2172
+ console.log(`${slot.padEnd(14)} ${info.class.padEnd(10)} ${info.maxTris ? `${info.maxTris} tris` : ''}${info.wearableNow === false ? ' (no Base Human slot yet)' : ''}`);
2173
+ }
2174
+ catch (error) {
2175
+ fail(`✖ ${error instanceof Error ? error.message : String(error)}`);
2176
+ }
2177
+ });
2178
+ wearable
2179
+ .command('publish')
2180
+ .description('Publish a wearable as yourself: stage the file, seal it through the gates, print the verdict (the fit cook may still be pending)')
2181
+ .argument('<file>', 'a .glb (fitted, head-bound, rigid) or a param.json (look param: color, intensity, finish)')
2182
+ .requiredOption('--slot <slot>', 'the look slot (see `helix item wearable kit`)')
2183
+ .option('--title <title>', 'item title (default: the file name)')
2184
+ .option('--description <text>', 'item description')
2185
+ .option('--authored-body <id>', 'fitted/head-bound: the body the garment was authored on (default SKM_M_NRW_Tall)')
2186
+ .option('--anchor <anchor>', 'rigid: face | bone:<name> (default: the slot\'s first anchor)')
2187
+ .option('--offset <t,r,s>', 'rigid: "tx,ty,tz,rx,ry,rz,s" in cm, degrees, scale (clamped to +-50 cm, +-180 deg, 0.5-2)')
2188
+ .option('--mask <file>', 'param: a mask texture (png, jpeg or ktx2, at most 2048x2048 and 4 MB)')
2189
+ .option('--json', 'machine-readable output')
2190
+ .action(async (file, opts) => {
2191
+ const creds = requireAuth();
2192
+ try {
2193
+ const r = await (0, wearable_1.wearablePublish)(lib_1.HelixApi.forCredentials(creds), file, opts);
2194
+ if (opts.json)
2195
+ console.log(JSON.stringify(r, null, 2));
2196
+ else
2197
+ for (const line of (0, wearable_1.renderWearableResult)(r))
2198
+ console.log(line);
2199
+ if (r.verdict === 'refused')
2200
+ process.exitCode = 1;
2201
+ }
2202
+ catch (error) {
2203
+ const issues = error instanceof lib_1.ApiError ? error.body.issues : undefined;
2204
+ const detail = Array.isArray(issues) ? issues.map((x) => `\n - ${x.pointer ? `${x.pointer}: ` : ''}${x.message ?? ''}`).join('') : '';
2205
+ fail(error instanceof lib_1.ApiError ? `✖ ${error.message}${detail}` : `✖ ${error instanceof Error ? error.message : String(error)}`);
2206
+ }
2207
+ });
2208
+ wearable
2209
+ .command('status')
2210
+ .description('The verdict and issues of one of your wearables (owner only)')
2211
+ .argument('<packageVersionId>')
2212
+ .option('--json', 'machine-readable output')
2213
+ .action(async (packageVersionId, opts) => {
2214
+ const creds = requireAuth();
2215
+ try {
2216
+ const r = await (0, wearable_1.wearableStatus)(lib_1.HelixApi.forCredentials(creds), packageVersionId);
2217
+ if (opts.json)
2218
+ console.log(JSON.stringify(r, null, 2));
2219
+ else
2220
+ for (const line of (0, wearable_1.renderWearableResult)(r))
2221
+ console.log(line);
2222
+ }
2223
+ catch (error) {
2224
+ fail(error instanceof lib_1.ApiError ? `✖ ${error.message}` : `✖ ${error instanceof Error ? error.message : String(error)}`);
2225
+ }
2226
+ });
2156
2227
  // One command prints the whole Character-Creator vocabulary a wearable must
2157
2228
  // declare — the 34 slot tags AND the two genders. There is no `list-genders`:
2158
2229
  // a dedicated command for a closed two-value list is a command to discover, to
@@ -4696,7 +4767,7 @@ character
4696
4767
  .option('--clearance-mm <mm>', 'target clearance: body ends at least this far behind the garment surface (default 3)')
4697
4768
  .option('--threshold-mm <mm>', 'gate violation floor, as pokethrough-check --threshold (default 0.5)')
4698
4769
  .option('--ceiling-mm <mm>', 'deeper than this is not a coverage defect, as pokethrough-check --ceiling (default 10)')
4699
- .option('--proximity-mm <mm>', 'body points farther than this from the garment are not under it, as pokethrough-check --proximity (default 50)')
4770
+ .option('--proximity-mm <mm>', 'body points farther than this from the garment are not under it, as pokethrough-check --proximity (default 80)')
4700
4771
  .option('--max-push-mm <mm>', 'largest total move for an interior garment vertex (default 8)')
4701
4772
  .option('--hem-max-push-mm <mm>', 'largest total move on a hem/cuff/collar boundary (default 4)')
4702
4773
  .option('--hem-band-mm <mm>', 'surface distance over which the hem cap ramps back to --max-push-mm (default 20)')
@@ -4749,6 +4820,29 @@ character
4749
4820
  fail(`✖ ${err instanceof Error ? err.message : String(err)}`);
4750
4821
  }
4751
4822
  });
4823
+ character
4824
+ .command('seat-clearance')
4825
+ .description("Lift a trouser/outfit add-on off the base body's hip skin (seat and waistband): every garment vertex within --fade-mm of body_hip moves outward along the body normal by --offset-mm, fading to zero. Geometry only, so web and Unreal both get it (Cargo Pants body poke-through, HELIX-120)")
4826
+ .argument('<garment>', 'packaged add-on GLB (every LOD level is moved)')
4827
+ .requiredOption('--body <glb>', 'the base body GLB the add-on is worn on')
4828
+ .requiredOption('-o, --output <glb>', 'output GLB (a byte-identical copy of the input when nothing is within reach)')
4829
+ .option('--offset-mm <mm>', 'outward move at the hip (default 16)')
4830
+ .option('--fade-mm <mm>', 'distance from the hip skin over which the move fades out (default 80)')
4831
+ .action(async (garment, opts) => {
4832
+ try {
4833
+ const { seatClearanceFile } = await Promise.resolve().then(() => __importStar(require('./character/fitGarmentFile')));
4834
+ const report = await seatClearanceFile({
4835
+ garment: (0, node_path_1.resolve)(garment), body: (0, node_path_1.resolve)(opts.body), output: (0, node_path_1.resolve)(opts.output),
4836
+ offsetMm: parseFitNumber(opts.offsetMm, '--offset-mm'), fadeMm: parseFitNumber(opts.fadeMm, '--fade-mm'),
4837
+ onProgress: (m) => console.log(m),
4838
+ });
4839
+ console.log(`${report.outcome === 'applied' ? '✔' : '•'} ${report.outcome}${report.reason ? `: ${report.reason}` : ''} (offset ${report.offsetMm} mm, fade ${report.fadeMm} mm)`);
4840
+ process.exitCode = report.outcome === 'applied' ? 0 : 3;
4841
+ }
4842
+ catch (err) {
4843
+ fail(`✖ ${err instanceof Error ? err.message : String(err)}`);
4844
+ }
4845
+ });
4752
4846
  character
4753
4847
  .command('ear-clearance')
4754
4848
  .description("Check (and by default fix) whether the base body's ears poke through a head-zone add-on (headwear, mask, hair, eyewear): measures the clearance between the ear surface and the OUTERMOST garment layer around it, per LOD, and pushes the garment smoothly clear when a wrapped ear has < 1.5 mm. Kept only when no ear pokes afterwards")