@anime-studio/remotion 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +51 -2
- package/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +215 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dener Fernandes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @anime-studio/remotion
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@anime-studio/remotion)
|
|
4
|
+
[](https://github.com/denerFernandes/animeStudio/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/denerFernandes/animeStudio/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Part of [animeStudio](https://github.com/denerFernandes/animeStudio), a deterministic 2D/2.5D cartoon animation engine: characters are
|
|
8
|
+
SVG art bound to skeletons, scenes are JSON documents, and every frame is a pure function of the
|
|
9
|
+
documents and the time.
|
|
10
|
+
|
|
11
|
+
Renders animeStudio scenes and sequences as videos with [Remotion](https://www.remotion.dev): `ToonComposition`, `toonMetadata`, `ToonSequenceComposition`.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @anime-studio/core @anime-studio/remotion remotion @remotion/media react
|
|
17
|
+
# or
|
|
18
|
+
pnpm add @anime-studio/core @anime-studio/remotion remotion @remotion/media react
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Requires Node.js 22 or later (or a modern browser / bundler). The packages are ES modules with
|
|
22
|
+
TypeScript types included.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { Composition } from "remotion";
|
|
28
|
+
import { ToonComposition, toonMetadata } from "@anime-studio/remotion";
|
|
29
|
+
import scene from "./my.scene.json";
|
|
30
|
+
import pip from "./pip.toon.json";
|
|
31
|
+
|
|
32
|
+
export const Root = () => (
|
|
33
|
+
<Composition
|
|
34
|
+
id="MyScene"
|
|
35
|
+
component={ToonComposition}
|
|
36
|
+
{...toonMetadata(scene)}
|
|
37
|
+
defaultProps={{ scene, assets: { characters: { pip }, lipsync: {} } }}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
- [Getting started and features](https://github.com/denerFernandes/animeStudio#readme)
|
|
45
|
+
- [Format specification](https://github.com/denerFernandes/animeStudio/blob/master/docs/FORMAT.md)
|
|
46
|
+
- [API reference](https://github.com/denerFernandes/animeStudio/blob/master/docs/API.md)
|
|
47
|
+
- [Authoring guide for AI agents](https://github.com/denerFernandes/animeStudio/blob/master/docs/AI_GUIDE.md)
|
|
48
|
+
- [Changelog](https://github.com/denerFernandes/animeStudio/blob/master/CHANGELOG.md)
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT © Dener Fernandes
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type SceneAssets, type SceneDoc, type SequenceDoc } from "@anime-studio/core";
|
|
2
|
+
export type ToonCompositionProps = {
|
|
3
|
+
scene: SceneDoc;
|
|
4
|
+
assets: SceneAssets;
|
|
5
|
+
/** Maps an audio path from the scene's `audio` map to a URL (default: `staticFile`). */
|
|
6
|
+
resolveAudio?: (src: string) => string;
|
|
7
|
+
/** Mute all scene audio. */
|
|
8
|
+
muted?: boolean;
|
|
9
|
+
/** Debug render: per-node sentinels + frame barcode, readable by `toon doctor`. */
|
|
10
|
+
debug?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* How long each frame waits for Chrome to finish painting before capture: animation frames and
|
|
13
|
+
* then milliseconds (default 4 and 60; heavy SVG — long extruded text, morphology filters —
|
|
14
|
+
* rendered with high concurrency may need more).
|
|
15
|
+
*/
|
|
16
|
+
paintSettle?: {
|
|
17
|
+
frames?: number;
|
|
18
|
+
ms?: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* While rendering, draw each frame into a canvas from its whole SVG document and capture only once
|
|
22
|
+
* the canvas holds the complete picture. Heavy frames rendered by several tabs at once (many solid
|
|
23
|
+
* parts, long markup) can otherwise be captured before Chrome has rasterized every layer — half
|
|
24
|
+
* painted frames. Slower per frame; SVG drawn as an image uses installed fonts only and embedded
|
|
25
|
+
* (data URI) pictures only. The Studio and the Player keep the live SVG.
|
|
26
|
+
*/
|
|
27
|
+
raster?: boolean;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Renders a toon scene inside a Remotion composition.
|
|
31
|
+
* Every frame is evaluated from scratch (`pose = f(scene, time)`), so parallel and
|
|
32
|
+
* out-of-order rendering is safe. Rigid bodies are baked once per tab before rendering.
|
|
33
|
+
*/
|
|
34
|
+
export declare function ToonComposition({ scene, assets, resolveAudio, muted, debug, paintSettle, raster }: ToonCompositionProps): import("react").JSX.Element | null;
|
|
35
|
+
/** Composition metadata derived from a scene (use in `calculateMetadata` or as props). */
|
|
36
|
+
export declare function toonMetadata(scene: SceneDoc): {
|
|
37
|
+
durationInFrames: number;
|
|
38
|
+
fps: number;
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
};
|
|
42
|
+
export type ToonSequenceCompositionProps = {
|
|
43
|
+
sequence: SequenceDoc;
|
|
44
|
+
/** Scene documents and their assets by the ids used in `sequence.scenes`. */
|
|
45
|
+
scenes: Record<string, {
|
|
46
|
+
doc: SceneDoc;
|
|
47
|
+
assets: SceneAssets;
|
|
48
|
+
}>;
|
|
49
|
+
resolveAudio?: (src: string) => string;
|
|
50
|
+
muted?: boolean;
|
|
51
|
+
/** Debug render: per-node sentinels + frame barcode, readable by `toon doctor`. */
|
|
52
|
+
debug?: boolean;
|
|
53
|
+
/** How long each frame waits for the paint before capture (see `ToonCompositionProps`). */
|
|
54
|
+
paintSettle?: {
|
|
55
|
+
frames?: number;
|
|
56
|
+
ms?: number;
|
|
57
|
+
};
|
|
58
|
+
/** Draw each frame into a canvas before capture (see `ToonCompositionProps`). */
|
|
59
|
+
raster?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Renders a multi-shot sequence (cuts, crossfades, fades, irises, wipes, flashes) in Remotion.
|
|
63
|
+
* Audio of each shot is cut at the shot boundary.
|
|
64
|
+
*/
|
|
65
|
+
export declare function ToonSequenceComposition({ sequence, scenes, resolveAudio, muted, debug, paintSettle, raster }: ToonSequenceCompositionProps): import("react").JSX.Element | null;
|
|
66
|
+
/** Composition metadata for a sequence (scene documents give each shot's length). */
|
|
67
|
+
export declare function toonSequenceMetadata(sequence: SequenceDoc, scenes: Record<string, {
|
|
68
|
+
doc: SceneDoc;
|
|
69
|
+
}>): {
|
|
70
|
+
durationInFrames: number;
|
|
71
|
+
fps: number;
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAUjB,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,wFAAwF;IACxF,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAyB,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,oBAAoB,sCAyBpI;AAwHD,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ;IAExC,gBAAgB;IAChB,GAAG;IACH,KAAK;IACL,MAAM;EAET;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,WAAW,CAAC;IACtB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2FAA2F;IAC3F,WAAW,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,iFAAiF;IACjF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAyB,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,4BAA4B,sCAyBvJ;AA2BD,qFAAqF;AACrF,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,QAAQ,CAAA;CAAE,CAAC;IAGjG,gBAAgB;IAChB,GAAG;IACH,KAAK;IACL,MAAM;EAET"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { compileScene, compileSequence, evaluateScene, evaluateSequence, frameToSVG, sequenceAudio, sequenceDuration, withDebugOverlay, } from "@anime-studio/core";
|
|
3
|
+
import { ToonFrame } from "@anime-studio/react";
|
|
4
|
+
import { bakeRigidBodies, sceneHasBodies } from "@anime-studio/rigid";
|
|
5
|
+
import { Audio } from "@remotion/media";
|
|
6
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { AbsoluteFill, Sequence, cancelRender, continueRender, delayRender, getRemotionEnvironment, staticFile, useCurrentFrame, useVideoConfig, } from "remotion";
|
|
8
|
+
/**
|
|
9
|
+
* Renders a toon scene inside a Remotion composition.
|
|
10
|
+
* Every frame is evaluated from scratch (`pose = f(scene, time)`), so parallel and
|
|
11
|
+
* out-of-order rendering is safe. Rigid bodies are baked once per tab before rendering.
|
|
12
|
+
*/
|
|
13
|
+
export function ToonComposition({ scene, assets, resolveAudio = staticFile, muted, debug, paintSettle, raster }) {
|
|
14
|
+
const frame = useCurrentFrame();
|
|
15
|
+
const { fps } = useVideoConfig();
|
|
16
|
+
const compiled = useMemo(() => compileScene(scene, assets), [scene, assets]);
|
|
17
|
+
const ready = usePreparedScene(compiled);
|
|
18
|
+
usePaintSettled(frame, paintSettle?.frames, paintSettle?.ms);
|
|
19
|
+
const rendered = useMemo(() => {
|
|
20
|
+
if (!ready)
|
|
21
|
+
return null;
|
|
22
|
+
const f = evaluateScene(ready, frame / fps);
|
|
23
|
+
return debug ? withDebugOverlay(f, { frameIndex: frame, time: frame / fps }) : f;
|
|
24
|
+
}, [ready, frame, fps, debug]);
|
|
25
|
+
if (!ready || !rendered)
|
|
26
|
+
return null;
|
|
27
|
+
return (_jsxs(AbsoluteFill, { children: [raster && getRemotionEnvironment().isRendering ? _jsx(RasterFrame, { frame: rendered }) : _jsx(ToonFrame, { frame: rendered, width: "100%", height: "100%" }, frameKey(frame)), muted
|
|
28
|
+
? null
|
|
29
|
+
: ready.audio.map((a, i) => (_jsx(Sequence, { from: Math.round(a.start * fps), layout: "none", children: _jsx(Audio, { src: resolveAudio(a.src), volume: a.volume }) }, `${a.id}-${i}`)))] }));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* While rendering, every frame mounts a fresh SVG tree. Updating the previous frame's DOM in place
|
|
33
|
+
* occasionally left a static element unpainted in Chrome's capture when blurred layers were
|
|
34
|
+
* composited next to it (`toon doctor` reported "library output stable → browser paint problem").
|
|
35
|
+
* In the Studio/Player the tree is reused for speed.
|
|
36
|
+
*/
|
|
37
|
+
const frameKey = (frame) => (getRemotionEnvironment().isRendering ? frame : "live");
|
|
38
|
+
/**
|
|
39
|
+
* Holds each frame's capture for a few animation frames after it renders. Filtered / masked SVG
|
|
40
|
+
* content is rasterized asynchronously by Chrome; capturing immediately sometimes missed those
|
|
41
|
+
* layers, making elements flicker in the video.
|
|
42
|
+
*/
|
|
43
|
+
function usePaintSettled(frame, frames = 4, ms = 60) {
|
|
44
|
+
useLayoutEffect(() => {
|
|
45
|
+
const handle = delayRender(`Paint settle (frame ${frame})`);
|
|
46
|
+
let raf = 0;
|
|
47
|
+
let timer;
|
|
48
|
+
let left = frames;
|
|
49
|
+
let gone = false;
|
|
50
|
+
// (Text waits for its fonts.)
|
|
51
|
+
const fonts = typeof document !== "undefined" && document.fonts ? document.fonts.ready : Promise.resolve();
|
|
52
|
+
const tick = () => {
|
|
53
|
+
if (--left <= 0)
|
|
54
|
+
timer = setTimeout(() => continueRender(handle), ms);
|
|
55
|
+
else
|
|
56
|
+
raf = requestAnimationFrame(tick);
|
|
57
|
+
};
|
|
58
|
+
fonts.then(() => {
|
|
59
|
+
if (!gone)
|
|
60
|
+
raf = requestAnimationFrame(tick);
|
|
61
|
+
});
|
|
62
|
+
return () => {
|
|
63
|
+
gone = true;
|
|
64
|
+
cancelAnimationFrame(raf);
|
|
65
|
+
if (timer)
|
|
66
|
+
clearTimeout(timer);
|
|
67
|
+
continueRender(handle);
|
|
68
|
+
};
|
|
69
|
+
}, [frame, frames, ms]);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A frame drawn into a canvas: its SVG document decoded as an image and drawn in one go on a
|
|
73
|
+
* software canvas (pixels in memory, no GPU tiles), the capture held until it is there. Whatever
|
|
74
|
+
* Chrome's compositor is doing in the other tabs, the captured canvas is the whole picture.
|
|
75
|
+
*/
|
|
76
|
+
function RasterFrame({ frame }) {
|
|
77
|
+
const ref = useRef(null);
|
|
78
|
+
const { width, height } = useVideoConfig();
|
|
79
|
+
const svg = useMemo(() => frameToSVG(frame), [frame]);
|
|
80
|
+
useLayoutEffect(() => {
|
|
81
|
+
const handle = delayRender("Rasterizing the frame");
|
|
82
|
+
let done = false;
|
|
83
|
+
const finish = () => {
|
|
84
|
+
if (done)
|
|
85
|
+
return;
|
|
86
|
+
done = true;
|
|
87
|
+
URL.revokeObjectURL(url);
|
|
88
|
+
continueRender(handle);
|
|
89
|
+
};
|
|
90
|
+
const url = URL.createObjectURL(new Blob([svg], { type: "image/svg+xml" }));
|
|
91
|
+
const img = new Image();
|
|
92
|
+
img.src = url;
|
|
93
|
+
img
|
|
94
|
+
.decode()
|
|
95
|
+
.then(() => {
|
|
96
|
+
const c = ref.current;
|
|
97
|
+
if (done || !c)
|
|
98
|
+
return;
|
|
99
|
+
const k = window.devicePixelRatio || 1;
|
|
100
|
+
const w = Math.round(width * k), h = Math.round(height * k);
|
|
101
|
+
// (Sized once: resizing a canvas every frame throws its backing store away, and a capture
|
|
102
|
+
// can catch the compositor with half its tiles still the old ones — a torn frame.)
|
|
103
|
+
if (c.width !== w)
|
|
104
|
+
c.width = w;
|
|
105
|
+
if (c.height !== h)
|
|
106
|
+
c.height = h;
|
|
107
|
+
const ctx = c.getContext("2d", { willReadFrequently: true });
|
|
108
|
+
if (!ctx)
|
|
109
|
+
throw new Error("no 2D canvas context");
|
|
110
|
+
ctx.clearRect(0, 0, w, h);
|
|
111
|
+
ctx.drawImage(img, 0, 0, w, h);
|
|
112
|
+
// Reading a pixel back forces the drawing to complete; two animation frames let the
|
|
113
|
+
// compositor commit the new picture before the capture.
|
|
114
|
+
ctx.getImageData(0, 0, 1, 1);
|
|
115
|
+
requestAnimationFrame(() => requestAnimationFrame(finish));
|
|
116
|
+
})
|
|
117
|
+
.catch((e) => {
|
|
118
|
+
if (!done)
|
|
119
|
+
cancelRender(new Error(`Could not rasterize the frame: ${e instanceof Error ? e.message : String(e)}`));
|
|
120
|
+
});
|
|
121
|
+
return finish;
|
|
122
|
+
}, [svg, width, height]);
|
|
123
|
+
return _jsx("canvas", { ref: ref, style: { position: "absolute", inset: 0, width: "100%", height: "100%", display: "block" } });
|
|
124
|
+
}
|
|
125
|
+
/** A failed bake fails the render (`cancelRender`) instead of leaving the frame blank. */
|
|
126
|
+
const bakeError = (e) => new Error(`Could not bake the rigid bodies: ${e instanceof Error ? e.message : String(e)}`);
|
|
127
|
+
/** Bakes rigid bodies asynchronously, holding the render until done; a failed bake cancels the render. */
|
|
128
|
+
function usePreparedScene(compiled) {
|
|
129
|
+
const needsBake = sceneHasBodies(compiled);
|
|
130
|
+
const [ready, setReady] = useState(needsBake ? null : compiled);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!needsBake) {
|
|
133
|
+
setReady(compiled);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const handle = delayRender("Baking rigid bodies");
|
|
137
|
+
let alive = true;
|
|
138
|
+
bakeRigidBodies(compiled).then((s) => {
|
|
139
|
+
if (alive)
|
|
140
|
+
setReady(s);
|
|
141
|
+
continueRender(handle);
|
|
142
|
+
}, (e) => cancelRender(bakeError(e)));
|
|
143
|
+
return () => {
|
|
144
|
+
alive = false;
|
|
145
|
+
};
|
|
146
|
+
}, [compiled, needsBake]);
|
|
147
|
+
return ready;
|
|
148
|
+
}
|
|
149
|
+
/** Frames in a duration: `duration × fps` rounded up, but not for floating-point noise (2.2 × 25 = 55.00…01 is 55 frames, not 56). */
|
|
150
|
+
const frameCount = (duration, fps) => Math.ceil(duration * fps - 1e-6);
|
|
151
|
+
/** Composition metadata derived from a scene (use in `calculateMetadata` or as props). */
|
|
152
|
+
export function toonMetadata(scene) {
|
|
153
|
+
return {
|
|
154
|
+
durationInFrames: frameCount(scene.duration, scene.fps),
|
|
155
|
+
fps: scene.fps,
|
|
156
|
+
width: scene.width,
|
|
157
|
+
height: scene.height,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Renders a multi-shot sequence (cuts, crossfades, fades, irises, wipes, flashes) in Remotion.
|
|
162
|
+
* Audio of each shot is cut at the shot boundary.
|
|
163
|
+
*/
|
|
164
|
+
export function ToonSequenceComposition({ sequence, scenes, resolveAudio = staticFile, muted, debug, paintSettle, raster }) {
|
|
165
|
+
const frame = useCurrentFrame();
|
|
166
|
+
const { fps } = useVideoConfig();
|
|
167
|
+
const compiled = useMemo(() => compileSequence(sequence, { scenes }), [sequence, scenes]);
|
|
168
|
+
const ready = usePreparedSequence(compiled);
|
|
169
|
+
const rendered = useMemo(() => {
|
|
170
|
+
if (!ready)
|
|
171
|
+
return null;
|
|
172
|
+
const f = evaluateSequence(ready, frame / fps);
|
|
173
|
+
return debug ? withDebugOverlay(f, { frameIndex: frame, time: frame / fps }) : f;
|
|
174
|
+
}, [ready, frame, fps, debug]);
|
|
175
|
+
const audio = useMemo(() => (ready ? sequenceAudio(ready) : []), [ready]);
|
|
176
|
+
usePaintSettled(frame, paintSettle?.frames, paintSettle?.ms);
|
|
177
|
+
if (!ready || !rendered)
|
|
178
|
+
return null;
|
|
179
|
+
return (_jsxs(AbsoluteFill, { children: [raster && getRemotionEnvironment().isRendering ? _jsx(RasterFrame, { frame: rendered }) : _jsx(ToonFrame, { frame: rendered, width: "100%", height: "100%" }, frameKey(frame)), muted
|
|
180
|
+
? null
|
|
181
|
+
: audio.map((a, i) => (_jsx(Sequence, { from: Math.round(a.start * fps), durationInFrames: Math.max(1, Math.round(a.maxDuration * fps)), layout: "none", children: _jsx(Audio, { src: resolveAudio(a.src), volume: a.volume, trimBefore: Math.round(a.trimStart * fps) }) }, `${a.id}-${i}`)))] }));
|
|
182
|
+
}
|
|
183
|
+
function usePreparedSequence(seq) {
|
|
184
|
+
const needsBake = seq.shots.some((s) => sceneHasBodies(s.scene));
|
|
185
|
+
const [ready, setReady] = useState(needsBake ? null : seq);
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
if (!needsBake) {
|
|
188
|
+
setReady(seq);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const handle = delayRender("Baking rigid bodies");
|
|
192
|
+
let alive = true;
|
|
193
|
+
const unique = [...new Set(seq.shots.map((s) => s.scene))];
|
|
194
|
+
Promise.all(unique.map((s) => bakeRigidBodies(s))).then(() => {
|
|
195
|
+
if (alive)
|
|
196
|
+
setReady({ ...seq });
|
|
197
|
+
continueRender(handle);
|
|
198
|
+
}, (e) => cancelRender(bakeError(e)));
|
|
199
|
+
return () => {
|
|
200
|
+
alive = false;
|
|
201
|
+
};
|
|
202
|
+
}, [seq, needsBake]);
|
|
203
|
+
return ready;
|
|
204
|
+
}
|
|
205
|
+
/** Composition metadata for a sequence (scene documents give each shot's length). */
|
|
206
|
+
export function toonSequenceMetadata(sequence, scenes) {
|
|
207
|
+
const duration = sequenceDuration(sequence, Object.fromEntries(Object.entries(scenes).map(([k, v]) => [k, v.doc])));
|
|
208
|
+
return {
|
|
209
|
+
durationInFrames: frameCount(duration, sequence.fps),
|
|
210
|
+
fps: sequence.fps,
|
|
211
|
+
width: sequence.width,
|
|
212
|
+
height: sequence.height,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAML,YAAY,EACZ,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,UAAU,EAEV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC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C,CAAC,CAAC,CAAC;IACpH,OAAO;QACL,gBAAgB,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC;QACpD,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anime-studio/remotion",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Remotion adapter for animeStudio: render animeStudio scenes and sequences as videos.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"animation",
|
|
7
|
+
"cartoon",
|
|
8
|
+
"2d-animation",
|
|
9
|
+
"svg",
|
|
10
|
+
"character-animation",
|
|
11
|
+
"animestudio",
|
|
12
|
+
"remotion",
|
|
13
|
+
"video"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Dener Fernandes (https://github.com/denerFernandes)",
|
|
17
|
+
"homepage": "https://github.com/denerFernandes/animeStudio/tree/master/packages/remotion#readme",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/denerFernandes/animeStudio.git",
|
|
21
|
+
"directory": "packages/remotion"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/denerFernandes/animeStudio/issues"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@anime-studio/core": "0.2.0",
|
|
48
|
+
"@anime-studio/react": "0.2.0",
|
|
49
|
+
"@anime-studio/rigid": "0.2.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"react": ">=18",
|
|
53
|
+
"remotion": ">=4",
|
|
54
|
+
"@remotion/media": ">=4"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"react": "19.3.0",
|
|
58
|
+
"@types/react": "^19.3.0",
|
|
59
|
+
"remotion": "4.0.534",
|
|
60
|
+
"@remotion/media": "4.0.534"
|
|
61
|
+
}
|
|
6
62
|
}
|