@bitmagic/cli 0.1.64-dev.3 → 0.1.64-dev.4
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 +27 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/generate.d.ts +43 -1
- package/dist/commands/generate.js +210 -12
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/tools.d.ts +1 -0
- package/dist/commands/tools.js +73 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/generate/animation-from-video.d.ts +11 -3
- package/dist/generate/animation-from-video.js +12 -2
- package/dist/generate/animation-from-video.js.map +1 -1
- package/dist/generate/video-review.d.ts +28 -0
- package/dist/generate/video-review.js +120 -0
- package/dist/generate/video-review.js.map +1 -0
- package/dist/scaffold/blender-level-skill-files.js +3 -3
- package/dist/scaffold/claude-settings.js +2 -0
- package/dist/scaffold/claude-settings.js.map +1 -1
- package/dist/scaffold/project-files.js +5 -1
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/unity-skill-files.js +1 -2
- package/dist/scaffold/unity-skill-files.js.map +1 -1
- package/dist/tools/bundles.d.ts +21 -0
- package/dist/tools/bundles.js +67 -0
- package/dist/tools/bundles.js.map +1 -0
- package/dist/trailer/ffmpeg.d.ts +10 -0
- package/dist/trailer/ffmpeg.js +51 -6
- package/dist/trailer/ffmpeg.js.map +1 -1
- package/dist/trailer/music-beats.js +4 -39
- package/dist/trailer/music-beats.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -202,7 +202,7 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
202
202
|
| `bitmagic publish [--visibility public\|private] [--name <name>] [--description <desc>] [--force] [--single-file] [--no-qr]` | Verify-gate, build if needed, and upload straight to GCS. `--single-file` publishes the offline bundle described under `bitmagic build`; switching the flag between runs always rebuilds, since it changes nothing on disk for the reuse check to notice. **Keeps the game's current visibility**; a new game is private until published with `--visibility public`. Shows the published URL as a QR code so you can scan it onto a phone — drawn in the terminal, or written to `.bitmagic/publish-qr.png` when it cannot be. `--no-qr` skips both. |
|
|
203
203
|
| `bitmagic self-update [--tag latest\|dev]` | Update the **CLI itself** to the newest build of its line, installing into the place this CLI actually lives rather than wherever the `npm` on your `PATH` would put it — which under nvm is routinely somewhere else. Reads the project's line from `bitmagic.json` when there is one, so it also fixes a wrong-line install; `--tag` overrides. Verifies the version on disk moved, and refuses (naming the path) for an `npx` run, a source checkout, or an install shape it cannot recognise. Not to be confused with `upgrade`, which is about the project's engine. |
|
|
204
204
|
| `bitmagic upgrade [--engine <version>] [--force]` | Refresh vendored platform files and the CLI's own skills to the currently published engine. Refuses a dirty git tree unless `--force`. Also records the project's `environment` in `bitmagic.json` if it has none yet — the engine it just vendored came from that api-server — and says so when it does. |
|
|
205
|
-
| `bitmagic generate <skybox\|background\|block-type\|sound\|music\|image\|video\|character\|animation\|model\|prop\|vehicle> ...` | Generate one asset directly into `src/work/world.json`. Costs sparks. `model` mints a **new** 3D object from a prompt, `prop` upgrades an existing placeholder **in place** (both produce voxels directly; `--mesh` takes the older mesh path), `vehicle` adds a new drivable one, `animation` takes a parameter spec rather than a prompt, `block-type` registers a custom voxel block, `video` makes a short clip for a cutscene (played with `engine.playVideo("<id>")`) — see below. `skybox` and `background` write the **same** field: pick one. |
|
|
205
|
+
| `bitmagic generate <skybox\|background\|block-type\|sound\|music\|image\|video\|character\|animation\|model\|prop\|vehicle> ...` | Generate one asset directly into `src/work/world.json`. Costs sparks. `model` mints a **new** 3D object from a prompt, `prop` upgrades an existing placeholder **in place** (both produce voxels directly; `--mesh` takes the older mesh path), `vehicle` adds a new drivable one, `animation` takes a parameter spec rather than a prompt, `block-type` registers a custom voxel block, `video` makes a short clip for a cutscene (played with `engine.playVideo("<id>")`) — see **Cutscene clips** below. `skybox` and `background` write the **same** field: pick one. |
|
|
206
206
|
| `bitmagic assets add <file> [--name <n>] [--asset-id <id>] [--keep-glb] [--voxel-size <m>] [--max-voxel-size <m>] [--height <m>] [--hollow\|--solid] [--force]` | Upload **your own** file — `.glb`, `.vxl`, `.png/.jpg/.webp`, `.opus/.ogg/.m4a/.mp3`, `.json` — into the game's assets and write its entry into `src/work/world.json`. A `.glb` is voxelized in a headless browser (Chrome + a free port in 3000–3199, like `prop`) unless `--keep-glb`. Free — no sparks. See **Adding your own assets** below. |
|
|
207
207
|
| `bitmagic assets list` | The assets in `world.json`: id, name, type, size, placed instances, and total references. Local, no network. |
|
|
208
208
|
| `bitmagic assets materials <assetId> [--set <file.json>] [--auto] [--clear]` | Show what an asset's voxels look like, or say what they are **made of** — so a sword's steel blade shines and its leather grip does not. With no flag it prints the asset's colour groups; `--set` applies your verdicts; `--auto` lets a model decide (what `generate prop` and `generate model` already do on their own); `--clear` removes them. Free — no sparks, nothing generated. See **Voxel materials** below. |
|
|
@@ -215,6 +215,7 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
215
215
|
| `bitmagic trailer analyze \| beats \| cut \| render \| merge` | The steps of `make` as separate commands: score a recording into highlight windows with contact sheets; detect a track's beat grid; turn `trailer/shots.json` into a frame-exact `edl.json`; render an EDL (`--ui` redraws the HUD, `--logo`, `--music …`); join recordings from separate sittings. |
|
|
216
216
|
| `bitmagic trailer publish <file.mp4> [--no-attach]` | Upload a trailer (`.mp4`/`.webm`, ≤ 200 MiB, header-checked so a renamed image is refused before upload) to the CDN under `game-media/<gameId>/` and put it at the front of the game page gallery. Re-running replaces the previous trailer (remembered in `.bitmagic/trailer/published.json`); the page is capped at 12 media items. Works before the first publish — the page goes live on the first `bitmagic publish --visibility public`. `--no-attach` uploads only. |
|
|
217
217
|
| `bitmagic forge --prompt "..." [--city\|--dungeon\|--platformer\|--freeform] [--name <name>] [--resume <jobId>]` | Design and bake a whole playable level into `world.json`. Costs sparks, and takes many minutes — the bake alone can take twenty. `--resume <jobId>` picks a failed run back up from the last step that finished, rather than redoing the whole thing. |
|
|
218
|
+
| `bitmagic tools <list\|path\|install> [bundle]` | The script bundles the CLI ships for skills that drive Blender or Python (`blender-level`, `unity-import`): what they are, where this install keeps them, and `install` to copy one into the project's `tools/`. Local, no network, no sparks. |
|
|
218
219
|
| `bitmagic levels <list\|add\|rename\|set-start\|remove> ...` | Manage the levels `forge` creates: which one boots, their names, registering a bake you already have, deleting one. Local, no network, no sparks. See **Managing levels** below. |
|
|
219
220
|
|
|
220
221
|
Every command exits non-zero on failure with a single-line message (no stack trace) and, where a
|
|
@@ -430,6 +431,7 @@ my-game/
|
|
|
430
431
|
<name>/ # that recording's analysis.json, sheets/, beats.json, music.mp3, edl.json and renders
|
|
431
432
|
published.json # the trailer's CDN URL after bitmagic trailer publish
|
|
432
433
|
previews/ # rendered asset thumbnails, cached so they are drawn once
|
|
434
|
+
videos/<assetId>.png # 8 frames from a generated clip, tiled — what `generate video` leaves to look at
|
|
433
435
|
build/
|
|
434
436
|
index.html # bitmagic build's output bundle
|
|
435
437
|
manifest.json # engineVersion, fingerprint, bytes, sha256, builtAt
|
|
@@ -503,6 +505,30 @@ Re-running on an unchanged design generates nothing and costs nothing — it rep
|
|
|
503
505
|
cover. Edit the design and run again, or pass `--force`, to replace it. Because it writes
|
|
504
506
|
`world.json`, it invalidates a passing verify: run it before `bitmagic verify`, not after.
|
|
505
507
|
|
|
508
|
+
## Cutscene clips
|
|
509
|
+
|
|
510
|
+
`bitmagic generate video --prompt "the castle gates swing open, dust drifting"` makes a short 720p
|
|
511
|
+
clip, writes it into `world.json` as a `type: "video"` asset, and prints the `engine.playVideo("<id>")`
|
|
512
|
+
call that plays it as a fullscreen overlay. `--duration` sets the length (billed per second);
|
|
513
|
+
`--image` animates a still you already have as the first frame, which is much slower and takes the
|
|
514
|
+
clip's shape from the image rather than the 16:9 default.
|
|
515
|
+
|
|
516
|
+
Because a clip is paid for before anyone can tell whether it is any good, the command leaves you
|
|
517
|
+
something to look at: **8 frames spread across the clip, tiled into `.bitmagic/videos/<assetId>.png`**.
|
|
518
|
+
Open it to check the clip actually shows what was asked for, without downloading the mp4 and writing
|
|
519
|
+
an ffmpeg filter by hand. It needs `ffmpeg` on `PATH`; without it the command still succeeds and
|
|
520
|
+
says why there are no frames. `--no-contact-sheet` skips the download.
|
|
521
|
+
|
|
522
|
+
The same pass says **whether the clip carries an audio track** — today's generated clips are silent,
|
|
523
|
+
so a cutscene that needs sound needs a music bed under it, and that is invisible in the frames.
|
|
524
|
+
|
|
525
|
+
To watch it move rather than as stills, `bitmagic dev`'s assets panel plays it.
|
|
526
|
+
|
|
527
|
+
One rule when you wire it up: call `engine.playVideo()` **from the Play click or later**, never
|
|
528
|
+
before. Without a prior user gesture the browser blocks autoplay, and the engine resolves the call
|
|
529
|
+
immediately — so the cutscene silently does not run. `engine/agent-docs/video-cutscenes.md` covers
|
|
530
|
+
that and what to freeze while a cutscene plays.
|
|
531
|
+
|
|
506
532
|
## Reference image
|
|
507
533
|
|
|
508
534
|
When a game has a strong setting — a tropical island, a neon city — one accepted concept image can
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -32,6 +32,7 @@ import { judgeCommand } from './commands/judge.js';
|
|
|
32
32
|
import { forgeCommand } from './commands/forge.js';
|
|
33
33
|
import { publishCommand } from './commands/publish.js';
|
|
34
34
|
import { iosCommand } from './commands/ios.js';
|
|
35
|
+
import { toolsCommand } from './commands/tools.js';
|
|
35
36
|
// citty's runMain() catches every error thrown from a command's `run()` internally and calls
|
|
36
37
|
// process.exit() itself — it never rejects the promise it returns, so the `.catch()` below
|
|
37
38
|
// never runs for those. For anything that isn't citty's own internal CLIError class, its catch
|
|
@@ -223,6 +224,7 @@ const rawCommands = {
|
|
|
223
224
|
forge: forgeCommand,
|
|
224
225
|
publish: publishCommand,
|
|
225
226
|
ios: iosCommand,
|
|
227
|
+
tools: toolsCommand,
|
|
226
228
|
};
|
|
227
229
|
export const subCommands = Object.fromEntries(Object.entries(rawCommands).map(([name, command]) => [name, withCleanErrors(command, name)]));
|
|
228
230
|
// This module only builds `main` and exports it (along with `subCommands` and `withCleanErrors`)
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAA0B,MAAM,gCAAgC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAsB,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAA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,CAAC,CAAC,CAAC,EAAE,IAAI;gBAC3E,cAAc,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;gBACjD,qBAAqB,MAAM,IAAI,IAAI,2CAA2C;gBAC9E,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,KAAK,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
|
|
@@ -102,7 +102,32 @@ export interface AnimationVideoArgs {
|
|
|
102
102
|
/** Any of the authored-spec flags, to refuse the two forms being mixed. */
|
|
103
103
|
spec?: string;
|
|
104
104
|
family?: string;
|
|
105
|
+
/** The prompt lane, to refuse a clip and a description being given at once. */
|
|
106
|
+
videoPrompt?: string;
|
|
105
107
|
}
|
|
108
|
+
export interface AnimationPromptArgs extends Omit<AnimationVideoArgs, 'video'> {
|
|
109
|
+
videoPrompt: string;
|
|
110
|
+
videoDuration?: number;
|
|
111
|
+
video?: string;
|
|
112
|
+
}
|
|
113
|
+
/** A `--video-prompt` run: everything `--video` carries, plus the clip to generate first. */
|
|
114
|
+
export interface AnimationFromPromptRun {
|
|
115
|
+
/** What the source clip should show, in the creator's words. */
|
|
116
|
+
description: string;
|
|
117
|
+
/** Source clip length in seconds; billed per second by the video leg. */
|
|
118
|
+
durationSeconds: number;
|
|
119
|
+
run: AnimationFromVideoRun;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* `--video-prompt` is `--video` with the clip generated instead of filmed, so it
|
|
123
|
+
* shares every downstream flag and refuses the same combinations. The extra
|
|
124
|
+
* refusal is the duration floor: `generate video` will happily make a 1 s clip,
|
|
125
|
+
* and Uthana will then reject it, which would bill the creator for footage that
|
|
126
|
+
* never had a chance.
|
|
127
|
+
*/
|
|
128
|
+
export declare function buildAnimationFromPromptRun(args: AnimationPromptArgs): AnimationFromPromptRun;
|
|
129
|
+
/** `--video` takes either a local file or an already-public clip URL. */
|
|
130
|
+
export declare function isHttpUrl(value: string): boolean;
|
|
106
131
|
/**
|
|
107
132
|
* `--video` is a different generator from the authored spec: the clip comes from a person, not
|
|
108
133
|
* a parameter file, so the two flag sets cannot be combined and the spec flags are refused here
|
|
@@ -280,9 +305,26 @@ export declare function runModelGeneration(options: {
|
|
|
280
305
|
* job record, so the dev view shows it beside every other generation.
|
|
281
306
|
*/
|
|
282
307
|
export declare function runAnimationFromVideo(run: AnimationFromVideoRun, json: boolean, deps?: GenerateRunDeps): Promise<void>;
|
|
308
|
+
/**
|
|
309
|
+
* The `--video-prompt` lane: text -> clip -> motion, the two existing job lanes run back to back.
|
|
310
|
+
*
|
|
311
|
+
* There is no chained endpoint behind this — asset-forger has one route that makes a video and
|
|
312
|
+
* another that reads one, and this is the seam between them. Both legs bill under their own
|
|
313
|
+
* existing key (`generate-video` per second, `generate-animation-from-video` flat), the way
|
|
314
|
+
* design-vehicle prices its chained image sub-generations rather than minting a composite.
|
|
315
|
+
*
|
|
316
|
+
* Both asset rows are kept. The clip is a real `type: 'video'` asset the creator can play back
|
|
317
|
+
* or reuse as a cutscene, and keeping it is also what makes a leg-2 failure recoverable: the
|
|
318
|
+
* footage is already paid for, so the error hands back a `--video <url>` retry instead of asking
|
|
319
|
+
* for the whole thing again.
|
|
320
|
+
*/
|
|
321
|
+
export declare function runAnimationFromPrompt(prompt: AnimationFromPromptRun, json: boolean, deps?: GenerateRunDeps, creatorPrompt?: string): Promise<void>;
|
|
283
322
|
/**
|
|
284
323
|
* Job-shaped rather than streamed (see generate/video.ts), so it cannot share `runAssetGeneration`;
|
|
285
324
|
* it does share the job record, so the dev view shows it beside every other generation.
|
|
286
325
|
*/
|
|
287
|
-
export declare function runVideoGeneration(run: VideoRun, json: boolean,
|
|
326
|
+
export declare function runVideoGeneration(run: VideoRun, json: boolean, options?: {
|
|
327
|
+
deps?: GenerateRunDeps;
|
|
328
|
+
contactSheet?: boolean;
|
|
329
|
+
}): Promise<void>;
|
|
288
330
|
export declare const generateCommand: import("citty").CommandDef<import("citty").ArgsDef>;
|
|
@@ -26,8 +26,9 @@ import { downloadMusicFile } from '../generate/music.js';
|
|
|
26
26
|
import { MUSIC_MAX_SECONDS, MUSIC_MIN_SECONDS, VIDEO_MAX_SECONDS, VIDEO_MIN_SECONDS } from '@bitmagic/asset-core';
|
|
27
27
|
import { generateAndInstallAnimationFromVideo, isLocomotionState, isVideoToMotionModel, } from '../generate/animation-from-video.js';
|
|
28
28
|
import { generateAndInstallVideo, IMAGE_EXTENSIONS, } from '../generate/video.js';
|
|
29
|
+
import { reviewGeneratedClip } from '../generate/video-review.js';
|
|
29
30
|
import { VIDEO_EXTENSIONS } from '../assets/file-kind.js';
|
|
30
|
-
import { LOCOMOTION_STATES, VIDEO_TO_MOTION_MODELS } from '@bitmagic/asset-core';
|
|
31
|
+
import { LOCOMOTION_STATES, VIDEO_TO_MOTION_MODELS, MOTION_SOURCE_DEFAULT_SECONDS, MOTION_SOURCE_MIN_SECONDS, buildMotionSourcePrompt, } from '@bitmagic/asset-core';
|
|
31
32
|
import { classifyAssetMaterialsQuietly } from '../assets/materials.js';
|
|
32
33
|
import { DEFAULT_MAX_VOXEL_SIZE, DEFAULT_MIN_VOXEL_SIZE, SOLID_FILL_MAX_HEIGHT_M } from './assets.js';
|
|
33
34
|
import { creatorPromptField, ORIGINAL_PROMPT_FLAG, withParent } from '../telemetry/creator-prompt.js';
|
|
@@ -253,6 +254,44 @@ export function buildAnimationBody(args, readSpec) {
|
|
|
253
254
|
spec,
|
|
254
255
|
});
|
|
255
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* `--video-prompt` is `--video` with the clip generated instead of filmed, so it
|
|
259
|
+
* shares every downstream flag and refuses the same combinations. The extra
|
|
260
|
+
* refusal is the duration floor: `generate video` will happily make a 1 s clip,
|
|
261
|
+
* and Uthana will then reject it, which would bill the creator for footage that
|
|
262
|
+
* never had a chance.
|
|
263
|
+
*/
|
|
264
|
+
export function buildAnimationFromPromptRun(args) {
|
|
265
|
+
if (args.spec !== undefined || args.family !== undefined) {
|
|
266
|
+
throw new CliError('--video-prompt cannot be combined with --spec or --family: a captured clip is not authored from a spec.');
|
|
267
|
+
}
|
|
268
|
+
if (args.video !== undefined) {
|
|
269
|
+
throw new CliError('--video and --video-prompt cannot be combined: pass a clip you have, or describe one to generate.');
|
|
270
|
+
}
|
|
271
|
+
if (args.videoPrompt.trim() === '') {
|
|
272
|
+
throw new CliError('--video-prompt needs a description of the motion, e.g. "a person waving both arms overhead".');
|
|
273
|
+
}
|
|
274
|
+
const durationSeconds = args.videoDuration ?? MOTION_SOURCE_DEFAULT_SECONDS;
|
|
275
|
+
if (!Number.isFinite(durationSeconds)
|
|
276
|
+
|| durationSeconds < MOTION_SOURCE_MIN_SECONDS || durationSeconds > VIDEO_MAX_SECONDS) {
|
|
277
|
+
throw new CliError(`--video-duration must be ${MOTION_SOURCE_MIN_SECONDS}-${VIDEO_MAX_SECONDS} seconds; `
|
|
278
|
+
+ `got ${JSON.stringify(String(args.videoDuration))}. Video-to-motion needs at least `
|
|
279
|
+
+ `${MOTION_SOURCE_MIN_SECONDS}s of footage to read.`);
|
|
280
|
+
}
|
|
281
|
+
// The clip half is validated by the same rules --video uses. No videoPath and
|
|
282
|
+
// no videoUrl yet: the first leg fills videoUrl in once it has produced one.
|
|
283
|
+
return { description: args.videoPrompt.trim(), durationSeconds, run: buildClipFlags(args) };
|
|
284
|
+
}
|
|
285
|
+
/** `--video` takes either a local file or an already-public clip URL. */
|
|
286
|
+
export function isHttpUrl(value) {
|
|
287
|
+
try {
|
|
288
|
+
const { protocol } = new URL(value);
|
|
289
|
+
return protocol === 'http:' || protocol === 'https:';
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
256
295
|
/**
|
|
257
296
|
* `--video` is a different generator from the authored spec: the clip comes from a person, not
|
|
258
297
|
* a parameter file, so the two flag sets cannot be combined and the spec flags are refused here
|
|
@@ -262,6 +301,20 @@ export function buildAnimationVideoRun(args) {
|
|
|
262
301
|
if (args.spec !== undefined || args.family !== undefined) {
|
|
263
302
|
throw new CliError('--video cannot be combined with --spec or --family: a video clip is not authored from a spec.');
|
|
264
303
|
}
|
|
304
|
+
if (args.videoPrompt !== undefined) {
|
|
305
|
+
throw new CliError('--video and --video-prompt cannot be combined: pass a clip you have, or describe one to generate.');
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
// A URL is handed straight to the job; only a local file needs uploading.
|
|
309
|
+
...(isHttpUrl(args.video) ? { videoUrl: args.video } : { videoPath: args.video }),
|
|
310
|
+
...buildClipFlags(args),
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* The flags that describe the CLIP rather than where it came from, shared by
|
|
315
|
+
* `--video` and `--video-prompt` so the two lanes cannot drift apart.
|
|
316
|
+
*/
|
|
317
|
+
function buildClipFlags(args) {
|
|
265
318
|
if (args.slot !== undefined && !isLocomotionState(args.slot)) {
|
|
266
319
|
throw new CliError(`--slot must be one of ${LOCOMOTION_STATES.join(', ')}; got ${JSON.stringify(args.slot)}.`);
|
|
267
320
|
}
|
|
@@ -283,7 +336,6 @@ export function buildAnimationVideoRun(args) {
|
|
|
283
336
|
}
|
|
284
337
|
}
|
|
285
338
|
return {
|
|
286
|
-
videoPath: args.video,
|
|
287
339
|
...(args.name !== undefined ? { name: args.name } : {}),
|
|
288
340
|
...(args.model !== undefined ? { model: args.model } : {}),
|
|
289
341
|
...(args.loop !== undefined ? { loop: args.loop } : {}),
|
|
@@ -1164,25 +1216,40 @@ const animationCommand = defineCommand({
|
|
|
1164
1216
|
video: {
|
|
1165
1217
|
type: 'string',
|
|
1166
1218
|
description: `Make the clip from a video of one person instead of a spec (Uthana video-to-motion, costs sparks). `
|
|
1167
|
-
+
|
|
1219
|
+
+ `A local ${VIDEO_EXTENSIONS.map((e) => `.${e}`).join('/')} file, or an http(s) URL of one already uploaded. `
|
|
1220
|
+
+ `2-60 s, full body in frame. Cannot be combined with --spec/--family/--video-prompt.`,
|
|
1221
|
+
},
|
|
1222
|
+
'video-prompt': {
|
|
1223
|
+
type: 'string',
|
|
1224
|
+
description: 'Describe a motion and have the source clip generated instead of filmed '
|
|
1225
|
+
+ '(costs sparks for both the clip and the motion). The clip is framed automatically for '
|
|
1226
|
+
+ 'capture: one person, whole body in shot, static camera. Cannot be combined with '
|
|
1227
|
+
+ '--video/--spec/--family.',
|
|
1228
|
+
},
|
|
1229
|
+
'video-duration': {
|
|
1230
|
+
type: 'string',
|
|
1231
|
+
description: `Length of the generated source clip in seconds, ${MOTION_SOURCE_MIN_SECONDS}-${VIDEO_MAX_SECONDS} `
|
|
1232
|
+
+ `(default ${MOTION_SOURCE_DEFAULT_SECONDS}); with --video-prompt. Billed per second. Not --duration, which is `
|
|
1233
|
+
+ 'the authored-spec clip length.',
|
|
1168
1234
|
},
|
|
1169
1235
|
model: {
|
|
1170
1236
|
type: 'string',
|
|
1171
|
-
description: `Video-to-motion model (with --video): ${VIDEO_TO_MOTION_MODELS.join(' | ')}.`,
|
|
1237
|
+
description: `Video-to-motion model (with --video or --video-prompt): ${VIDEO_TO_MOTION_MODELS.join(' | ')}.`,
|
|
1172
1238
|
},
|
|
1173
1239
|
loop: {
|
|
1174
1240
|
type: 'boolean',
|
|
1175
|
-
description: 'Mark the clip as looping (with --video). Idle, walk and run clips should loop.',
|
|
1241
|
+
description: 'Mark the clip as looping (with --video/--video-prompt). Idle, walk and run clips should loop.',
|
|
1176
1242
|
},
|
|
1177
1243
|
slot: {
|
|
1178
1244
|
type: 'string',
|
|
1179
|
-
description: `Pin the clip to a locomotion state for the player and every NPC (with --video): ${LOCOMOTION_STATES.join(' | ')}. `
|
|
1245
|
+
description: `Pin the clip to a locomotion state for the player and every NPC (with --video/--video-prompt): ${LOCOMOTION_STATES.join(' | ')}. `
|
|
1180
1246
|
+ 'Omit for a one-shot clip played with playCustomAnimation().',
|
|
1181
1247
|
},
|
|
1182
1248
|
'auto-trim': {
|
|
1183
1249
|
type: 'boolean',
|
|
1184
1250
|
description: 'Cut "walking to the camera" frames off both ends of the video before the motion is made (with --video). '
|
|
1185
|
-
+ 'Useful for clips recorded webcam-style; the dev-view recorder instead confirms an explicit window.'
|
|
1251
|
+
+ 'Useful for clips recorded webcam-style; the dev-view recorder instead confirms an explicit window. '
|
|
1252
|
+
+ 'A generated --video-prompt clip has no such frames, so it rarely needs this.',
|
|
1186
1253
|
},
|
|
1187
1254
|
'trim-start': {
|
|
1188
1255
|
type: 'string',
|
|
@@ -1197,6 +1264,25 @@ const animationCommand = defineCommand({
|
|
|
1197
1264
|
json: JSON_FLAG,
|
|
1198
1265
|
},
|
|
1199
1266
|
async run({ args }) {
|
|
1267
|
+
if (args['video-prompt'] !== undefined) {
|
|
1268
|
+
const run = buildAnimationFromPromptRun({
|
|
1269
|
+
videoPrompt: args['video-prompt'],
|
|
1270
|
+
videoDuration: args['video-duration'] !== undefined ? Number(args['video-duration']) : undefined,
|
|
1271
|
+
video: args.video,
|
|
1272
|
+
name: args.name,
|
|
1273
|
+
model: args.model,
|
|
1274
|
+
loop: args.loop === true ? true : undefined,
|
|
1275
|
+
slot: args.slot,
|
|
1276
|
+
autoTrim: args['auto-trim'] === true ? true : undefined,
|
|
1277
|
+
trimStart: args['trim-start'] !== undefined ? Number(args['trim-start']) : undefined,
|
|
1278
|
+
trimEnd: args['trim-end'] !== undefined ? Number(args['trim-end']) : undefined,
|
|
1279
|
+
assetId: args['asset-id'],
|
|
1280
|
+
spec: args.spec,
|
|
1281
|
+
family: args.family,
|
|
1282
|
+
});
|
|
1283
|
+
await runAnimationFromPrompt(run, args.json === true, undefined, creatorPromptField(args).creatorPrompt);
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1200
1286
|
if (args.video !== undefined) {
|
|
1201
1287
|
const run = buildAnimationVideoRun({
|
|
1202
1288
|
video: args.video,
|
|
@@ -1236,7 +1322,7 @@ const animationCommand = defineCommand({
|
|
|
1236
1322
|
*/
|
|
1237
1323
|
export async function runAnimationFromVideo(run, json, deps) {
|
|
1238
1324
|
const { output, runDeps, context, environment, token } = await resolveRun(json, deps);
|
|
1239
|
-
const label = run.name ?? path.basename(run.videoPath);
|
|
1325
|
+
const label = run.name ?? (run.videoPath !== undefined ? path.basename(run.videoPath) : 'Recorded motion');
|
|
1240
1326
|
const result = await withJobRecord({
|
|
1241
1327
|
root: context.root, kind: 'animation-video', label, log: runDeps.log,
|
|
1242
1328
|
}, async (log) => {
|
|
@@ -1272,6 +1358,85 @@ export async function runAnimationFromVideo(run, json, deps) {
|
|
|
1272
1358
|
});
|
|
1273
1359
|
runDeps.log(DEV_VIEW_RELOADS);
|
|
1274
1360
|
}
|
|
1361
|
+
/**
|
|
1362
|
+
* The `--video-prompt` lane: text -> clip -> motion, the two existing job lanes run back to back.
|
|
1363
|
+
*
|
|
1364
|
+
* There is no chained endpoint behind this — asset-forger has one route that makes a video and
|
|
1365
|
+
* another that reads one, and this is the seam between them. Both legs bill under their own
|
|
1366
|
+
* existing key (`generate-video` per second, `generate-animation-from-video` flat), the way
|
|
1367
|
+
* design-vehicle prices its chained image sub-generations rather than minting a composite.
|
|
1368
|
+
*
|
|
1369
|
+
* Both asset rows are kept. The clip is a real `type: 'video'` asset the creator can play back
|
|
1370
|
+
* or reuse as a cutscene, and keeping it is also what makes a leg-2 failure recoverable: the
|
|
1371
|
+
* footage is already paid for, so the error hands back a `--video <url>` retry instead of asking
|
|
1372
|
+
* for the whole thing again.
|
|
1373
|
+
*/
|
|
1374
|
+
export async function runAnimationFromPrompt(prompt, json, deps, creatorPrompt) {
|
|
1375
|
+
const { output, runDeps, context, environment, token } = await resolveRun(json, deps);
|
|
1376
|
+
const label = prompt.run.name ?? prompt.description;
|
|
1377
|
+
const video = await withJobRecord({
|
|
1378
|
+
root: context.root, kind: 'video', label: `${label} (motion source)`, log: runDeps.log,
|
|
1379
|
+
}, async (log) => {
|
|
1380
|
+
try {
|
|
1381
|
+
return await generateAndInstallVideo({
|
|
1382
|
+
context, environment, token,
|
|
1383
|
+
run: {
|
|
1384
|
+
prompt: buildMotionSourcePrompt(prompt.description),
|
|
1385
|
+
durationSeconds: prompt.durationSeconds,
|
|
1386
|
+
name: `${label} (motion source)`,
|
|
1387
|
+
...(creatorPrompt !== undefined ? { creatorPrompt } : {}),
|
|
1388
|
+
},
|
|
1389
|
+
deps: { fetch: runDeps.fetch, sleep: runDeps.sleep, log },
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
catch (error) {
|
|
1393
|
+
throw decoratedError(error, (message) => message);
|
|
1394
|
+
}
|
|
1395
|
+
});
|
|
1396
|
+
runDeps.log(`Source clip generated (${video.durationSeconds.toFixed(1)}s): ${video.videoUrl}`);
|
|
1397
|
+
const motion = await withJobRecord({
|
|
1398
|
+
root: context.root, kind: 'animation-video', label, log: runDeps.log,
|
|
1399
|
+
}, async (log) => {
|
|
1400
|
+
try {
|
|
1401
|
+
return await generateAndInstallAnimationFromVideo({
|
|
1402
|
+
context, environment, token,
|
|
1403
|
+
run: { ...prompt.run, videoUrl: video.videoUrl, name: label },
|
|
1404
|
+
deps: { fetch: runDeps.fetch, sleep: runDeps.sleep, log },
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
catch (error) {
|
|
1408
|
+
// The clip survived and is already an asset, so say what it costs to pick
|
|
1409
|
+
// up from here rather than letting the creator re-buy the footage.
|
|
1410
|
+
throw decoratedError(error, (message) => `${message}\n`
|
|
1411
|
+
+ `The source clip was kept as asset "${video.assetId}". Retry the motion without `
|
|
1412
|
+
+ `regenerating it:\n bitmagic generate animation --video ${video.videoUrl} --name ${JSON.stringify(label)}`);
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
const sparksCharged = video.sparksCharged + motion.sparksCharged;
|
|
1416
|
+
const patchesApplied = video.patchesApplied + motion.patchesApplied;
|
|
1417
|
+
runDeps.log(`Generated animation "${label}" from a generated clip (${motion.durationSeconds.toFixed(1)}s)${describeAutoTrim(motion)}: ${motion.animationUrl}`);
|
|
1418
|
+
runDeps.log(` - motionId ${motion.motionId}${motion.locomotionState ? ` — pinned to ${motion.locomotionState}` : ''}`);
|
|
1419
|
+
runDeps.log(` - source clip asset ${video.assetId}`);
|
|
1420
|
+
runDeps.log(`world.json updated (${patchesApplied} patch${patchesApplied === 1 ? '' : 'es'}).`);
|
|
1421
|
+
if (!motion.locomotionState) {
|
|
1422
|
+
runDeps.log(`Play it with playCustomAnimation("${motion.motionId}"), or re-run with --slot idle|walk|run to make it locomotion.`);
|
|
1423
|
+
}
|
|
1424
|
+
output.result({
|
|
1425
|
+
ok: true,
|
|
1426
|
+
kind: 'animation',
|
|
1427
|
+
motionId: motion.motionId,
|
|
1428
|
+
animationUrl: motion.animationUrl,
|
|
1429
|
+
durationSeconds: motion.durationSeconds,
|
|
1430
|
+
sourceVideoAssetId: video.assetId,
|
|
1431
|
+
sourceVideoUrl: video.videoUrl,
|
|
1432
|
+
...(motion.trimmedStartSeconds !== undefined ? { trimmedStartSeconds: motion.trimmedStartSeconds } : {}),
|
|
1433
|
+
...(motion.trimmedEndSeconds !== undefined ? { trimmedEndSeconds: motion.trimmedEndSeconds } : {}),
|
|
1434
|
+
...(motion.locomotionState ? { locomotionState: motion.locomotionState } : {}),
|
|
1435
|
+
sparksCharged,
|
|
1436
|
+
patchesApplied,
|
|
1437
|
+
});
|
|
1438
|
+
runDeps.log(DEV_VIEW_RELOADS);
|
|
1439
|
+
}
|
|
1275
1440
|
const videoCommand = defineCommand({
|
|
1276
1441
|
meta: {
|
|
1277
1442
|
name: 'video',
|
|
@@ -1304,6 +1469,12 @@ const videoCommand = defineCommand({
|
|
|
1304
1469
|
type: 'string',
|
|
1305
1470
|
description: 'Pre-minted asset_… id to store the clip under, so code already referencing it resolves.',
|
|
1306
1471
|
},
|
|
1472
|
+
'contact-sheet': {
|
|
1473
|
+
type: 'boolean',
|
|
1474
|
+
default: true,
|
|
1475
|
+
description: 'Grab 8 frames into a PNG under .bitmagic/videos/ so the clip can be reviewed (the default). '
|
|
1476
|
+
+ 'Pass --no-contact-sheet to skip the download; needs ffmpeg.',
|
|
1477
|
+
},
|
|
1307
1478
|
'original-prompt': ORIGINAL_PROMPT_FLAG,
|
|
1308
1479
|
json: JSON_FLAG,
|
|
1309
1480
|
},
|
|
@@ -1321,15 +1492,15 @@ const videoCommand = defineCommand({
|
|
|
1321
1492
|
...(args['asset-id'] !== undefined ? { assetId: args['asset-id'] } : {}),
|
|
1322
1493
|
...creatorPromptField(args),
|
|
1323
1494
|
};
|
|
1324
|
-
await runVideoGeneration(run, args.json === true);
|
|
1495
|
+
await runVideoGeneration(run, args.json === true, { contactSheet: args['contact-sheet'] !== false });
|
|
1325
1496
|
},
|
|
1326
1497
|
});
|
|
1327
1498
|
/**
|
|
1328
1499
|
* Job-shaped rather than streamed (see generate/video.ts), so it cannot share `runAssetGeneration`;
|
|
1329
1500
|
* it does share the job record, so the dev view shows it beside every other generation.
|
|
1330
1501
|
*/
|
|
1331
|
-
export async function runVideoGeneration(run, json,
|
|
1332
|
-
const { output, runDeps, context, environment, token } = await resolveRun(json, deps);
|
|
1502
|
+
export async function runVideoGeneration(run, json, options = {}) {
|
|
1503
|
+
const { output, runDeps, context, environment, token } = await resolveRun(json, options.deps);
|
|
1333
1504
|
const label = run.name ?? run.prompt;
|
|
1334
1505
|
const result = await withJobRecord({
|
|
1335
1506
|
root: context.root, kind: 'video', label, log: runDeps.log,
|
|
@@ -1349,7 +1520,32 @@ export async function runVideoGeneration(run, json, deps) {
|
|
|
1349
1520
|
: '';
|
|
1350
1521
|
runDeps.log(`Generated video "${label}" (${result.durationSeconds.toFixed(1)}s${shape}): ${result.videoUrl}`);
|
|
1351
1522
|
runDeps.log(`world.json updated (${result.patchesApplied} patch${result.patchesApplied === 1 ? '' : 'es'}).`);
|
|
1352
|
-
|
|
1523
|
+
const review = options.contactSheet === false
|
|
1524
|
+
? null
|
|
1525
|
+
: await reviewGeneratedClip({
|
|
1526
|
+
root: context.root,
|
|
1527
|
+
assetId: result.assetId,
|
|
1528
|
+
videoUrl: result.videoUrl,
|
|
1529
|
+
durationSeconds: result.durationSeconds,
|
|
1530
|
+
fetch: runDeps.fetch,
|
|
1531
|
+
});
|
|
1532
|
+
if (review !== null) {
|
|
1533
|
+
if (review.sheetPath !== null)
|
|
1534
|
+
runDeps.log(`Frames: ${review.sheetPath}`);
|
|
1535
|
+
// Silence is what decides whether the cutscene needs a music bed under it, and it is
|
|
1536
|
+
// invisible in the frames — so it is said in words either way, never left to be assumed.
|
|
1537
|
+
if (review.hasAudioTrack === false) {
|
|
1538
|
+
runDeps.log('The clip has NO audio track — play a music bed under it if the cutscene needs sound.');
|
|
1539
|
+
}
|
|
1540
|
+
else if (review.hasAudioTrack === true) {
|
|
1541
|
+
runDeps.log('The clip carries its own audio track.');
|
|
1542
|
+
}
|
|
1543
|
+
for (const note of review.notes)
|
|
1544
|
+
runDeps.log(` ${note}`);
|
|
1545
|
+
}
|
|
1546
|
+
runDeps.log(`Play it with engine.playVideo("${result.assetId}") — from the Play click or later, `
|
|
1547
|
+
+ 'never before: without a prior user gesture the browser blocks autoplay and the clip silently '
|
|
1548
|
+
+ 'does not run. See video-cutscenes.md.');
|
|
1353
1549
|
output.result({
|
|
1354
1550
|
ok: true,
|
|
1355
1551
|
kind: 'video',
|
|
@@ -1361,6 +1557,8 @@ export async function runVideoGeneration(run, json, deps) {
|
|
|
1361
1557
|
...(result.height !== undefined ? { height: result.height } : {}),
|
|
1362
1558
|
sparksCharged: result.sparksCharged,
|
|
1363
1559
|
patchesApplied: result.patchesApplied,
|
|
1560
|
+
...(review?.sheetPath != null ? { contactSheetPath: review.sheetPath } : {}),
|
|
1561
|
+
...(review?.hasAudioTrack != null ? { hasAudioTrack: review.hasAudioTrack } : {}),
|
|
1364
1562
|
});
|
|
1365
1563
|
runDeps.log(DEV_VIEW_RELOADS);
|
|
1366
1564
|
}
|