@aixcut/vibevideo 0.1.0-beta.0 → 0.1.0-beta.1
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 +35 -5
- package/dist/skills/vibevideo/SKILL.md +75 -0
- package/dist/skills/vibevideo/assets/pixi/01-kinetic-title.mjs +76 -0
- package/dist/skills/vibevideo/assets/pixi/02-flow-map.mjs +76 -0
- package/dist/skills/vibevideo/assets/pixi/03-nested-board.mjs +69 -0
- package/dist/skills/vibevideo/assets/pixi/04-compact-callout.mjs +40 -0
- package/dist/skills/vibevideo/assets/pixi/README.md +11 -0
- package/dist/skills/vibevideo/references/authoring.md +160 -0
- package/dist/skills/vibevideo/references/editing-and-reload.md +99 -0
- package/dist/skills/vibevideo/references/editor-connection.md +44 -0
- package/dist/skills/vibevideo/references/examples.md +230 -0
- package/dist/skills/vibevideo/references/graphic-workflow.md +167 -0
- package/dist/skills/vibevideo/references/hevc-encoder.md +12 -0
- package/dist/skills/vibevideo/references/runtime-api.md +211 -0
- package/dist/skills/vibevideo/references/validation.md +109 -0
- package/dist/skills/vibevideo-cli/SKILL.md +86 -0
- package/dist/skills/vibevideo-cli/references/agent-protocol.md +39 -0
- package/dist/skills-manifest.json +14 -0
- package/dist/studio/assets/{browserAll-wERvpUP9.js → browserAll-0i6gm1iO.js} +1 -1
- package/dist/studio/assets/{index-bnkX1rLy.js → index-DqX5Prpj.js} +3 -3
- package/dist/studio/assets/{prores-encoder-mediabunny-hm5PQfLy.js → prores-encoder-mediabunny-DjdaA3bm.js} +2 -2
- package/dist/studio/assets/{webworkerAll-Baf-n-Bc.js → webworkerAll-Xo9FRLTy.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
- package/src/cli.mjs +30 -3
- package/src/skills.mjs +110 -0
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ and video export. This package includes the prebuilt Studio and its runtimes;
|
|
|
6
6
|
users do not need to clone the repository or install a compiler.
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npx @aixcut/vibevideo@
|
|
10
|
-
npx @aixcut/vibevideo@
|
|
11
|
-
npx @aixcut/vibevideo@
|
|
12
|
-
npx @aixcut/vibevideo@
|
|
9
|
+
npx @aixcut/vibevideo@beta
|
|
10
|
+
npx @aixcut/vibevideo@beta init my-video
|
|
11
|
+
npx @aixcut/vibevideo@beta open ./my-video
|
|
12
|
+
npx @aixcut/vibevideo@beta doctor
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Or install globally with `npm install -g @aixcut/vibevideo`, then use `vibevideo`.
|
|
15
|
+
Or install globally with `npm install -g @aixcut/vibevideo@beta`, then use `vibevideo`.
|
|
16
16
|
The local server stays in the foreground; Ctrl+C stops it. Use `--no-open` to
|
|
17
17
|
open the printed URL yourself, or `--port 4567` for a stable browser origin.
|
|
18
18
|
Reusing a port also preserves browser-local preferences and session storage.
|
|
@@ -26,6 +26,36 @@ This release does not provide unattended command-line video rendering.
|
|
|
26
26
|
|
|
27
27
|
## Coding agents
|
|
28
28
|
|
|
29
|
+
Install the two bundled core Skills (`vibevideo` and `vibevideo-cli`):
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npx @aixcut/vibevideo@beta skills install
|
|
33
|
+
npx @aixcut/vibevideo@beta skills check
|
|
34
|
+
npx @aixcut/vibevideo@beta skills update
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Skills and their references/starter sources ship inside the npm package, so
|
|
38
|
+
these commands work offline after the CLI is installed and always match that
|
|
39
|
+
CLI version. `install` adds only missing Skills. `update` replaces unchanged
|
|
40
|
+
managed copies; local edits, symlinks and unmanaged folders are left intact and
|
|
41
|
+
reported. `check` exits nonzero for missing, outdated or conflicting Skills.
|
|
42
|
+
All three commands support `--json`.
|
|
43
|
+
|
|
44
|
+
The default is the shared `~/.agents/skills` store plus existing Codex, Claude
|
|
45
|
+
Code and Cursor configurations. Use `--agent codex`, `--agent claude`,
|
|
46
|
+
`--agent cursor` or `--agent universal` to select one. Codex honors `CODEX_HOME`.
|
|
47
|
+
Use `--dir ./my-skills` for an explicit destination, instead of `--agent`.
|
|
48
|
+
Refresh/restart your coding agent after installing so it discovers the Skills.
|
|
49
|
+
|
|
50
|
+
`init` also installs missing core Skills without updating existing ones. Pass
|
|
51
|
+
`--skip-skills` to leave Skills untouched, or `--agent`/`--dir` to choose its
|
|
52
|
+
installation target. A Skills installation failure does not prevent the new
|
|
53
|
+
project from being created. Plain Studio startup and `open` do not install Skills.
|
|
54
|
+
|
|
55
|
+
Once discovered, ask your agent to use the `vibevideo` Skill to make or revise a
|
|
56
|
+
video. It teaches the source lifecycle, editable objects, session commands,
|
|
57
|
+
verification and the current UI export boundary.
|
|
58
|
+
|
|
29
59
|
The running CLI prints an agent session file path. Keep that file private;
|
|
30
60
|
it contains a temporary local connection credential. Use it with:
|
|
31
61
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vibevideo
|
|
3
|
+
description: Create and edit videos with Vibevideo Studio using editable HTML, PixiJS and Three.js graphics. Use for motion graphics, animated titles, scenes, and revisions in a Vibevideo project.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Vibevideo
|
|
7
|
+
|
|
8
|
+
Produce editable source and verify it in the local Studio. Respect the user's
|
|
9
|
+
chosen output: a source-only request does not require opening Studio or exporting
|
|
10
|
+
video. Vibevideo has no built-in AI chat, media generation or cloud rendering.
|
|
11
|
+
|
|
12
|
+
## Start or resume
|
|
13
|
+
|
|
14
|
+
Read [Studio connection and projects](references/editor-connection.md). Use the
|
|
15
|
+
installed CLI or `npx @aixcut/vibevideo@beta`; use an explicit matching version
|
|
16
|
+
when the project pins one. The adjacent [CLI skill](../vibevideo-cli/SKILL.md)
|
|
17
|
+
explains sessions and command errors. Existing projects use `open`, new ones use
|
|
18
|
+
`init`. Keep the server process and Studio tab alive while working.
|
|
19
|
+
|
|
20
|
+
Before creating assets, establish the intended content, aspect ratio, duration,
|
|
21
|
+
and which objects need future edits. Infer details from the user's brief and
|
|
22
|
+
existing project; ask only for material missing choices. Revisions preserve the
|
|
23
|
+
chosen visual direction and stable object addresses.
|
|
24
|
+
|
|
25
|
+
## Author graphics
|
|
26
|
+
|
|
27
|
+
Read [runtime-api.md](references/runtime-api.md) before writing an entry point.
|
|
28
|
+
For composition, timing, fonts and media, use [authoring.md](references/authoring.md).
|
|
29
|
+
For editable nodes, Pixi registration and a complete starter, use
|
|
30
|
+
[graphic-workflow.md](references/graphic-workflow.md). Ready-to-copy Pixi sources
|
|
31
|
+
are in [assets/pixi](assets/pixi/README.md); other patterns are in
|
|
32
|
+
[examples.md](references/examples.md).
|
|
33
|
+
|
|
34
|
+
- Use self-contained `.mjs`/`.js`, or an HTML project with an inline module or
|
|
35
|
+
project-local relative imports. Available runtime libraries are `three`,
|
|
36
|
+
`gsap`, and `pixi.js`; arbitrary npm packages and remote module URLs are not
|
|
37
|
+
supplied by the graphic sandbox.
|
|
38
|
+
- `mount` creates and loads resources; `render({ timeSeconds })` evaluates any
|
|
39
|
+
requested time independently; `draw()` paints after overrides; `dispose()`
|
|
40
|
+
releases owned resources. Avoid running tickers or cumulative frame updates.
|
|
41
|
+
- Return real Three.js scene/camera objects. Register editable Pixi nodes with
|
|
42
|
+
stable addresses and declared capabilities. Plain Canvas drawing commands are
|
|
43
|
+
not independent editable objects.
|
|
44
|
+
- Keep source files in a user project. Writing source alone does not import it
|
|
45
|
+
into the Studio timeline.
|
|
46
|
+
|
|
47
|
+
## Import and revise
|
|
48
|
+
|
|
49
|
+
Use `agent import --file ... --session ...` and wait for its result. The result
|
|
50
|
+
contains `clipId` and `assetId`; use these returned IDs for subsequent operations.
|
|
51
|
+
Read [editing-and-reload.md](references/editing-and-reload.md) for object edits,
|
|
52
|
+
source replacement, stable addresses and coordinate systems. Command payloads
|
|
53
|
+
are described in the CLI skill's [agent protocol](../vibevideo-cli/references/agent-protocol.md).
|
|
54
|
+
|
|
55
|
+
Standalone imported graphics are copied into the project's `assets/` directory.
|
|
56
|
+
For later source edits, edit the corresponding saved asset (the manifest maps
|
|
57
|
+
IDs to files), or replace the existing clip through an import command with
|
|
58
|
+
`clipId`. Editing the original pre-import file does not update the saved copy.
|
|
59
|
+
Do not blindly repeat an import after a timeout: inspect the existing timeline
|
|
60
|
+
first so a completed command does not create duplicate clips.
|
|
61
|
+
|
|
62
|
+
## Verify and deliver
|
|
63
|
+
|
|
64
|
+
Read [validation.md](references/validation.md). Inspect meaningful frames,
|
|
65
|
+
forward/reverse seeks, editable-object selection, and persistence after changing
|
|
66
|
+
an exposed value. When browser tools are available, inspect actual rendered
|
|
67
|
+
frames rather than treating a successful command as visual proof.
|
|
68
|
+
|
|
69
|
+
Export through Studio's **导出视频** dialog. This release has no CLI `render`
|
|
70
|
+
command. Confirm the resulting file, duration, audio when requested, and sample
|
|
71
|
+
decoded frames. If browser interaction or export is unavailable, report that
|
|
72
|
+
limit and deliver the source/project without claiming a completed video.
|
|
73
|
+
|
|
74
|
+
Deliver the project/source location, editable parameters, and the checks
|
|
75
|
+
actually performed. Keep the source and user edits alongside any final render.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// @vibevideo:content-bounds 120,120,1040,480
|
|
2
|
+
export default async function mount({ root, viewport, modules }) {
|
|
3
|
+
const { Application, Container, Graphics, Text } = modules.PIXI;
|
|
4
|
+
const app = new Application();
|
|
5
|
+
await app.init({
|
|
6
|
+
width: viewport.width,
|
|
7
|
+
height: viewport.height,
|
|
8
|
+
autoStart: false,
|
|
9
|
+
sharedTicker: false,
|
|
10
|
+
backgroundAlpha: 0,
|
|
11
|
+
antialias: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const scene = new Container();
|
|
15
|
+
const background = new Graphics().roundRect(0, 0, 1040, 480, 28).fill(0x111d2b);
|
|
16
|
+
background.position.set((viewport.width - 1040) / 2, (viewport.height - 480) / 2);
|
|
17
|
+
scene.addChild(background);
|
|
18
|
+
|
|
19
|
+
const eyebrow = new Text({
|
|
20
|
+
text: 'VIBEVIDEO / MOTION STUDY 01',
|
|
21
|
+
style: { fontFamily: 'Arial', fontSize: 18, fontWeight: '600', fill: '#8bd8c4', letterSpacing: 3 },
|
|
22
|
+
});
|
|
23
|
+
eyebrow.position.set(background.x + 72, background.y + 74);
|
|
24
|
+
|
|
25
|
+
const title = new Text({
|
|
26
|
+
text: 'Ideas in motion.',
|
|
27
|
+
style: { fontFamily: 'Arial', fontSize: 88, fontWeight: '700', fill: '#f5f2e9', letterSpacing: -2 },
|
|
28
|
+
});
|
|
29
|
+
title.position.set(background.x + 68, background.y + 166);
|
|
30
|
+
title.alpha = 0;
|
|
31
|
+
|
|
32
|
+
const underline = new Graphics().roundRect(0, 0, 490, 7, 4).fill(0xf18b71);
|
|
33
|
+
underline.position.set(title.x + 4, title.y + 118);
|
|
34
|
+
underline.scale.x = 0;
|
|
35
|
+
|
|
36
|
+
const caption = new Text({
|
|
37
|
+
text: 'A small scene, rebuilt at every requested frame.',
|
|
38
|
+
style: { fontFamily: 'Arial', fontSize: 24, fill: '#b6c0cb' },
|
|
39
|
+
});
|
|
40
|
+
caption.position.set(title.x + 4, title.y + 158);
|
|
41
|
+
caption.alpha = 0;
|
|
42
|
+
|
|
43
|
+
scene.addChild(eyebrow, title, underline, caption);
|
|
44
|
+
app.stage.addChild(scene);
|
|
45
|
+
|
|
46
|
+
modules.VIBEVIDEO.registerPixiObject(title, {
|
|
47
|
+
address: 'title',
|
|
48
|
+
name: '主标题',
|
|
49
|
+
editable: ['position', 'rotation', 'scale', 'opacity', 'visibility', 'text'],
|
|
50
|
+
});
|
|
51
|
+
modules.VIBEVIDEO.registerPixiObject(underline, {
|
|
52
|
+
address: 'underline',
|
|
53
|
+
name: '强调线',
|
|
54
|
+
editable: ['position', 'scale', 'opacity', 'visibility'],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const sceneAdapter = modules.VIBEVIDEO.createPixiSceneAdapter(app, {
|
|
58
|
+
elementRoot: root,
|
|
59
|
+
ownsApplication: true,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
sceneAdapter,
|
|
64
|
+
render({ timeSeconds }) {
|
|
65
|
+
const enter = Math.max(0, Math.min(1, timeSeconds / 0.8));
|
|
66
|
+
const smooth = enter * enter * (3 - 2 * enter);
|
|
67
|
+
title.alpha = smooth;
|
|
68
|
+
title.position.x = background.x + 68 + (1 - smooth) * -36;
|
|
69
|
+
title.rotation = Math.sin(timeSeconds * 0.8) * 0.008;
|
|
70
|
+
underline.scale.x = smooth;
|
|
71
|
+
caption.alpha = Math.max(0, Math.min(1, (timeSeconds - 0.28) / 0.45));
|
|
72
|
+
caption.position.y = title.y + 158 + (1 - caption.alpha) * 10;
|
|
73
|
+
},
|
|
74
|
+
dispose() {},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// @vibevideo:content-bounds 92,82,1000,410
|
|
2
|
+
export default async function mount({ root, viewport, modules }) {
|
|
3
|
+
const { Application, Container, Graphics, Text } = modules.PIXI;
|
|
4
|
+
const app = new Application();
|
|
5
|
+
await app.init({
|
|
6
|
+
width: viewport.width,
|
|
7
|
+
height: viewport.height,
|
|
8
|
+
autoStart: false,
|
|
9
|
+
sharedTicker: false,
|
|
10
|
+
backgroundAlpha: 0,
|
|
11
|
+
antialias: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const scene = new Container();
|
|
15
|
+
const ink = 0x101a27;
|
|
16
|
+
const paper = 0xf4f1e9;
|
|
17
|
+
const mint = 0x82d3bc;
|
|
18
|
+
const coral = 0xf18b71;
|
|
19
|
+
const title = new Text({ text: 'FROM CODE TO FRAME', style: { fontFamily: 'Arial', fontSize: 22, fontWeight: '700', fill: paper, letterSpacing: 4 } });
|
|
20
|
+
title.position.set(92, 82);
|
|
21
|
+
scene.addChild(title);
|
|
22
|
+
|
|
23
|
+
const line = new Graphics().moveTo(190, 338).lineTo(viewport.width - 190, 338).stroke({ color: 0x526173, width: 3 });
|
|
24
|
+
scene.addChild(line);
|
|
25
|
+
|
|
26
|
+
const labels = ['AUTHOR', 'COMPOSE', 'RENDER'];
|
|
27
|
+
const captions = ['Scene graph', 'Timeline time', 'Final frame'];
|
|
28
|
+
const colors = [mint, 0x9c9ae8, coral];
|
|
29
|
+
const centers = [viewport.width * 0.25, viewport.width * 0.5, viewport.width * 0.75];
|
|
30
|
+
const nodes = centers.map((centerX, index) => {
|
|
31
|
+
const node = new Container();
|
|
32
|
+
node.position.set(centerX, 338);
|
|
33
|
+
const halo = new Graphics().circle(0, 0, 62).fill({ color: colors[index], alpha: 0.12 });
|
|
34
|
+
const disc = new Graphics().circle(0, 0, 34).fill(colors[index]);
|
|
35
|
+
const number = new Text({ text: `0${index + 1}`, style: { fontFamily: 'Arial', fontSize: 19, fontWeight: '700', fill: ink } });
|
|
36
|
+
number.anchor.set(0.5);
|
|
37
|
+
node.addChild(halo, disc, number);
|
|
38
|
+
|
|
39
|
+
const label = new Text({ text: labels[index], style: { fontFamily: 'Arial', fontSize: 20, fontWeight: '700', fill: paper, letterSpacing: 2 } });
|
|
40
|
+
label.anchor.set(0.5, 0);
|
|
41
|
+
label.position.set(0, 90);
|
|
42
|
+
const caption = new Text({ text: captions[index], style: { fontFamily: 'Arial', fontSize: 17, fill: 0xaeb9c6 } });
|
|
43
|
+
caption.anchor.set(0.5, 0);
|
|
44
|
+
caption.position.set(0, 124);
|
|
45
|
+
node.addChild(label, caption);
|
|
46
|
+
scene.addChild(node);
|
|
47
|
+
modules.VIBEVIDEO.registerPixiObject(node, {
|
|
48
|
+
address: `stage-${index + 1}`,
|
|
49
|
+
name: labels[index],
|
|
50
|
+
editable: ['position', 'rotation', 'scale', 'opacity', 'visibility'],
|
|
51
|
+
});
|
|
52
|
+
return node;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const marker = new Graphics().circle(0, 0, 9).fill(paper);
|
|
56
|
+
scene.addChild(marker);
|
|
57
|
+
modules.VIBEVIDEO.registerPixiObject(marker, {
|
|
58
|
+
address: 'progress-marker',
|
|
59
|
+
name: '进度标记',
|
|
60
|
+
editable: ['position', 'scale', 'opacity', 'visibility'],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
app.stage.addChild(scene);
|
|
64
|
+
const sceneAdapter = modules.VIBEVIDEO.createPixiSceneAdapter(app, { elementRoot: root, ownsApplication: true });
|
|
65
|
+
return {
|
|
66
|
+
sceneAdapter,
|
|
67
|
+
render({ timeSeconds }) {
|
|
68
|
+
for (let index = 0; index < nodes.length; index += 1) {
|
|
69
|
+
nodes[index].scale.set(1 + Math.sin(timeSeconds * 2 + index * 0.8) * 0.045);
|
|
70
|
+
}
|
|
71
|
+
const progress = Math.max(0, Math.min(1, timeSeconds / 4));
|
|
72
|
+
marker.position.set(190 + (viewport.width - 380) * progress, 338);
|
|
73
|
+
},
|
|
74
|
+
dispose() {},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// @vibevideo:content-bounds 180,130,930,470
|
|
2
|
+
export default async function mount({ root, viewport, modules }) {
|
|
3
|
+
const { Application, Container, Graphics, Text } = modules.PIXI;
|
|
4
|
+
const app = new Application();
|
|
5
|
+
await app.init({
|
|
6
|
+
width: viewport.width,
|
|
7
|
+
height: viewport.height,
|
|
8
|
+
autoStart: false,
|
|
9
|
+
sharedTicker: false,
|
|
10
|
+
backgroundAlpha: 0,
|
|
11
|
+
antialias: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const scene = new Container();
|
|
15
|
+
const panel = new Container();
|
|
16
|
+
panel.position.set((viewport.width - 900) / 2, (viewport.height - 430) / 2);
|
|
17
|
+
const card = new Graphics().roundRect(0, 0, 900, 430, 30).fill(0x121f2e);
|
|
18
|
+
panel.addChild(card);
|
|
19
|
+
|
|
20
|
+
const kicker = new Text({ text: 'OBJECTS KEEP THEIR OWN IDENTITY', style: { fontFamily: 'Arial', fontSize: 18, fontWeight: '700', fill: '#82d3bc', letterSpacing: 3 } });
|
|
21
|
+
kicker.position.set(58, 54);
|
|
22
|
+
const heading = new Text({ text: 'One parent. Three editable parts.', style: { fontFamily: 'Arial', fontSize: 42, fontWeight: '700', fill: '#f4f1e9' } });
|
|
23
|
+
heading.position.set(56, 102);
|
|
24
|
+
panel.addChild(kicker, heading);
|
|
25
|
+
|
|
26
|
+
const bars = [
|
|
27
|
+
{ name: 'Structure', value: 0.78, color: 0x82d3bc },
|
|
28
|
+
{ name: 'Timing', value: 0.56, color: 0x9c9ae8 },
|
|
29
|
+
{ name: 'Output', value: 0.91, color: 0xf18b71 },
|
|
30
|
+
];
|
|
31
|
+
const barObjects = bars.map((item, index) => {
|
|
32
|
+
const y = 226 + index * 58;
|
|
33
|
+
const label = new Text({ text: item.name, style: { fontFamily: 'Arial', fontSize: 18, fill: '#c6ced7' } });
|
|
34
|
+
label.position.set(60, y - 4);
|
|
35
|
+
const track = new Graphics().roundRect(212, y, 510, 14, 7).fill(0x2b3949);
|
|
36
|
+
const fill = new Graphics().roundRect(212, y, 510 * item.value, 14, 7).fill(item.color);
|
|
37
|
+
const value = new Text({ text: `${Math.round(item.value * 100)}%`, style: { fontFamily: 'Arial', fontSize: 17, fontWeight: '700', fill: '#f4f1e9' } });
|
|
38
|
+
value.position.set(756, y - 6);
|
|
39
|
+
const row = new Container();
|
|
40
|
+
row.addChild(label, track, fill, value);
|
|
41
|
+
panel.addChild(row);
|
|
42
|
+
modules.VIBEVIDEO.registerPixiObject(row, {
|
|
43
|
+
address: `metric-${item.name.toLowerCase()}`,
|
|
44
|
+
name: item.name,
|
|
45
|
+
editable: ['position', 'scale', 'opacity', 'visibility'],
|
|
46
|
+
});
|
|
47
|
+
return row;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
scene.addChild(panel);
|
|
51
|
+
app.stage.addChild(scene);
|
|
52
|
+
modules.VIBEVIDEO.registerPixiObject(panel, {
|
|
53
|
+
address: 'board',
|
|
54
|
+
name: '整张卡片',
|
|
55
|
+
editable: ['position', 'rotation', 'scale', 'opacity', 'visibility'],
|
|
56
|
+
});
|
|
57
|
+
const sceneAdapter = modules.VIBEVIDEO.createPixiSceneAdapter(app, { elementRoot: root, ownsApplication: true });
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
sceneAdapter,
|
|
61
|
+
render({ timeSeconds }) {
|
|
62
|
+
panel.rotation = Math.sin(timeSeconds * 0.5) * 0.012;
|
|
63
|
+
for (let index = 0; index < barObjects.length; index += 1) {
|
|
64
|
+
barObjects[index].alpha = 0.84 + Math.sin(timeSeconds * 1.6 + index) * 0.12;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
dispose() {},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// @vibevideo:content-bounds 72,82,336,176
|
|
2
|
+
export default async function mount({ root, viewport, modules }) {
|
|
3
|
+
const { Application, Container, Graphics, Text } = modules.PIXI;
|
|
4
|
+
const app = new Application();
|
|
5
|
+
await app.init({
|
|
6
|
+
width: viewport.width,
|
|
7
|
+
height: viewport.height,
|
|
8
|
+
autoStart: false,
|
|
9
|
+
sharedTicker: false,
|
|
10
|
+
backgroundAlpha: 0,
|
|
11
|
+
antialias: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const scene = new Container();
|
|
15
|
+
const frame = new Graphics().roundRect(72, 82, 336, 176, 24).fill(0x172433).roundRect(72, 82, 336, 176, 24).stroke({ color: 0x7893a5, alpha: 0.45, width: 1 });
|
|
16
|
+
const accent = new Graphics().roundRect(94, 104, 4, 132, 2).fill(0x85d8bf);
|
|
17
|
+
const label = new Text({ text: 'RENDER READY', style: { fontFamily: 'Arial', fontSize: 15, fontWeight: '700', fill: '#85d8bf', letterSpacing: 2 } });
|
|
18
|
+
label.position.set(116, 108);
|
|
19
|
+
const title = new Text({ text: 'Frame 024', style: { fontFamily: 'Arial', fontSize: 34, fontWeight: '700', fill: '#f2f0e9' } });
|
|
20
|
+
title.position.set(114, 142);
|
|
21
|
+
const dot = new Graphics().circle(384, 118, 7).fill(0x85d8bf);
|
|
22
|
+
scene.addChild(frame, accent, label, title, dot);
|
|
23
|
+
app.stage.addChild(scene);
|
|
24
|
+
|
|
25
|
+
modules.VIBEVIDEO.registerPixiObject(scene, {
|
|
26
|
+
address: 'callout',
|
|
27
|
+
name: '渲染提示',
|
|
28
|
+
editable: ['position', 'rotation', 'scale', 'opacity', 'visibility'],
|
|
29
|
+
});
|
|
30
|
+
const sceneAdapter = modules.VIBEVIDEO.createPixiSceneAdapter(app, { elementRoot: root, ownsApplication: true });
|
|
31
|
+
return {
|
|
32
|
+
sceneAdapter,
|
|
33
|
+
render({ timeSeconds }) {
|
|
34
|
+
const pulse = 0.5 + 0.5 * Math.sin(timeSeconds * Math.PI * 2);
|
|
35
|
+
dot.alpha = 0.5 + pulse * 0.5;
|
|
36
|
+
dot.scale.set(0.8 + pulse * 0.2);
|
|
37
|
+
},
|
|
38
|
+
dispose() {},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Editable Pixi starter sources
|
|
2
|
+
|
|
3
|
+
Copy a starter into your project and import it using the CLI agent command.
|
|
4
|
+
|
|
5
|
+
- `01-kinetic-title.mjs`: editable title and underline.
|
|
6
|
+
- `02-flow-map.mjs`: multiple hit targets and animated paths.
|
|
7
|
+
- `03-nested-board.mjs`: parent/child selection and independent row edits.
|
|
8
|
+
- `04-compact-callout.mjs`: a compact declared content area.
|
|
9
|
+
|
|
10
|
+
Each source uses the host-provided PixiJS module and deterministic seeking.
|
|
11
|
+
Check forward and reverse seeks, selection and overrides in Studio.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# 构图与动画制作
|
|
2
|
+
|
|
3
|
+
## 从内容确定画面
|
|
4
|
+
|
|
5
|
+
先明确每段图形在视频中的作用:给出结论、解释关系、展示变化、标记章节、突出产品细节或引导下一步。让最重要的信息在停留帧中容易读到,再决定如何出现。
|
|
6
|
+
|
|
7
|
+
沿用已有文案、品牌和已确认的参考。内容不完整时,区分可以自行选择的排版细节和必须由用户确认的事实。不要从参考图中照搬示例人物、数值、logo、引用和署名。
|
|
8
|
+
|
|
9
|
+
在源文件旁或交付说明中记录紧凑的制作约定:
|
|
10
|
+
|
|
11
|
+
| 项目 | 应明确的内容 |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| 用途 | 图形要传递的信息以及在镜头中的位置 |
|
|
14
|
+
| 内容 | 准确文案、数字、单位、必须出现的真实素材 |
|
|
15
|
+
| 构图 | 透明叠加或完整画面、主要视觉焦点、比例与内容范围 |
|
|
16
|
+
| 语言 | 实际文字及字体覆盖,长文案时的换行与缩排策略 |
|
|
17
|
+
| 时序 | 入场、可读停留、强调和退场的本地秒数 |
|
|
18
|
+
| 修改 | 需要保留的地址、源码参数、现有 UI 中可调整的项目 |
|
|
19
|
+
|
|
20
|
+
这份约定用于避免源码默认值、时间轴尺寸和交付说明互相冲突,不需要为简单改色重复写一份设计方案。
|
|
21
|
+
|
|
22
|
+
## 使用参考与统一视觉
|
|
23
|
+
|
|
24
|
+
检查用户给的图像或视频,说明借鉴的是信息层级、网格、留白、材质、形体、镜头或运动顺序。读取已有源码时,也检查参数默认值和真实输出;不能只从文件名推断设计。
|
|
25
|
+
|
|
26
|
+
对新作品,选择适合内容的视觉机制,例如用长度解释数量、用位置解释关系、用镜头解释空间。统一字体角色、字重、调色板、间距和运动节奏。不要把统一品牌理解为每段都使用同一张卡片。
|
|
27
|
+
|
|
28
|
+
用户指定的形状、画风或转场约束应落实到代码。简约、手绘、编辑感、科技感等词需要转成可观察的线条、材质、层级与节奏;装饰数量不代替这些决定。
|
|
29
|
+
|
|
30
|
+
借用外部示例代码前核对当前运行时:自动 ticker、CDN、Three.js addons、DOM/CSS、相对素材和不同生命周期都可能需要转换。视觉创作任务不要求搜索某个私有样式库,也不引入新的登录步骤。
|
|
31
|
+
|
|
32
|
+
## 先完成停留帧
|
|
33
|
+
|
|
34
|
+
先确定动画真正占用的区域,不要默认把每段小动效铺满整张视频画布。Studio 会在导入时以 120 fps 检查整段动画的透明像素(覆盖当前支持的最高导出帧率),自动合并实际范围并按原始像素大小居中放到项目画布。需要保留透明留白或额外设计余量时,再声明完整动画内容范围;自动结果会缓存到本地工程,源码变更后重新分析。
|
|
35
|
+
|
|
36
|
+
HTML 可用 `<meta name="vibevideo:viewport" content="1280x720">` 声明源画面;通常不必声明 `content-bounds`。若需要手动覆盖自动分析范围,使用 `<meta name="vibevideo:content-bounds" content="x,y,width,height">`。单文件 `.mjs` 在文件顶部写 `// @vibevideo:content-bounds x,y,width,height`。坐标相对于 `viewport`,并覆盖整段动画的移动、旋转、描边、阴影和发光留白。全画面背景会自然得到完整源画面范围。
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<meta name="vibevideo:viewport" content="1280x720">
|
|
40
|
+
<meta name="vibevideo:content-bounds" content="320,220,640,280">
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
单文件 `.mjs` 的声明放在源码注释中。图形仍按完整 `viewport` 绘制;bounds 只定义导入后在时间轴中的有效素材区域。
|
|
44
|
+
|
|
45
|
+
先在最易读的一帧安排标题、主体、标签、数据和背景,再加运动:
|
|
46
|
+
|
|
47
|
+
- 设定明确的主次关系,给真实文字留空间;不要依赖编辑器把整个图形放大来补救内部排版。
|
|
48
|
+
- 按最终观看大小检查。640 × 360 源画面放大到合成画布后,细线、文字纹理和微小间距可能变软。
|
|
49
|
+
- 长标题或多语言内容使用实际 `measureText` 结果换行、调整字号或重新安排层级。不要把大量内容硬塞到一个固定行高里。
|
|
50
|
+
- 连接的形体共用坐标系、父 Group 或锚点。给连线端点和标签位置一个共同计算来源,避免对象动了、箭头仍停在旧位置。
|
|
51
|
+
- 区分制作参考和输出素材。需要出现的真实图片保持真实;参考效果截图不应整体充当成片背景。
|
|
52
|
+
|
|
53
|
+
普通字幕和独立标题优先留为时间轴文字。Canvas 内文字不能像文字片段一样独立编辑;做成 Three.js 纹理面片后,用户可以移动面片,不能直接选择其中的每个字。
|
|
54
|
+
|
|
55
|
+
连线如果要跟随用户拖动,在 draw 中读取应用 overrides 后的对象位置来更新连线几何,再绘制场景;这一步不应重新设置编辑对象的位置。只在 render 中计算端点,会漏掉宿主随后应用的用户修改。
|
|
56
|
+
|
|
57
|
+
## 本地时间与运动
|
|
58
|
+
|
|
59
|
+
把绝对项目时间换成片段内秒数。例如图形从项目 8 秒开始,语句在项目 9.2 秒强调,则内部强调时刻为 1.2 秒。不要读取 mount 时的 timeline 值作为持续播放进度。
|
|
60
|
+
|
|
61
|
+
先安排可读的停留段,再分配入场和退场。短暂开场不应占满本来就很短的 4 秒片段。图形实际可见到 `duration - 1 / fps`,不要把重要内容只放在 progress 恰好等于 1 的瞬间。
|
|
62
|
+
|
|
63
|
+
每种运动都能从时间重建:
|
|
64
|
+
|
|
65
|
+
- 位移、旋转、比例:解析函数、插值或暂停 timeline 的 seek。
|
|
66
|
+
- 多元素错开:`localTime = timeSeconds - index * staggerSeconds`,对每个元素独立截断。
|
|
67
|
+
- 周期:按固定周期对本地秒数取模;考虑周期首尾是否需要连续。
|
|
68
|
+
- 随机:固定种子,使用对象身份或索引生成稳定参数;不要每次 render 重新采样随机数。
|
|
69
|
+
- 粒子或模拟:预计算或从确定的初始状态求出任意时刻,不能依赖“播放过的上一帧”。
|
|
70
|
+
|
|
71
|
+
宿主每帧恢复 Three.js 变换基线。若 GSAP 直接操作 Mesh,并在重复 seek 同一时刻时跳过赋值,基线恢复后就可能出现错误姿态。使用独立 motion 状态,并在每次 render 中显式设置 Mesh 变换;参见 [GSAP 示例](examples.md#gsap-外部时钟与可编辑场景)。
|
|
72
|
+
|
|
73
|
+
PixiJS 同样由宿主按指定时刻驱动。初始化应用时关闭自动 ticker,动画属性每次从 `timeSeconds` 计算,不使用 `ticker.add()` 累加运动。需要在编辑器里单独选择的显示对象,通过稳定地址和能力列表注册:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
export default async function mount({ root, viewport, modules }) {
|
|
77
|
+
const { Application, Text } = modules.PIXI;
|
|
78
|
+
const app = new Application();
|
|
79
|
+
await app.init({
|
|
80
|
+
width: viewport.width,
|
|
81
|
+
height: viewport.height,
|
|
82
|
+
autoStart: false,
|
|
83
|
+
sharedTicker: false,
|
|
84
|
+
backgroundAlpha: 0,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const title = new Text({
|
|
88
|
+
text: 'Code to video',
|
|
89
|
+
style: { fontFamily: 'sans-serif', fontSize: 48, fill: '#ffffff' },
|
|
90
|
+
});
|
|
91
|
+
title.anchor.set(0.5);
|
|
92
|
+
title.position.set(viewport.width / 2, viewport.height / 2);
|
|
93
|
+
app.stage.addChild(title);
|
|
94
|
+
modules.VIBEVIDEO.registerPixiObject(title, {
|
|
95
|
+
address: 'title',
|
|
96
|
+
name: '标题',
|
|
97
|
+
editable: ['position', 'rotation', 'scale', 'opacity', 'text'],
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const sceneAdapter = modules.VIBEVIDEO.createPixiSceneAdapter(app, {
|
|
101
|
+
elementRoot: root,
|
|
102
|
+
ownsApplication: true,
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
sceneAdapter,
|
|
106
|
+
render({ timeSeconds }) {
|
|
107
|
+
title.rotation = Math.sin(timeSeconds * 0.7) * 0.08;
|
|
108
|
+
},
|
|
109
|
+
dispose() {},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`editable` 只列当前对象真实支持的属性。文本对象可以声明 `text`;普通容器不应声明文本。`ownsApplication: true` 表示当前图形独占应用;若应用或 texture 与其他实例共享,不要让适配器销毁共享资源。
|
|
115
|
+
宿主会先释放 `sceneAdapter`,再调用图形的 `dispose()`;作者的清理函数只处理适配器之外的资源。
|
|
116
|
+
|
|
117
|
+
## 透明叠加与时间轴分层
|
|
118
|
+
|
|
119
|
+
透明图形的边界是完整运动范围,不只包含停留位置。为入场位移、极端旋转、放大、描边和发光留空间,逐帧检查是否被源 canvas 裁掉。外部片段变大不能找回源画布里已经裁掉的部分。
|
|
120
|
+
|
|
121
|
+
按用户的画面选择透明或实底,保持参考中有意义的形状和背景。不要无条件添加底板、模糊卡片或阴影来解决可读性;需要底板时让它承担明确的对比或结构作用。
|
|
122
|
+
|
|
123
|
+
普通素材默认独立合成:
|
|
124
|
+
|
|
125
|
+
| 内容 | 放置方式 |
|
|
126
|
+
| --- | --- |
|
|
127
|
+
| 原始视频、普通照片 | 独立导入视频或图片片段 |
|
|
128
|
+
| 章节标题、独立文字 | 时间轴文字实体,或确有内部运动需求的图形 |
|
|
129
|
+
| 3D 模型的固定 logo、图像填充、画面内纹理 | 在图形源码中嵌入真实图片 |
|
|
130
|
+
| 跟随对象的标签或形体 | 同一场景内的 Mesh、Group 或 CanvasTexture |
|
|
131
|
+
|
|
132
|
+
当前导入会把片段追加到合成顺序的上方;不能把工具并未提供的轨道重排、复杂遮罩、人物抠像或音频节拍分析写进操作步骤。需要遮挡关系但现有 UI 无法表达时,说明具体缺少的层级能力。
|
|
133
|
+
|
|
134
|
+
## 真实三维文字与 SVG 标识
|
|
135
|
+
|
|
136
|
+
用户要求三维文字时,使用字形矢量轮廓加 ExtrudeGeometry,保留真实字厚、倒角、孔洞与侧面法线;每字或每个需编辑的部件保留独立 Mesh。CanvasTexture 平面和多张平面叠厚不能替代该交付。字体可先在作者环境转换成轮廓数据,再嵌入自包含模块。
|
|
137
|
+
|
|
138
|
+
SVG 标识要覆盖源文件实际使用的路径指令。先检查 M/L/H/V/C/Q/A/Z 等,遇到不支持的指令明确失败;不要删掉指令后继续按数字解析。逐部件检查几何坐标有限、轮廓和孔洞正确,并与原 SVG 对照。
|
|
139
|
+
|
|
140
|
+
扫光使用实际灯光、反射环境和可照明的材质。镜头使用透视相机的位移与方向变化。检查近景侧面、拉远后的完整轮廓和扫光经过前后的帧;灯光参数存在不代表这些效果已出现在画面里。
|
|
141
|
+
|
|
142
|
+
## 字体与图片
|
|
143
|
+
|
|
144
|
+
当前没有字体目录服务。系统字体可用性随机器不同,自定义字体需要允许使用的实际文件和显式嵌入。含中文的文案要检查中文字符,拉丁字母样张不能证明 CJK 字形与字重正确。
|
|
145
|
+
|
|
146
|
+
Canvas 文字在字体加载完成后再测量;字体替换后重新布局。图片根据真实宽高比计算 contain 或 cover,避免将 logo 拉伸。彩色纹理、普通背景和数据纹理按各自的颜色语义处理。
|
|
147
|
+
|
|
148
|
+
固定图片应在外部编码为 data URL 再导入;不要把 `/Users/...`、相对路径或远端 URL 填进 TextureLoader 并期待沙箱自动读取。保留原素材的来源和可编辑源文件,避免以后只能改一段无法追溯的 base64。
|
|
149
|
+
|
|
150
|
+
## 控制复杂度
|
|
151
|
+
|
|
152
|
+
资源加载和大部分静态布局在 mount/update 中完成。render/draw 复用几何、材质、临时向量和 canvas,避免逐帧创建 renderer 或反复解码图片。
|
|
153
|
+
|
|
154
|
+
按实际画面选择几何细分、纹理尺寸和光照复杂度。参考导出是实时捕获,过重场景会明确停止;先简化不可见细节和多余分辨率,再核对同一时刻的预览与导出。
|
|
155
|
+
|
|
156
|
+
## 一组相关图形
|
|
157
|
+
|
|
158
|
+
先确认一个代表性作品的停留帧和实际运动,再扩展相同形式。共用颜色不代表可以共用所有排版;信息结构和用途不同的片段应有适合的构图。
|
|
159
|
+
|
|
160
|
+
复用时保持参数名称、地址和语义稳定,替换真实内容与素材,检查长文案及最大运动范围。不要仅换颜色或边框,就把同一个布局称为新的视觉机制。
|