@bitmagic/cli 0.1.59-dev.0 → 0.1.59-dev.10
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 +146 -2
- package/dist/assets/file-kind.d.ts +8 -0
- package/dist/assets/file-kind.js +24 -0
- package/dist/assets/file-kind.js.map +1 -1
- package/dist/assets/materials.d.ts +165 -0
- package/dist/assets/materials.js +395 -0
- package/dist/assets/materials.js.map +1 -0
- package/dist/assets/vxl-summary.js +12 -5
- package/dist/assets/vxl-summary.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/assets.d.ts +25 -0
- package/dist/commands/assets.js +245 -2
- package/dist/commands/assets.js.map +1 -1
- package/dist/commands/forge.d.ts +2 -2
- package/dist/commands/forge.js +40 -17
- package/dist/commands/forge.js.map +1 -1
- package/dist/commands/generate.d.ts +29 -0
- package/dist/commands/generate.js +139 -3
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/theme.d.ts +3 -0
- package/dist/commands/theme.js +201 -0
- package/dist/commands/theme.js.map +1 -0
- package/dist/editor/animation-preview-page.d.ts +6 -0
- package/dist/editor/animation-preview-page.js +123 -0
- package/dist/editor/animation-preview-page.js.map +1 -0
- package/dist/editor/journal.d.ts +25 -0
- package/dist/editor/journal.js +8 -0
- package/dist/editor/journal.js.map +1 -1
- package/dist/editor/motion-panel.d.ts +20 -0
- package/dist/editor/motion-panel.js +432 -0
- package/dist/editor/motion-panel.js.map +1 -0
- package/dist/editor/motion-sink.d.ts +35 -0
- package/dist/editor/motion-sink.js +70 -0
- package/dist/editor/motion-sink.js.map +1 -0
- package/dist/editor/server.js +126 -0
- package/dist/editor/server.js.map +1 -1
- package/dist/editor/shell-page.js +16 -1
- package/dist/editor/shell-page.js.map +1 -1
- package/dist/forge/voxelize-session.d.ts +11 -0
- package/dist/forge/voxelize-session.js +23 -1
- package/dist/forge/voxelize-session.js.map +1 -1
- package/dist/generate/animation-from-video.d.ts +52 -0
- package/dist/generate/animation-from-video.js +152 -0
- package/dist/generate/animation-from-video.js.map +1 -0
- package/dist/project/jobs.d.ts +1 -1
- package/dist/project/jobs.js.map +1 -1
- package/dist/scaffold/project-files.d.ts +1 -0
- package/dist/scaffold/project-files.js +47 -1
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/project.js +2 -1
- package/dist/scaffold/project.js.map +1 -1
- package/dist/theme/hud-theme-catalog.d.ts +236 -0
- package/dist/theme/hud-theme-catalog.js +386 -0
- package/dist/theme/hud-theme-catalog.js.map +1 -0
- package/dist/theme/theme-color-math.d.ts +21 -0
- package/dist/theme/theme-color-math.js +99 -0
- package/dist/theme/theme-color-math.js.map +1 -0
- package/dist/theme/theme-io.d.ts +49 -0
- package/dist/theme/theme-io.js +190 -0
- package/dist/theme/theme-io.js.map +1 -0
- package/dist/theme/theme-merge.d.ts +36 -0
- package/dist/theme/theme-merge.js +81 -0
- package/dist/theme/theme-merge.js.map +1 -0
- package/dist/theme/theme-report.d.ts +28 -0
- package/dist/theme/theme-report.js +142 -0
- package/dist/theme/theme-report.js.map +1 -0
- package/dist/theme/theme-stored.d.ts +21 -0
- package/dist/theme/theme-stored.js +50 -0
- package/dist/theme/theme-stored.js.map +1 -0
- package/dist/theme/theme-validate.d.ts +41 -0
- package/dist/theme/theme-validate.js +406 -0
- package/dist/theme/theme-validate.js.map +1 -0
- package/dist/verify/classify.js +19 -0
- package/dist/verify/classify.js.map +1 -1
- package/dist/verify/hud-theme.d.ts +55 -0
- package/dist/verify/hud-theme.js +70 -0
- package/dist/verify/hud-theme.js.map +1 -0
- package/package.json +6 -5
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The animation preview the dev view opens for an `assets[]` row of type `animation`,
|
|
3
|
+
* served by the sidecar at `/animation-preview` — the Creator's clip preview, for this lane.
|
|
4
|
+
*
|
|
5
|
+
* The renderer is NOT this package's: `debug/AnimationPreview.ts` ships inside the vendored
|
|
6
|
+
* engine (the `debug/` alias → `/dist/engine/debug/` on the project's vite server), so the clip
|
|
7
|
+
* plays on the same block character, `MixamoAnimationPlayer` and voxel factory the creator's own
|
|
8
|
+
* engine runs — a preview from a CLI-shipped copy could disagree with the game. Only the PAGE is
|
|
9
|
+
* the sidecar's, following the rule `asset-viewer.ts` documents: the engine tarball ships no
|
|
10
|
+
* `game/*.html`, so a page can only reach every project from the CLI.
|
|
11
|
+
*
|
|
12
|
+
* The import map is generated, not transcribed — same reasoning (and same generator) as
|
|
13
|
+
* `asset-preview-page.ts`: the repo's hand-kept copies of this map are guarded by a contract
|
|
14
|
+
* test precisely because partial updates broke every engine page once.
|
|
15
|
+
*
|
|
16
|
+
* An engine too old to carry `debug/AnimationPreview.js` fails the module import; the catch
|
|
17
|
+
* posts `ASSET_PREVIEW_FAILED`, and the shell shows the reason — same contract as the asset
|
|
18
|
+
* viewer, one handler on the shell side for both.
|
|
19
|
+
*/
|
|
20
|
+
import { CDN_IMPORTS } from '../scaffold/project-files.js';
|
|
21
|
+
import { importMapEntries } from '../scaffold/aliases.js';
|
|
22
|
+
import { BITMAGIC_FONT_LINK, BITMAGIC_TOKENS_CSS } from './design.js';
|
|
23
|
+
function importMapFor(gamePort) {
|
|
24
|
+
const origin = `http://localhost:${gamePort}`;
|
|
25
|
+
const engine = Object.fromEntries(Object.entries(importMapEntries()).map(([name, target]) => [name, `${origin}${target}`]));
|
|
26
|
+
return { ...CDN_IMPORTS, ...engine };
|
|
27
|
+
}
|
|
28
|
+
export function renderAnimationPreviewPage(options) {
|
|
29
|
+
const imports = JSON.stringify({ imports: importMapFor(options.gamePort) }, null, 4);
|
|
30
|
+
return `<!DOCTYPE html>
|
|
31
|
+
<html lang="en">
|
|
32
|
+
<head>
|
|
33
|
+
<meta charset="utf-8">
|
|
34
|
+
<title>Animation preview</title>
|
|
35
|
+
${BITMAGIC_FONT_LINK}
|
|
36
|
+
<style>
|
|
37
|
+
${BITMAGIC_TOKENS_CSS}
|
|
38
|
+
html, body { margin: 0; height: 100%; background: var(--bm-bg); overflow: hidden;
|
|
39
|
+
font: 400 12px/1.5 var(--bm-font); color: var(--bm-text-muted); }
|
|
40
|
+
#stage { position: absolute; inset: 0; }
|
|
41
|
+
#stage canvas { display: block; width: 100%; height: 100%; }
|
|
42
|
+
#status { position: absolute; left: 0; right: 0; top: 0; padding: 12px;
|
|
43
|
+
background: linear-gradient(var(--bm-scrim), transparent);
|
|
44
|
+
pointer-events: none; }
|
|
45
|
+
#status.failed { color: var(--bm-pink-hover); }
|
|
46
|
+
#status.hidden, #controls.hidden { display: none; }
|
|
47
|
+
/* One row pinned under the clip: play/pause and a speed slider, nothing that competes with it. */
|
|
48
|
+
#controls { position: absolute; left: 12px; right: 12px; bottom: 12px;
|
|
49
|
+
display: flex; gap: 10px; align-items: center;
|
|
50
|
+
background: var(--bm-scrim); border-radius: 999px; padding: 6px 12px; }
|
|
51
|
+
#play { background: var(--bm-aqua); color: var(--bm-bg); border: none; border-radius: 999px;
|
|
52
|
+
min-width: 34px; padding: 4px 10px; font: inherit; cursor: pointer; }
|
|
53
|
+
#controls label { white-space: nowrap; }
|
|
54
|
+
#speed { flex: 1; min-width: 60px; accent-color: var(--bm-aqua); }
|
|
55
|
+
#speed-value { min-width: 34px; text-align: right; font-family: var(--bm-font-mono); }
|
|
56
|
+
</style>
|
|
57
|
+
</head>
|
|
58
|
+
<body>
|
|
59
|
+
<div id="stage"></div>
|
|
60
|
+
<div id="status">Loading…</div>
|
|
61
|
+
<div id="controls" class="hidden">
|
|
62
|
+
<button id="play" type="button" title="Play or pause">⏸</button>
|
|
63
|
+
<label for="speed">Speed</label>
|
|
64
|
+
<input id="speed" type="range" min="0.1" max="2" step="0.05" value="1">
|
|
65
|
+
<span id="speed-value">1.00</span>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<script type="importmap">
|
|
69
|
+
${imports}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<script type="module">
|
|
73
|
+
var params = new URLSearchParams(window.location.search);
|
|
74
|
+
var status = document.getElementById('status');
|
|
75
|
+
var controls = document.getElementById('controls');
|
|
76
|
+
var playButton = document.getElementById('play');
|
|
77
|
+
var speedSlider = document.getElementById('speed');
|
|
78
|
+
var speedValue = document.getElementById('speed-value');
|
|
79
|
+
|
|
80
|
+
/** Same-origin parent (the dev view's shell); same contract as the asset viewer's page. */
|
|
81
|
+
function tell(message) {
|
|
82
|
+
try { window.parent.postMessage(message, window.location.origin); } catch (error) { /* detached */ }
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
// Dynamic import so a project whose vendored engine predates the module reaches the catch
|
|
87
|
+
// below with the browser's own "failed to fetch" instead of a blank page.
|
|
88
|
+
var mod = await import('debug/AnimationPreview.js');
|
|
89
|
+
var handle = await mod.startAnimationPreview({
|
|
90
|
+
animationUrl: params.get('url') || '',
|
|
91
|
+
container: document.getElementById('stage'),
|
|
92
|
+
characterHeight: mod.DEFAULT_ANIMATION_PREVIEW_OPTIONS.characterHeight,
|
|
93
|
+
showGrid: true,
|
|
94
|
+
paused: params.get('paused') === '1',
|
|
95
|
+
});
|
|
96
|
+
status.classList.add('hidden');
|
|
97
|
+
controls.classList.remove('hidden');
|
|
98
|
+
var paused = params.get('paused') === '1';
|
|
99
|
+
playButton.textContent = paused ? '\u25B6' : '\u23F8';
|
|
100
|
+
playButton.addEventListener('click', function () {
|
|
101
|
+
paused = !paused;
|
|
102
|
+
handle.setPaused(paused);
|
|
103
|
+
playButton.textContent = paused ? '\u25B6' : '\u23F8';
|
|
104
|
+
});
|
|
105
|
+
speedSlider.addEventListener('input', function () {
|
|
106
|
+
var value = parseFloat(speedSlider.value);
|
|
107
|
+
speedValue.textContent = value.toFixed(2);
|
|
108
|
+
handle.setSpeed(value);
|
|
109
|
+
});
|
|
110
|
+
tell({ type: 'ASSET_PREVIEW_READY' });
|
|
111
|
+
window.addEventListener('pagehide', function () { handle.dispose(); });
|
|
112
|
+
} catch (error) {
|
|
113
|
+
var reason = error && error.message ? error.message : String(error);
|
|
114
|
+
status.textContent = reason;
|
|
115
|
+
status.classList.add('failed');
|
|
116
|
+
tell({ type: 'ASSET_PREVIEW_FAILED', error: reason });
|
|
117
|
+
}
|
|
118
|
+
</script>
|
|
119
|
+
</body>
|
|
120
|
+
</html>
|
|
121
|
+
`;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=animation-preview-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation-preview-page.js","sourceRoot":"","sources":["../../src/editor/animation-preview-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQtE,SAAS,YAAY,CAAC,QAAgB;IACpC,MAAM,MAAM,GAAG,oBAAoB,QAAQ,EAAE,CAAC;IAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,CACzF,CAAC;IACF,OAAO,EAAE,GAAG,WAAW,EAAE,GAAG,MAAM,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAoC;IAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACrF,OAAO;;;;;EAKP,kBAAkB;;EAElB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCnB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDR,CAAC;AACF,CAAC"}
|
package/dist/editor/journal.d.ts
CHANGED
|
@@ -119,6 +119,31 @@ export type EditorEvent = {
|
|
|
119
119
|
assetName: string;
|
|
120
120
|
error: string;
|
|
121
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* The Record-motion panel: a creator's video became (or failed to become) an animation clip.
|
|
124
|
+
* `motion.requested` is the logged-out hand-off, like `hq.requested`; the other two bracket the
|
|
125
|
+
* in-process job so an agent sees the asset row appear with a cause attached.
|
|
126
|
+
*/
|
|
127
|
+
| {
|
|
128
|
+
event: 'motion.requested';
|
|
129
|
+
name: string;
|
|
130
|
+
videoPath: string;
|
|
131
|
+
command: string;
|
|
132
|
+
} | {
|
|
133
|
+
event: 'motion.started';
|
|
134
|
+
name: string;
|
|
135
|
+
locomotionState?: string;
|
|
136
|
+
} | {
|
|
137
|
+
event: 'motion.completed';
|
|
138
|
+
name: string;
|
|
139
|
+
motionId: string;
|
|
140
|
+
animationUrl: string;
|
|
141
|
+
locomotionState?: string;
|
|
142
|
+
} | {
|
|
143
|
+
event: 'motion.failed';
|
|
144
|
+
name: string;
|
|
145
|
+
error: string;
|
|
146
|
+
}
|
|
122
147
|
/**
|
|
123
148
|
* A level was added, renamed, removed, or made the one the game boots into.
|
|
124
149
|
*
|
package/dist/editor/journal.js
CHANGED
|
@@ -192,6 +192,14 @@ export function formatEvent(event) {
|
|
|
192
192
|
return `[edit] voxel.saved "${event.assetName}"`;
|
|
193
193
|
case 'voxel.saveFailed':
|
|
194
194
|
return `[edit] voxel.saveFailed "${event.assetName}" — ${event.error}`;
|
|
195
|
+
case 'motion.requested':
|
|
196
|
+
return `[edit] motion.requested "${event.name}" — run: ${event.command}`;
|
|
197
|
+
case 'motion.started':
|
|
198
|
+
return `[edit] motion.started "${event.name}"${event.locomotionState ? ` as ${event.locomotionState}` : ''}`;
|
|
199
|
+
case 'motion.completed':
|
|
200
|
+
return `[edit] motion.completed "${event.name}" — ${event.motionId}`;
|
|
201
|
+
case 'motion.failed':
|
|
202
|
+
return `[edit] motion.failed "${event.name}" — ${event.error}`;
|
|
195
203
|
case 'levels.changed':
|
|
196
204
|
return `[edit] levels.${event.action} "${event.name}" (${event.levelId})`;
|
|
197
205
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../src/editor/journal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B,sDAAsD;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAwE3C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC;IAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACrB,CAAC;AAED,gEAAgE;AAChE,SAAS,IAAI,CAAC,CAAS,EAAE,CAAS;IAChC,OAAO,IAAI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AS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3D,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,CAAC,GAAG,CAAC,0BAA0B,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Record-motion panel — a webcam recording (or a picked video) becomes an animation clip via
|
|
3
|
+
* Uthana video-to-motion — composed into `shell-page.ts` the way `recording-panel.ts` is.
|
|
4
|
+
*
|
|
5
|
+
* Unlike the other panels this one also exports its BEHAVIOUR as a string: the recorder logic is
|
|
6
|
+
* a screenful, and it has to sit inside the shell's IIFE (it needs `setStatus`, `start`,
|
|
7
|
+
* `autoReload`, `banner`, `frame`). The same logic exists as a typed module for the Creator —
|
|
8
|
+
* `creator/src/utils/videoRecorder.ts` is the source of truth; this is a hand-kept ES5 port,
|
|
9
|
+
* because the shell has no bundler and cannot import it.
|
|
10
|
+
*
|
|
11
|
+
* Same template-literal rules as the host: **no backticks**, no regex literals starting with a
|
|
12
|
+
* dot-escape, every colour a `--bm-*` token — `shell-page.test.ts` enforces all three.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MOTION_PANEL_CSS = "\n /* Level with the other dialogs: each opens from its own control and they never stack. */\n #motion-overlay { z-index: 10; }\n #motion-dialog { width: min(520px, 94vw); padding: 20px; }\n #motion-dialog .bm-label { display: block; margin: 14px 0 6px; }\n #motion-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;\n background: var(--bm-surface-alt); border: 1px solid var(--bm-border-muted); }\n #motion-preview { width: 100%; height: 100%; object-fit: contain; background: #000000; display: block; }\n #motion-preview.mirror { transform: scaleX(-1); }\n #motion-timer { position: absolute; top: 10px; left: 10px; display: none; padding: 3px 10px;\n border-radius: 999px; background: var(--bm-pink); color: #ffffff; font-size: 12px;\n font-family: var(--bm-font-mono); }\n #motion-timer.show { display: inline-block; }\n #motion-countdown { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center;\n justify-content: center; gap: 6px; background: var(--bm-scrim); pointer-events: none; }\n #motion-countdown.show { display: flex; }\n #motion-countdown-number { font-size: 96px; font-weight: 700; line-height: 1; color: #ffffff; }\n #motion-countdown-hint { font-size: 13px; color: #ffffff; opacity: 0.85; }\n #motion-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;\n text-align: center; padding: 20px; font-size: 13px; color: var(--bm-text-muted); }\n #motion-hint.hidden { display: none; }\n #motion-sources { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }\n #motion-file { display: none; }\n #motion-guidance { margin: 10px 0 0; font-size: 12px; color: var(--bm-text-muted); }\n #motion-options { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: end; }\n #motion-name, #motion-slot { width: 100%; }\n .motion-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; cursor: pointer; }\n .motion-check input { accent-color: var(--bm-aqua); }\n #motion-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }\n #motion-note { display: none; margin-top: 12px; padding: 12px; border-radius: 6px; font-size: 12px;\n background: var(--bm-surface-alt); border: 1px solid var(--bm-border-muted);\n color: var(--bm-text-muted); }\n #motion-note.show { display: block; }\n #motion-note code { display: block; margin-top: 6px; color: var(--bm-aqua);\n font-family: var(--bm-font-mono); word-break: break-all; }\n";
|
|
15
|
+
export declare const MOTION_PANEL_HTML = " <div id=\"motion-overlay\" class=\"bm-overlay\">\n <div id=\"motion-dialog\" class=\"bm-dialog\">\n <h2>Record a motion</h2>\n <p>Perform the move on camera, or pick a video. Uthana turns it into an animation clip for\n this game's characters. Costs sparks.</p>\n <div id=\"motion-stage\">\n <video id=\"motion-preview\" playsinline muted></video>\n <span id=\"motion-timer\">0:00</span>\n <div id=\"motion-countdown\"><span id=\"motion-countdown-number\">3</span><span id=\"motion-countdown-hint\">Get in frame</span></div>\n <div id=\"motion-hint\">Whole body in frame, one person, plain background, good light.\n 2–60 seconds.</div>\n </div>\n <div id=\"motion-sources\">\n <button id=\"motion-record\" class=\"bm-pill bm-pill--primary\" type=\"button\">Record with webcam</button>\n <button id=\"motion-stop\" class=\"bm-pill\" type=\"button\" hidden>Stop</button>\n <button id=\"motion-pick\" class=\"bm-pill\" type=\"button\">Choose a video…</button>\n <button id=\"motion-retake\" class=\"bm-pill bm-pill--ghost\" type=\"button\" hidden>Start over</button>\n <input id=\"motion-file\" type=\"file\" accept=\".mp4,.mov,.avi,.webm,video/mp4,video/quicktime,video/webm\">\n </div>\n <p id=\"motion-guidance\"></p>\n <div id=\"motion-options\">\n <div>\n <label class=\"bm-label\" for=\"motion-name\">Name</label>\n <input id=\"motion-name\" class=\"bm-input\" type=\"text\" placeholder=\"e.g. Victory dance\" maxlength=\"80\">\n </div>\n <div>\n <label class=\"bm-label\" for=\"motion-slot\">Use as</label>\n <select id=\"motion-slot\" class=\"bm-input\">\n <option value=\"\">One-shot clip</option>\n <option value=\"idle\">Idle</option>\n <option value=\"walk\">Walk</option>\n <option value=\"run\">Run</option>\n </select>\n </div>\n </div>\n <label class=\"motion-check\"><input id=\"motion-loop\" type=\"checkbox\"> Loops</label>\n <div id=\"motion-actions\">\n <button id=\"motion-close\" class=\"bm-pill bm-pill--ghost\" type=\"button\">Close</button>\n <button id=\"motion-submit\" class=\"bm-pill bm-pill--primary\" type=\"button\" disabled>Make the animation</button>\n </div>\n <div id=\"motion-note\">\n <span id=\"motion-note-text\"></span>\n <code id=\"motion-command\"></code>\n </div>\n </div>\n </div>\n";
|
|
16
|
+
/**
|
|
17
|
+
* Behaviour, spliced into the shell's IIFE. Runs after the shell's own helpers are defined, so
|
|
18
|
+
* `setStatus`, `start`, `autoReload`, `banner` and `frame` are in scope.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MOTION_PANEL_JS = "\n // ---- Record motion: webcam or file -> Uthana video-to-motion -> assets[] ----------------------\n var motionToggle = document.getElementById('motion');\n var motionOverlay = document.getElementById('motion-overlay');\n var motionPreview = document.getElementById('motion-preview');\n var motionTimer = document.getElementById('motion-timer');\n var motionCountdown = document.getElementById('motion-countdown');\n var motionCountdownNumber = document.getElementById('motion-countdown-number');\n /** Seconds shown on the live preview before the recorder starts, so the first frames are the pose. */\n var MOTION_COUNTDOWN_S = 3;\n var motionCountdownToken = 0;\n var motionHint = document.getElementById('motion-hint');\n var motionRecordBtn = document.getElementById('motion-record');\n var motionStopBtn = document.getElementById('motion-stop');\n var motionPickBtn = document.getElementById('motion-pick');\n var motionRetakeBtn = document.getElementById('motion-retake');\n var motionFile = document.getElementById('motion-file');\n var motionGuidance = document.getElementById('motion-guidance');\n var motionName = document.getElementById('motion-name');\n var motionSlot = document.getElementById('motion-slot');\n var motionLoop = document.getElementById('motion-loop');\n var motionSubmit = document.getElementById('motion-submit');\n var motionNote = document.getElementById('motion-note');\n var MOTION_MIN_S = 2;\n var MOTION_MAX_S = 60;\n var MOTION_MAX_BYTES = 200 * 1024 * 1024;\n var motionBlob = null;\n // Whether motionBlob came from the webcam recorder (auto-trim applies) or a picked file (it does not).\n var motionFromRecording = false;\n var motionSeconds = 0;\n var motionStream = null;\n var motionRecorder = null;\n var motionChunks = [];\n var motionTickTimer = null;\n var motionStartedAt = 0;\n var motionObjectUrl = null;\n\n function motionSupported() {\n return !!(window.isSecureContext && navigator.mediaDevices && navigator.mediaDevices.getUserMedia\n && typeof MediaRecorder !== 'undefined');\n }\n\n /** mp4 first (Safari), then the WebM the rest produce; asset-forger re-encodes either. */\n function pickMotionMime() {\n var candidates = ['video/mp4', 'video/webm;codecs=vp9', 'video/webm'];\n for (var i = 0; i < candidates.length; i++) {\n if (MediaRecorder.isTypeSupported(candidates[i])) return candidates[i];\n }\n return '';\n }\n\n function motionCameraError(error) {\n var name = error && error.name;\n if (name === 'NotAllowedError' || name === 'SecurityError') return 'Camera access was refused. Allow it in the address bar, or choose a video file.';\n if (name === 'NotFoundError' || name === 'OverconstrainedError') return 'No camera found. Choose a video file instead.';\n if (name === 'NotReadableError') return 'The camera is in use by another app. Close it, or choose a video file.';\n return 'Could not start the camera: ' + ((error && error.message) || 'unknown error');\n }\n\n function formatMotionClock(seconds) {\n var s = Math.max(0, Math.floor(seconds));\n var rest = s % 60;\n return Math.floor(s / 60) + ':' + (rest < 10 ? '0' : '') + rest;\n }\n\n function showMotionNote(text, command) {\n document.getElementById('motion-note-text').textContent = text;\n document.getElementById('motion-command').textContent = command || '';\n motionNote.classList.add('show');\n }\n\n function releaseMotionObjectUrl() {\n if (motionObjectUrl) { URL.revokeObjectURL(motionObjectUrl); motionObjectUrl = null; }\n }\n\n /** Stop the recorder if one is still live \u2014 it may already have stopped itself. */\n function discardMotionRecorder() {\n if (motionRecorder && motionRecorder.state !== 'inactive') {\n try { motionRecorder.stop(); } catch (error) { /* already stopped */ }\n }\n }\n\n function stopMotionStream() {\n if (motionStream) {\n motionStream.getTracks().forEach(function (track) { track.stop(); });\n motionStream = null;\n }\n if (motionTickTimer) { clearInterval(motionTickTimer); motionTickTimer = null; }\n motionCountdownToken++;\n motionCountdown.classList.remove('show');\n motionTimer.classList.remove('show');\n motionPreview.classList.remove('mirror');\n }\n\n function setMotionButtons(state) {\n motionRecordBtn.hidden = state !== 'idle';\n motionPickBtn.hidden = state !== 'idle';\n motionStopBtn.hidden = state !== 'recording';\n motionRetakeBtn.hidden = state !== 'ready';\n motionSubmit.disabled = state !== 'ready';\n }\n\n function resetMotionPanel() {\n stopMotionStream();\n discardMotionRecorder();\n motionRecorder = null;\n motionChunks = [];\n motionBlob = null;\n motionFromRecording = false;\n motionSeconds = 0;\n releaseMotionObjectUrl();\n motionPreview.srcObject = null;\n motionPreview.removeAttribute('src');\n motionPreview.controls = false;\n motionPreview.muted = true;\n motionHint.classList.remove('hidden');\n var supported = motionSupported();\n motionGuidance.textContent = supported ? '' : 'Webcam recording needs a secure page with a camera; choose a video file instead.';\n motionRecordBtn.disabled = !supported;\n motionNote.classList.remove('show');\n setMotionButtons('idle');\n }\n\n function openMotionPanel() {\n resetMotionPanel();\n motionOverlay.classList.add('show');\n motionName.focus();\n }\n\n /** Returns whether it was open \u2014 the Escape handler's contract, like closeAssetDetail. */\n function closeMotionPanel() {\n if (!motionOverlay.classList.contains('show')) return false;\n stopMotionStream();\n discardMotionRecorder();\n motionOverlay.classList.remove('show');\n frame.focus();\n return true;\n }\n\n /** The clip is in hand: show it back, and say whether it is within Uthana's 2-60 s window. */\n function acceptMotionClip(blob, seconds) {\n motionBlob = blob;\n motionSeconds = seconds;\n releaseMotionObjectUrl();\n motionObjectUrl = URL.createObjectURL(blob);\n motionPreview.srcObject = null;\n motionPreview.src = motionObjectUrl;\n motionPreview.controls = true;\n motionPreview.muted = true;\n motionHint.classList.add('hidden');\n var note;\n if (blob.size > MOTION_MAX_BYTES) note = 'That video is over 200 MB. Trim it to the seconds that matter.';\n else if (seconds > 0 && seconds < MOTION_MIN_S) note = 'Too short: Uthana needs at least ' + MOTION_MIN_S + ' seconds.';\n else if (seconds > MOTION_MAX_S) note = 'Too long: Uthana takes at most ' + MOTION_MAX_S + ' seconds. Trim it, or record again.';\n var ok = !note;\n motionGuidance.textContent = ok\n ? (seconds > 0 ? formatMotionClock(seconds) + ' of video ready.' : 'Video ready.')\n : note;\n setMotionButtons('ready');\n motionSubmit.disabled = !ok;\n }\n\n async function startMotionRecording() {\n if (!motionSupported()) return;\n motionNote.classList.remove('show');\n try {\n motionStream = await navigator.mediaDevices.getUserMedia({\n video: { width: { ideal: 1280 }, height: { ideal: 720 }, facingMode: 'user' }, audio: false\n });\n } catch (error) {\n motionGuidance.textContent = motionCameraError(error);\n return;\n }\n releaseMotionObjectUrl();\n motionPreview.removeAttribute('src');\n motionPreview.controls = false;\n motionPreview.srcObject = motionStream;\n motionPreview.classList.add('mirror');\n motionHint.classList.add('hidden');\n try { await motionPreview.play(); } catch (error) { /* autoplay refused; the stream still shows on interaction */ }\n var mime = pickMotionMime();\n try {\n motionRecorder = mime ? new MediaRecorder(motionStream, { mimeType: mime }) : new MediaRecorder(motionStream);\n } catch (error) {\n stopMotionStream();\n motionGuidance.textContent = 'This browser cannot record video. Choose a video file instead.';\n return;\n }\n // Count down on the live preview; Stop during the count aborts without recording.\n var token = ++motionCountdownToken;\n setMotionButtons('recording');\n motionGuidance.textContent = 'Get in frame \u2014 recording starts after the count.';\n motionCountdown.classList.add('show');\n for (var left = MOTION_COUNTDOWN_S; left > 0; left--) {\n motionCountdownNumber.textContent = String(left);\n await new Promise(function (resolve) { setTimeout(resolve, 1000); });\n if (token !== motionCountdownToken) return;\n }\n motionCountdown.classList.remove('show');\n motionChunks = [];\n motionRecorder.ondataavailable = function (event) { if (event.data && event.data.size > 0) motionChunks.push(event.data); };\n motionRecorder.onstop = function () {\n var seconds = (Date.now() - motionStartedAt) / 1000;\n var type = motionRecorder.mimeType || mime || 'video/webm';\n stopMotionStream();\n motionFromRecording = true;\n acceptMotionClip(new Blob(motionChunks, { type: type }), seconds);\n };\n motionStartedAt = Date.now();\n motionRecorder.start(1000);\n motionTimer.textContent = '0:00';\n motionTimer.classList.add('show');\n motionGuidance.textContent = 'Recording. Stop when the move is done (auto-stops at ' + MOTION_MAX_S + ' s).';\n motionTickTimer = setInterval(function () {\n var elapsed = (Date.now() - motionStartedAt) / 1000;\n motionTimer.textContent = formatMotionClock(elapsed);\n if (elapsed >= MOTION_MAX_S) stopMotionRecording();\n }, 250);\n }\n\n function stopMotionRecording() {\n if (motionRecorder && motionRecorder.state === 'recording') { motionRecorder.stop(); return; }\n // Stop pressed during the countdown: nothing was recorded, back to the start.\n if (motionCountdown.classList.contains('show')) resetMotionPanel();\n }\n\n function pickMotionFile(file) {\n if (!file) return;\n // Read the duration off the file itself; a picked video knows its length, a fresh WebM often\n // does not (Infinity), so 0 means \"unknown\" and the server's ffprobe is the judge.\n var probe = document.createElement('video');\n probe.preload = 'metadata';\n var url = URL.createObjectURL(file);\n var settled = false;\n var finish = function (seconds) {\n if (settled) return;\n settled = true;\n URL.revokeObjectURL(url);\n motionFromRecording = false;\n acceptMotionClip(file, seconds);\n };\n probe.onloadedmetadata = function () { finish(isFinite(probe.duration) ? probe.duration : 0); };\n probe.onerror = function () { finish(0); };\n probe.src = url;\n setTimeout(function () { finish(0); }, 3000);\n }\n\n var motionPollTimer = null;\n function pollMotionJob() {\n if (motionPollTimer) clearTimeout(motionPollTimer);\n var tick = async function () {\n var job;\n try {\n job = (await (await fetch('/api/editor/motion-status')).json()).job;\n } catch (error) {\n motionPollTimer = setTimeout(tick, 3000);\n return;\n }\n if (!job) return;\n if (job.status === 'running') {\n showMotionNote(job.message, '');\n setStatus('saving', 'Making the animation\u2026');\n motionPollTimer = setTimeout(tick, 3000);\n return;\n }\n if (job.status === 'failed') {\n showMotionNote('Could not make the animation: ' + job.message, '');\n setStatus('error', 'Animation failed');\n setMotionButtons('ready');\n return;\n }\n showMotionNote(job.message + ' Reloading to show it.', '');\n setStatus('saved', 'Animation added');\n setMotionButtons('ready');\n if (autoReload && !voxelSessionActive && !voxelSessionPending) start();\n else banner.classList.add('show');\n };\n void tick();\n }\n\n async function submitMotion() {\n if (!motionBlob) return;\n var name = motionName.value.trim();\n if (name === '') { motionName.focus(); return; }\n var query = '?name=' + encodeURIComponent(name)\n + '&slot=' + encodeURIComponent(motionSlot.value)\n + '&loop=' + (motionLoop.checked ? '1' : '0')\n + '&autoTrim=' + (motionFromRecording ? '1' : '0');\n motionSubmit.disabled = true;\n showMotionNote('Uploading the video\u2026', '');\n var response, result;\n try {\n response = await fetch('/api/editor/motion-video' + query, {\n method: 'POST',\n headers: { 'Content-Type': motionBlob.type || 'video/webm' },\n body: motionBlob\n });\n result = await response.json();\n } catch (error) {\n showMotionNote('Could not send the video to the sidecar.', '');\n motionSubmit.disabled = false;\n return;\n }\n if (!response.ok || result.ok !== true) {\n showMotionNote(result.error || 'The sidecar refused the video.', '');\n motionSubmit.disabled = false;\n return;\n }\n if (result.running !== true) {\n // The one case the sidecar cannot run itself: nobody is logged in.\n showMotionNote(result.reason || '', result.command || '');\n setStatus('saved', 'Video saved');\n return;\n }\n showMotionNote(result.note || 'Making the animation \u2014 this takes a few minutes. You can keep editing.', '');\n setStatus('saving', 'Making the animation\u2026');\n pollMotionJob();\n }\n\n motionToggle.addEventListener('click', openMotionPanel);\n document.getElementById('motion-close').addEventListener('click', function () { closeMotionPanel(); });\n motionOverlay.addEventListener('click', function (event) {\n if (event.target === motionOverlay) closeMotionPanel();\n });\n motionRecordBtn.addEventListener('click', function () { void startMotionRecording(); });\n motionStopBtn.addEventListener('click', stopMotionRecording);\n motionRetakeBtn.addEventListener('click', resetMotionPanel);\n motionPickBtn.addEventListener('click', function () { motionFile.value = ''; motionFile.click(); });\n motionFile.addEventListener('change', function () { pickMotionFile(motionFile.files && motionFile.files[0]); });\n motionSubmit.addEventListener('click', function () { void submitMotion(); });\n";
|