@pixerate/editor 0.229.0 → 0.231.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/dist/animation-editor/camera-tools.d.cts +10 -0
- package/dist/animation-editor/camera-tools.d.ts +10 -0
- package/dist/animation-editor/camera.d.cts +67 -0
- package/dist/animation-editor/camera.d.ts +67 -0
- package/dist/animation-editor/compile.d.cts +4 -0
- package/dist/animation-editor/compile.d.ts +4 -0
- package/dist/animation-editor/controller.d.cts +34 -2
- package/dist/animation-editor/controller.d.ts +34 -2
- package/dist/animation-editor/effect-tools.d.cts +2 -1
- package/dist/animation-editor/effect-tools.d.ts +2 -1
- package/dist/animation-editor/evaluate.d.cts +9 -0
- package/dist/animation-editor/evaluate.d.ts +9 -0
- package/dist/animation-editor/flair.d.cts +8 -0
- package/dist/animation-editor/flair.d.ts +8 -0
- package/dist/animation-editor/index.cjs +603 -217
- package/dist/animation-editor/index.d.cts +2 -0
- package/dist/animation-editor/index.d.ts +2 -0
- package/dist/animation-editor/index.js +454 -68
- package/dist/animation-editor/issues.d.cts +16 -0
- package/dist/animation-editor/issues.d.ts +16 -0
- package/dist/animation-editor/tools.d.cts +1 -1
- package/dist/animation-editor/tools.d.ts +1 -1
- package/dist/animation-editor/types.d.cts +21 -3
- package/dist/animation-editor/types.d.ts +21 -3
- package/dist/canvas/index.cjs +7 -7
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-IGPEBXUD.cjs → chunk-5T3H7CGG.cjs} +21 -11
- package/dist/{chunk-K5GXW5TR.cjs → chunk-C73U5UI3.cjs} +14 -14
- package/dist/{chunk-LPTFDCJO.js → chunk-CSM5T6SE.js} +14 -4
- package/dist/{chunk-EBDZWIOP.cjs → chunk-ERJA5CGT.cjs} +5 -1
- package/dist/{chunk-5MQOBTNP.cjs → chunk-OPSK22DL.cjs} +80 -9
- package/dist/{chunk-PB6JV62G.js → chunk-SBPGIZQN.js} +1 -1
- package/dist/{chunk-UGYUGZE2.js → chunk-TCZ2J7PR.js} +71 -0
- package/dist/{chunk-W4KFNAWC.js → chunk-TYCJGFCF.js} +5 -1
- package/dist/effects/helpers.d.cts +35 -1
- package/dist/effects/helpers.d.ts +35 -1
- package/dist/effects/index.cjs +60 -44
- package/dist/effects/index.js +18 -2
- package/dist/effects/types.d.cts +15 -0
- package/dist/effects/types.d.ts +15 -0
- package/dist/image-editor/index.cjs +13 -13
- package/dist/image-editor/index.js +1 -1
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.js +2 -2
- package/dist/vector/index.cjs +6 -6
- package/dist/vector/index.js +1 -1
- package/dist/video-editor/camera-tools.d.cts +10 -0
- package/dist/video-editor/camera-tools.d.ts +10 -0
- package/dist/video-editor/camera.d.cts +47 -0
- package/dist/video-editor/camera.d.ts +47 -0
- package/dist/video-editor/check.d.cts +1 -1
- package/dist/video-editor/check.d.ts +1 -1
- package/dist/video-editor/controller.d.cts +37 -2
- package/dist/video-editor/controller.d.ts +37 -2
- package/dist/video-editor/effect-tools.d.cts +2 -1
- package/dist/video-editor/effect-tools.d.ts +2 -1
- package/dist/video-editor/index.cjs +705 -390
- package/dist/video-editor/index.d.cts +2 -0
- package/dist/video-editor/index.d.ts +2 -0
- package/dist/video-editor/index.js +334 -19
- package/dist/video-editor/keyframes.d.cts +10 -3
- package/dist/video-editor/keyframes.d.ts +10 -3
- package/dist/video-editor/parse.d.cts +5 -3
- package/dist/video-editor/parse.d.ts +5 -3
- package/dist/video-editor/tools.d.cts +18 -0
- package/dist/video-editor/tools.d.ts +18 -0
- package/dist/video-editor/types.d.cts +37 -1
- package/dist/video-editor/types.d.ts +37 -1
- package/package.json +1 -1
- package/skills/pixerate-animation-editor/SKILL.md +28 -1
- package/skills/pixerate-animation-motion-graphics/SKILL.md +3 -0
- package/skills/pixerate-video-editor/SKILL.md +16 -1
- package/skills/pixerate-video-montage/SKILL.md +2 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent tools for provider camera moves in the animation editor (`MotionCamera.in` / `during`):
|
|
3
|
+
* list the moves by role, set one on a shot and clear it. They ride on the animation effects
|
|
4
|
+
* tool provider (`createAnimationEffectsToolProvider`), next to the other provider effects.
|
|
5
|
+
*/
|
|
6
|
+
import type { EffectToolContext } from '../effects/tools.cjs';
|
|
7
|
+
import type { AgentTool } from '../tools/registry.cjs';
|
|
8
|
+
import type { AnimationEditorController } from './controller.cjs';
|
|
9
|
+
/** The camera move tools (see the module comment). */
|
|
10
|
+
export declare function animationCameraMoveTools(controller: AnimationEditorController, ctx: EffectToolContext): AgentTool[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent tools for provider camera moves in the animation editor (`MotionCamera.in` / `during`):
|
|
3
|
+
* list the moves by role, set one on a shot and clear it. They ride on the animation effects
|
|
4
|
+
* tool provider (`createAnimationEffectsToolProvider`), next to the other provider effects.
|
|
5
|
+
*/
|
|
6
|
+
import type { EffectToolContext } from '../effects/tools.js';
|
|
7
|
+
import type { AgentTool } from '../tools/registry.js';
|
|
8
|
+
import type { AnimationEditorController } from './controller.js';
|
|
9
|
+
/** The camera move tools (see the module comment). */
|
|
10
|
+
export declare function animationCameraMoveTools(controller: AnimationEditorController, ctx: EffectToolContext): AgentTool[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider camera moves in the animation editor (see `MotionCamera.in` / `during` and
|
|
3
|
+
* `@pixerate/editor/effects`). The compiled camera track still eases a box from framing to
|
|
4
|
+
* framing; with a provider that has camera moves (`capabilities.supportsCamera`) the camera's
|
|
5
|
+
* view comes from the provider's `cameraView` while a move plays, and stays where a hold move
|
|
6
|
+
* left it until the next framing. Without one, every function here returns null and the box
|
|
7
|
+
* track rules, as before camera moves.
|
|
8
|
+
*/
|
|
9
|
+
import { type MotionIssue } from './issues.cjs';
|
|
10
|
+
import type { CameraMoveRole, CameraMoveSpec, CameraStage, CameraView, EffectProvider, EffectSummary } from '../effects/types.cjs';
|
|
11
|
+
import type { MotionRect, MotionScene, MotionShot } from './types.cjs';
|
|
12
|
+
/** When a shot's camera plays a move (or, after a hold move, eases from where it left off). */
|
|
13
|
+
export interface MotionCameraWindow {
|
|
14
|
+
shot: string;
|
|
15
|
+
/** `in` and `during` play a provider move; `ease` eases from a hold move's last view to the next framing. */
|
|
16
|
+
kind: 'in' | 'during' | 'ease';
|
|
17
|
+
/** The move's id (`in` and `during`). */
|
|
18
|
+
move?: string;
|
|
19
|
+
values?: Record<string, unknown>;
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
from: CameraView;
|
|
23
|
+
to: CameraView;
|
|
24
|
+
/** Where the camera is when the window ends and until the next one, or null when the box track takes over again. */
|
|
25
|
+
after: CameraView | null;
|
|
26
|
+
}
|
|
27
|
+
/** A shot's camera move for a role as its parts (`{ move, ms?, preset?, values? }`), or undefined. */
|
|
28
|
+
export declare function motionShotCameraMove(shot: MotionShot | undefined, role: CameraMoveRole): Exclude<CameraMoveSpec, string> | undefined;
|
|
29
|
+
/** The stage a scene's camera looks at: its artwork's size. */
|
|
30
|
+
export declare const motionCameraStage: (scene: MotionScene) => CameraStage;
|
|
31
|
+
/** True when a provider can play camera moves. */
|
|
32
|
+
export declare const effectsPlayCamera: (provider: EffectProvider | null | undefined) => provider is EffectProvider & {
|
|
33
|
+
cameraView: NonNullable<EffectProvider["cameraView"]>;
|
|
34
|
+
};
|
|
35
|
+
/** A provider's camera moves of a role (all of them with no role), in catalog order. Empty without camera support. */
|
|
36
|
+
export declare function motionCameraMoves(provider: EffectProvider | null | undefined, role?: CameraMoveRole): Promise<EffectSummary[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Where the scene's camera plays provider moves, in time order. Empty without a provider that
|
|
39
|
+
* plays camera moves, or when no shot names one. Cached per compiled scene and provider.
|
|
40
|
+
*/
|
|
41
|
+
export declare function motionCameraWindows(scene: MotionScene, provider: EffectProvider | null | undefined): MotionCameraWindow[];
|
|
42
|
+
/**
|
|
43
|
+
* Where the camera looks at `time` (ms) when a provider camera move decides it: during a move,
|
|
44
|
+
* and after a hold move until the next framing. Null otherwise (the camera box track rules), and
|
|
45
|
+
* always null without a provider that plays camera moves.
|
|
46
|
+
*/
|
|
47
|
+
export declare function motionCameraViewAt(scene: MotionScene, time: number, provider: EffectProvider | null | undefined): CameraView | null;
|
|
48
|
+
/** The camera box a view shows (what becomes the SVG `viewBox`). */
|
|
49
|
+
export declare function motionCameraBox(view: CameraView, scene: MotionScene): MotionRect;
|
|
50
|
+
/**
|
|
51
|
+
* The CSS `transform` for a view's tilt and turn on a stage element `width` pixels wide (they
|
|
52
|
+
* are 3D, so an SVG cannot draw them): `perspective(…) rotateX(…) rotateY(…)`, or `''` when flat.
|
|
53
|
+
* The roll and the blur are drawn in the frame's SVG.
|
|
54
|
+
*/
|
|
55
|
+
export declare function motionCameraTransform(view: CameraView | null | undefined, width: number): string;
|
|
56
|
+
/**
|
|
57
|
+
* The SVG with a view's roll and motion blur applied round its content: a rotation about the
|
|
58
|
+
* middle of the view's box, and a Gaussian blur (`blur` stage pixels, streaked along `blurAngle`
|
|
59
|
+
* as an axis-aligned approximation).
|
|
60
|
+
*/
|
|
61
|
+
export declare function withCameraViewEffects(svg: string, view: CameraView | null | undefined, box: MotionRect, idPrefix?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Problems with the scene's camera moves against a provider: moves it does not have or of the
|
|
64
|
+
* wrong role, and presets or values that do not fit (errors), or, without a provider that has
|
|
65
|
+
* camera moves, a note that they are not played.
|
|
66
|
+
*/
|
|
67
|
+
export declare function checkMotionCameraMoves(scene: MotionScene, provider: EffectProvider | null | undefined): Promise<MotionIssue[]>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider camera moves in the animation editor (see `MotionCamera.in` / `during` and
|
|
3
|
+
* `@pixerate/editor/effects`). The compiled camera track still eases a box from framing to
|
|
4
|
+
* framing; with a provider that has camera moves (`capabilities.supportsCamera`) the camera's
|
|
5
|
+
* view comes from the provider's `cameraView` while a move plays, and stays where a hold move
|
|
6
|
+
* left it until the next framing. Without one, every function here returns null and the box
|
|
7
|
+
* track rules, as before camera moves.
|
|
8
|
+
*/
|
|
9
|
+
import { type MotionIssue } from './issues.js';
|
|
10
|
+
import type { CameraMoveRole, CameraMoveSpec, CameraStage, CameraView, EffectProvider, EffectSummary } from '../effects/types.js';
|
|
11
|
+
import type { MotionRect, MotionScene, MotionShot } from './types.js';
|
|
12
|
+
/** When a shot's camera plays a move (or, after a hold move, eases from where it left off). */
|
|
13
|
+
export interface MotionCameraWindow {
|
|
14
|
+
shot: string;
|
|
15
|
+
/** `in` and `during` play a provider move; `ease` eases from a hold move's last view to the next framing. */
|
|
16
|
+
kind: 'in' | 'during' | 'ease';
|
|
17
|
+
/** The move's id (`in` and `during`). */
|
|
18
|
+
move?: string;
|
|
19
|
+
values?: Record<string, unknown>;
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
from: CameraView;
|
|
23
|
+
to: CameraView;
|
|
24
|
+
/** Where the camera is when the window ends and until the next one, or null when the box track takes over again. */
|
|
25
|
+
after: CameraView | null;
|
|
26
|
+
}
|
|
27
|
+
/** A shot's camera move for a role as its parts (`{ move, ms?, preset?, values? }`), or undefined. */
|
|
28
|
+
export declare function motionShotCameraMove(shot: MotionShot | undefined, role: CameraMoveRole): Exclude<CameraMoveSpec, string> | undefined;
|
|
29
|
+
/** The stage a scene's camera looks at: its artwork's size. */
|
|
30
|
+
export declare const motionCameraStage: (scene: MotionScene) => CameraStage;
|
|
31
|
+
/** True when a provider can play camera moves. */
|
|
32
|
+
export declare const effectsPlayCamera: (provider: EffectProvider | null | undefined) => provider is EffectProvider & {
|
|
33
|
+
cameraView: NonNullable<EffectProvider["cameraView"]>;
|
|
34
|
+
};
|
|
35
|
+
/** A provider's camera moves of a role (all of them with no role), in catalog order. Empty without camera support. */
|
|
36
|
+
export declare function motionCameraMoves(provider: EffectProvider | null | undefined, role?: CameraMoveRole): Promise<EffectSummary[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Where the scene's camera plays provider moves, in time order. Empty without a provider that
|
|
39
|
+
* plays camera moves, or when no shot names one. Cached per compiled scene and provider.
|
|
40
|
+
*/
|
|
41
|
+
export declare function motionCameraWindows(scene: MotionScene, provider: EffectProvider | null | undefined): MotionCameraWindow[];
|
|
42
|
+
/**
|
|
43
|
+
* Where the camera looks at `time` (ms) when a provider camera move decides it: during a move,
|
|
44
|
+
* and after a hold move until the next framing. Null otherwise (the camera box track rules), and
|
|
45
|
+
* always null without a provider that plays camera moves.
|
|
46
|
+
*/
|
|
47
|
+
export declare function motionCameraViewAt(scene: MotionScene, time: number, provider: EffectProvider | null | undefined): CameraView | null;
|
|
48
|
+
/** The camera box a view shows (what becomes the SVG `viewBox`). */
|
|
49
|
+
export declare function motionCameraBox(view: CameraView, scene: MotionScene): MotionRect;
|
|
50
|
+
/**
|
|
51
|
+
* The CSS `transform` for a view's tilt and turn on a stage element `width` pixels wide (they
|
|
52
|
+
* are 3D, so an SVG cannot draw them): `perspective(…) rotateX(…) rotateY(…)`, or `''` when flat.
|
|
53
|
+
* The roll and the blur are drawn in the frame's SVG.
|
|
54
|
+
*/
|
|
55
|
+
export declare function motionCameraTransform(view: CameraView | null | undefined, width: number): string;
|
|
56
|
+
/**
|
|
57
|
+
* The SVG with a view's roll and motion blur applied round its content: a rotation about the
|
|
58
|
+
* middle of the view's box, and a Gaussian blur (`blur` stage pixels, streaked along `blurAngle`
|
|
59
|
+
* as an axis-aligned approximation).
|
|
60
|
+
*/
|
|
61
|
+
export declare function withCameraViewEffects(svg: string, view: CameraView | null | undefined, box: MotionRect, idPrefix?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Problems with the scene's camera moves against a provider: moves it does not have or of the
|
|
64
|
+
* wrong role, and presets or values that do not fit (errors), or, without a provider that has
|
|
65
|
+
* camera moves, a note that they are not played.
|
|
66
|
+
*/
|
|
67
|
+
export declare function checkMotionCameraMoves(scene: MotionScene, provider: EffectProvider | null | undefined): Promise<MotionIssue[]>;
|
|
@@ -71,6 +71,10 @@ export interface MotionShotTiming {
|
|
|
71
71
|
cue?: number;
|
|
72
72
|
/** How late the shot starts after its cue (ms), when the shot before ran past it. */
|
|
73
73
|
missedBy?: number;
|
|
74
|
+
/** The provider camera move it gets in with (`camera.in`), and when it plays (`start` to `commandsStart`). */
|
|
75
|
+
cameraIn?: string;
|
|
76
|
+
/** The provider camera move it plays while it holds (`camera.during`), from `commandsEnd` to `end`. */
|
|
77
|
+
cameraDuring?: string;
|
|
74
78
|
}
|
|
75
79
|
export interface MotionCommandTiming {
|
|
76
80
|
shot: string;
|
|
@@ -71,6 +71,10 @@ export interface MotionShotTiming {
|
|
|
71
71
|
cue?: number;
|
|
72
72
|
/** How late the shot starts after its cue (ms), when the shot before ran past it. */
|
|
73
73
|
missedBy?: number;
|
|
74
|
+
/** The provider camera move it gets in with (`camera.in`), and when it plays (`start` to `commandsStart`). */
|
|
75
|
+
cameraIn?: string;
|
|
76
|
+
/** The provider camera move it plays while it holds (`camera.during`), from `commandsEnd` to `end`. */
|
|
77
|
+
cameraDuring?: string;
|
|
74
78
|
}
|
|
75
79
|
export interface MotionCommandTiming {
|
|
76
80
|
shot: string;
|
|
@@ -9,9 +9,9 @@ import { type MotionEdit, type MotionEditResult } from './edit.cjs';
|
|
|
9
9
|
import { type MotionFrame, type MotionFrameOptions, type MotionSvgOptions } from './evaluate.cjs';
|
|
10
10
|
import { type FlairEffectOptions, type FlairExportOptions } from './flair.cjs';
|
|
11
11
|
import type { MotionIssue } from './issues.cjs';
|
|
12
|
-
import type
|
|
12
|
+
import { type MotionCamera, type MotionScene } from './types.cjs';
|
|
13
13
|
import { EffectsSlot } from '../effects/helpers.cjs';
|
|
14
|
-
import type { EffectProvider, EffectValue } from '../effects/types.cjs';
|
|
14
|
+
import type { CameraMoveRole, CameraMoveSpec, EffectProvider, EffectSummary, EffectValue } from '../effects/types.cjs';
|
|
15
15
|
import { type MotionNodePose, type MotionTake, type MotionTakeOptions, type MotionTakeResult, type MotionTakeSample } from './record.cjs';
|
|
16
16
|
import { type AppliedMotionEffect } from './effects.cjs';
|
|
17
17
|
export interface AnimationEditorOptions {
|
|
@@ -40,6 +40,20 @@ export type MotionEffectResult = {
|
|
|
40
40
|
ok: false;
|
|
41
41
|
error: string;
|
|
42
42
|
};
|
|
43
|
+
/** What setting or clearing a shot's camera move did: the shot's camera now, and (when set) when the move plays (ms). */
|
|
44
|
+
export type MotionCameraMoveResult = {
|
|
45
|
+
ok: true;
|
|
46
|
+
shot: string;
|
|
47
|
+
camera: MotionCamera | null;
|
|
48
|
+
window?: {
|
|
49
|
+
start: number;
|
|
50
|
+
end: number;
|
|
51
|
+
};
|
|
52
|
+
notes: string[];
|
|
53
|
+
} | {
|
|
54
|
+
ok: false;
|
|
55
|
+
error: string;
|
|
56
|
+
};
|
|
43
57
|
/** What is selected on the timeline: a shot, and optionally one of its commands. */
|
|
44
58
|
export interface AnimationEditorSelection {
|
|
45
59
|
shot: string;
|
|
@@ -204,6 +218,24 @@ export declare class AnimationEditorController {
|
|
|
204
218
|
}): Promise<MotionEffectResult>;
|
|
205
219
|
/** Removes an applied effect: its commands, shots it alone filled and a vector effect's group. One undo step. Works without a provider. */
|
|
206
220
|
removeMotionEffect(instance: string): MotionEffectResult;
|
|
221
|
+
/**
|
|
222
|
+
* The provider's camera moves for a role (`transition` for a shot's `camera.in`, `hold` for its
|
|
223
|
+
* `camera.during`), or all of them. Empty without a provider that has camera moves.
|
|
224
|
+
*/
|
|
225
|
+
cameraMoves(role?: CameraMoveRole): Promise<EffectSummary[]>;
|
|
226
|
+
/**
|
|
227
|
+
* Sets the camera move a shot gets in with (`transition`, its `camera.in`) or plays while it
|
|
228
|
+
* holds (`hold`, its `camera.during`). The move is checked against the provider first (its
|
|
229
|
+
* role, preset and values; a preset's values are written out), then set in one undo step.
|
|
230
|
+
* A shot with no camera gets one that keeps the framing. Returns the shot's camera and when the
|
|
231
|
+
* move plays. `merge` folds a slider drag's changes into one undo step.
|
|
232
|
+
*/
|
|
233
|
+
setShotCameraMove(shot: string, role: CameraMoveRole, spec: CameraMoveSpec, options?: {
|
|
234
|
+
merge?: string;
|
|
235
|
+
}): Promise<MotionCameraMoveResult>;
|
|
236
|
+
/** Removes a shot's camera move for a role, keeping its framing (a camera left with nothing is removed). One undo step. Works without a provider. */
|
|
237
|
+
clearShotCameraMove(shot: string, role: CameraMoveRole): MotionCameraMoveResult;
|
|
238
|
+
private cameraMoveResult;
|
|
207
239
|
/** Opens a scene (JSON or object). `clearHistory` drops the undo stack (opening a file); otherwise it is one undo step. */
|
|
208
240
|
load(scene: MotionScene | string, options?: {
|
|
209
241
|
clearHistory?: boolean;
|
|
@@ -9,9 +9,9 @@ import { type MotionEdit, type MotionEditResult } from './edit.js';
|
|
|
9
9
|
import { type MotionFrame, type MotionFrameOptions, type MotionSvgOptions } from './evaluate.js';
|
|
10
10
|
import { type FlairEffectOptions, type FlairExportOptions } from './flair.js';
|
|
11
11
|
import type { MotionIssue } from './issues.js';
|
|
12
|
-
import type
|
|
12
|
+
import { type MotionCamera, type MotionScene } from './types.js';
|
|
13
13
|
import { EffectsSlot } from '../effects/helpers.js';
|
|
14
|
-
import type { EffectProvider, EffectValue } from '../effects/types.js';
|
|
14
|
+
import type { CameraMoveRole, CameraMoveSpec, EffectProvider, EffectSummary, EffectValue } from '../effects/types.js';
|
|
15
15
|
import { type MotionNodePose, type MotionTake, type MotionTakeOptions, type MotionTakeResult, type MotionTakeSample } from './record.js';
|
|
16
16
|
import { type AppliedMotionEffect } from './effects.js';
|
|
17
17
|
export interface AnimationEditorOptions {
|
|
@@ -40,6 +40,20 @@ export type MotionEffectResult = {
|
|
|
40
40
|
ok: false;
|
|
41
41
|
error: string;
|
|
42
42
|
};
|
|
43
|
+
/** What setting or clearing a shot's camera move did: the shot's camera now, and (when set) when the move plays (ms). */
|
|
44
|
+
export type MotionCameraMoveResult = {
|
|
45
|
+
ok: true;
|
|
46
|
+
shot: string;
|
|
47
|
+
camera: MotionCamera | null;
|
|
48
|
+
window?: {
|
|
49
|
+
start: number;
|
|
50
|
+
end: number;
|
|
51
|
+
};
|
|
52
|
+
notes: string[];
|
|
53
|
+
} | {
|
|
54
|
+
ok: false;
|
|
55
|
+
error: string;
|
|
56
|
+
};
|
|
43
57
|
/** What is selected on the timeline: a shot, and optionally one of its commands. */
|
|
44
58
|
export interface AnimationEditorSelection {
|
|
45
59
|
shot: string;
|
|
@@ -204,6 +218,24 @@ export declare class AnimationEditorController {
|
|
|
204
218
|
}): Promise<MotionEffectResult>;
|
|
205
219
|
/** Removes an applied effect: its commands, shots it alone filled and a vector effect's group. One undo step. Works without a provider. */
|
|
206
220
|
removeMotionEffect(instance: string): MotionEffectResult;
|
|
221
|
+
/**
|
|
222
|
+
* The provider's camera moves for a role (`transition` for a shot's `camera.in`, `hold` for its
|
|
223
|
+
* `camera.during`), or all of them. Empty without a provider that has camera moves.
|
|
224
|
+
*/
|
|
225
|
+
cameraMoves(role?: CameraMoveRole): Promise<EffectSummary[]>;
|
|
226
|
+
/**
|
|
227
|
+
* Sets the camera move a shot gets in with (`transition`, its `camera.in`) or plays while it
|
|
228
|
+
* holds (`hold`, its `camera.during`). The move is checked against the provider first (its
|
|
229
|
+
* role, preset and values; a preset's values are written out), then set in one undo step.
|
|
230
|
+
* A shot with no camera gets one that keeps the framing. Returns the shot's camera and when the
|
|
231
|
+
* move plays. `merge` folds a slider drag's changes into one undo step.
|
|
232
|
+
*/
|
|
233
|
+
setShotCameraMove(shot: string, role: CameraMoveRole, spec: CameraMoveSpec, options?: {
|
|
234
|
+
merge?: string;
|
|
235
|
+
}): Promise<MotionCameraMoveResult>;
|
|
236
|
+
/** Removes a shot's camera move for a role, keeping its framing (a camera left with nothing is removed). One undo step. Works without a provider. */
|
|
237
|
+
clearShotCameraMove(shot: string, role: CameraMoveRole): MotionCameraMoveResult;
|
|
238
|
+
private cameraMoveResult;
|
|
207
239
|
/** Opens a scene (JSON or object). `clearHistory` drops the undo stack (opening a file); otherwise it is one undo step. */
|
|
208
240
|
load(scene: MotionScene | string, options?: {
|
|
209
241
|
clearHistory?: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent tools for provider effects in the animation editor: the shared effect tools on artwork
|
|
3
3
|
* nodes (`apply_effect` applies a motion effect, made into commands) and `add_vector_effect`
|
|
4
|
-
* for vector effects that bring their own picture
|
|
4
|
+
* for vector effects that bring their own picture, and the camera move tools (`list_camera_moves`,
|
|
5
|
+
* `set_shot_camera_move`, `clear_shot_camera_move`).
|
|
5
6
|
*/
|
|
6
7
|
import type { AgentToolProvider } from '../tools/registry.cjs';
|
|
7
8
|
import type { AnimationEditorController } from './controller.cjs';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent tools for provider effects in the animation editor: the shared effect tools on artwork
|
|
3
3
|
* nodes (`apply_effect` applies a motion effect, made into commands) and `add_vector_effect`
|
|
4
|
-
* for vector effects that bring their own picture
|
|
4
|
+
* for vector effects that bring their own picture, and the camera move tools (`list_camera_moves`,
|
|
5
|
+
* `set_shot_camera_move`, `clear_shot_camera_move`).
|
|
5
6
|
*/
|
|
6
7
|
import type { AgentToolProvider } from '../tools/registry.js';
|
|
7
8
|
import type { AnimationEditorController } from './controller.js';
|
|
@@ -3,6 +3,7 @@ import { type AffineMatrix } from '../vector/geometry.cjs';
|
|
|
3
3
|
import { type VectorSvgExportOptions } from '../vector/svg.cjs';
|
|
4
4
|
import type { VectorDocument } from '../vector/types.cjs';
|
|
5
5
|
import { type MotionNodeEntry, type MotionTimeline } from './compile.cjs';
|
|
6
|
+
import type { CameraView, EffectProvider } from '../effects/types.cjs';
|
|
6
7
|
import type { MotionRect, MotionScene } from './types.cjs';
|
|
7
8
|
/**
|
|
8
9
|
* A reveal clip (`wipe`, `iris`, `split`) in the units of the node's own box: 0–1 across it,
|
|
@@ -25,6 +26,12 @@ export interface MotionFrame {
|
|
|
25
26
|
time: number;
|
|
26
27
|
document: VectorDocument;
|
|
27
28
|
camera: MotionRect;
|
|
29
|
+
/**
|
|
30
|
+
* Where the camera looks when a provider camera move decides it (`MotionCamera.in` /
|
|
31
|
+
* `during`), with its tilt, turn, roll and motion blur; `camera` is then this view's box.
|
|
32
|
+
* Absent otherwise.
|
|
33
|
+
*/
|
|
34
|
+
view?: CameraView;
|
|
28
35
|
/**
|
|
29
36
|
* Reveal clips by node id, outermost first: draw each of those nodes inside a group clipped
|
|
30
37
|
* to each shape (`motionFrameToSvg` does). The vector model has no clips, so they ride here.
|
|
@@ -38,6 +45,8 @@ export interface MotionFrameOptions {
|
|
|
38
45
|
draw?: boolean;
|
|
39
46
|
/** Apply moves, turns, scales and follows (default true). Off leaves nodes where they rest. */
|
|
40
47
|
offsets?: boolean;
|
|
48
|
+
/** An effects provider to play the shots' camera moves (`MotionCamera.in` / `during`); without one the camera eases between framings. */
|
|
49
|
+
effects?: EffectProvider | null;
|
|
41
50
|
}
|
|
42
51
|
/** Id of the trim effect that draws strokes on. */
|
|
43
52
|
export declare const MOTION_DRAW_EFFECT_ID = "~draw";
|
|
@@ -3,6 +3,7 @@ import { type AffineMatrix } from '../vector/geometry.js';
|
|
|
3
3
|
import { type VectorSvgExportOptions } from '../vector/svg.js';
|
|
4
4
|
import type { VectorDocument } from '../vector/types.js';
|
|
5
5
|
import { type MotionNodeEntry, type MotionTimeline } from './compile.js';
|
|
6
|
+
import type { CameraView, EffectProvider } from '../effects/types.js';
|
|
6
7
|
import type { MotionRect, MotionScene } from './types.js';
|
|
7
8
|
/**
|
|
8
9
|
* A reveal clip (`wipe`, `iris`, `split`) in the units of the node's own box: 0–1 across it,
|
|
@@ -25,6 +26,12 @@ export interface MotionFrame {
|
|
|
25
26
|
time: number;
|
|
26
27
|
document: VectorDocument;
|
|
27
28
|
camera: MotionRect;
|
|
29
|
+
/**
|
|
30
|
+
* Where the camera looks when a provider camera move decides it (`MotionCamera.in` /
|
|
31
|
+
* `during`), with its tilt, turn, roll and motion blur; `camera` is then this view's box.
|
|
32
|
+
* Absent otherwise.
|
|
33
|
+
*/
|
|
34
|
+
view?: CameraView;
|
|
28
35
|
/**
|
|
29
36
|
* Reveal clips by node id, outermost first: draw each of those nodes inside a group clipped
|
|
30
37
|
* to each shape (`motionFrameToSvg` does). The vector model has no clips, so they ride here.
|
|
@@ -38,6 +45,8 @@ export interface MotionFrameOptions {
|
|
|
38
45
|
draw?: boolean;
|
|
39
46
|
/** Apply moves, turns, scales and follows (default true). Off leaves nodes where they rest. */
|
|
40
47
|
offsets?: boolean;
|
|
48
|
+
/** An effects provider to play the shots' camera moves (`MotionCamera.in` / `during`); without one the camera eases between framings. */
|
|
49
|
+
effects?: EffectProvider | null;
|
|
41
50
|
}
|
|
42
51
|
/** Id of the trim effect that draws strokes on. */
|
|
43
52
|
export declare const MOTION_DRAW_EFFECT_ID = "~draw";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MotionBehavior } from '../animation/behavior.cjs';
|
|
2
2
|
import { type AnimationEasing } from '../animation/easing.cjs';
|
|
3
3
|
import type { MotionScene, MotionTrigger } from './types.cjs';
|
|
4
|
+
import type { EffectProvider } from '../effects/types.cjs';
|
|
4
5
|
/**
|
|
5
6
|
* Export to Flair (`@pixerate/flair`): a scene becomes an `SvgMotion` (one SVG plus a list of
|
|
6
7
|
* from → to changes on its elements), a catalog `VectorEffect`, or an `EffectDocument` for
|
|
@@ -153,6 +154,13 @@ export interface FlairExportOptions {
|
|
|
153
154
|
* stepped time (`strobe`). `curves` and `behaviors` override it.
|
|
154
155
|
*/
|
|
155
156
|
flair?: string;
|
|
157
|
+
/**
|
|
158
|
+
* An effects provider to play the shots' camera moves (`MotionCamera.in` / `during`): the camera
|
|
159
|
+
* is then sampled from its views at `fps`, keeping a move's cut as a change of no length. Without
|
|
160
|
+
* one a move is written as the eased framing. Either way each camera change a move makes is
|
|
161
|
+
* tagged `<move id>@<shot id>`.
|
|
162
|
+
*/
|
|
163
|
+
effects?: EffectProvider | null;
|
|
156
164
|
}
|
|
157
165
|
/** The Flair version exports target by default. */
|
|
158
166
|
export declare const FLAIR_EXPORT_VERSION = "0.39";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MotionBehavior } from '../animation/behavior.js';
|
|
2
2
|
import { type AnimationEasing } from '../animation/easing.js';
|
|
3
3
|
import type { MotionScene, MotionTrigger } from './types.js';
|
|
4
|
+
import type { EffectProvider } from '../effects/types.js';
|
|
4
5
|
/**
|
|
5
6
|
* Export to Flair (`@pixerate/flair`): a scene becomes an `SvgMotion` (one SVG plus a list of
|
|
6
7
|
* from → to changes on its elements), a catalog `VectorEffect`, or an `EffectDocument` for
|
|
@@ -153,6 +154,13 @@ export interface FlairExportOptions {
|
|
|
153
154
|
* stepped time (`strobe`). `curves` and `behaviors` override it.
|
|
154
155
|
*/
|
|
155
156
|
flair?: string;
|
|
157
|
+
/**
|
|
158
|
+
* An effects provider to play the shots' camera moves (`MotionCamera.in` / `during`): the camera
|
|
159
|
+
* is then sampled from its views at `fps`, keeping a move's cut as a change of no length. Without
|
|
160
|
+
* one a move is written as the eased framing. Either way each camera change a move makes is
|
|
161
|
+
* tagged `<move id>@<shot id>`.
|
|
162
|
+
*/
|
|
163
|
+
effects?: EffectProvider | null;
|
|
156
164
|
}
|
|
157
165
|
/** The Flair version exports target by default. */
|
|
158
166
|
export declare const FLAIR_EXPORT_VERSION = "0.39";
|