@pixerate/editor 0.69.0 → 0.71.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/index.cjs +239 -69
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +91 -5
- package/dist/animation-editor/index.d.ts +91 -5
- package/dist/animation-editor/index.js +193 -23
- package/dist/animation-editor/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -174,7 +174,7 @@ type MotionSplitOrientation = 'horizontal' | 'vertical';
|
|
|
174
174
|
* Brings hidden targets in. Targets entered in a shot are hidden before it. Each style is a
|
|
175
175
|
* Flair motion primitive (`entrance.<style>`) with the same defaults.
|
|
176
176
|
*/
|
|
177
|
-
interface MotionEnterCommand extends MotionCommandBase {
|
|
177
|
+
interface MotionEnterCommand extends MotionCommandBase, MotionDrawOrder {
|
|
178
178
|
type: 'enter';
|
|
179
179
|
/**
|
|
180
180
|
* Default `fade`. `draw` draws the outline on, then fades the fill in. `pop` scales up past
|
|
@@ -198,7 +198,7 @@ interface MotionEnterCommand extends MotionCommandBase {
|
|
|
198
198
|
orientation?: MotionSplitOrientation;
|
|
199
199
|
}
|
|
200
200
|
/** Takes targets out. */
|
|
201
|
-
interface MotionExitCommand extends MotionCommandBase {
|
|
201
|
+
interface MotionExitCommand extends MotionCommandBase, MotionDrawOrder {
|
|
202
202
|
type: 'exit';
|
|
203
203
|
/** Default `fade`. `wipe` hides the target behind an edge travelling `direction` (a wipe in, reversed). */
|
|
204
204
|
style?: MotionExitStyle;
|
|
@@ -206,9 +206,33 @@ interface MotionExitCommand extends MotionCommandBase {
|
|
|
206
206
|
direction?: MotionDirection;
|
|
207
207
|
distance?: number;
|
|
208
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* How the strokes of a group (or several paths) draw on or off together. Default: all at once,
|
|
211
|
+
* each over the whole time.
|
|
212
|
+
*/
|
|
213
|
+
interface MotionDrawOrder {
|
|
214
|
+
/** `together` (default) or `sequence`: one stroke after another, each for a time in proportion to its length. */
|
|
215
|
+
order?: 'together' | 'sequence';
|
|
216
|
+
/** With `together`: `time` (default) gives every stroke the whole time; `speed` draws them all at one speed, so short ones take less. */
|
|
217
|
+
pace?: 'time' | 'speed';
|
|
218
|
+
/** With `pace: "speed"`: `start` (default) starts them together, `end` finishes them together. */
|
|
219
|
+
align?: 'start' | 'end';
|
|
220
|
+
/** With `sequence`: `document` (default, stacking order) or `distance` from `origin` (a radial reveal). */
|
|
221
|
+
sortBy?: 'document' | 'distance';
|
|
222
|
+
/** With `sortBy: "distance"`: the point (document units) strokes are drawn out from (default the target's centre). */
|
|
223
|
+
origin?: {
|
|
224
|
+
x: number;
|
|
225
|
+
y: number;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
209
228
|
/** Draws a stroke on (or off) between two fractions of its length. */
|
|
210
|
-
interface MotionDrawCommand extends MotionCommandBase {
|
|
229
|
+
interface MotionDrawCommand extends MotionCommandBase, MotionDrawOrder {
|
|
211
230
|
type: 'draw';
|
|
231
|
+
/**
|
|
232
|
+
* A travelling stroke this fraction of the length long (0–1): it runs along the path and off
|
|
233
|
+
* the end, instead of drawing it on and leaving it.
|
|
234
|
+
*/
|
|
235
|
+
comet?: number;
|
|
212
236
|
/** Fraction drawn at the end (default 1). */
|
|
213
237
|
to?: number;
|
|
214
238
|
/** Fraction drawn at the start (default: what is drawn now). */
|
|
@@ -1076,6 +1100,17 @@ interface MotionOverlayOptions {
|
|
|
1076
1100
|
* `motionFrameToSvg`.
|
|
1077
1101
|
*/
|
|
1078
1102
|
declare function motionStageSvg(scene: MotionScene, time: number, options?: MotionSvgOptions & MotionOverlayOptions): string;
|
|
1103
|
+
interface MotionContactSheetOptions extends MotionSvgOptions, MotionOverlayOptions {
|
|
1104
|
+
/** Frames a row (default: about square). */
|
|
1105
|
+
columns?: number;
|
|
1106
|
+
/** Write each frame's time (and shot) under it (default true). */
|
|
1107
|
+
labels?: boolean;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Several moments of the scene in one SVG, in a grid with each frame's time and shot under it:
|
|
1111
|
+
* a contact sheet, to see a whole animation (or an agent's change to it) at a glance.
|
|
1112
|
+
*/
|
|
1113
|
+
declare function motionContactSheetSvg(scene: MotionScene, times: readonly number[], options?: MotionContactSheetOptions): string;
|
|
1079
1114
|
|
|
1080
1115
|
/** Changes shorter than this (ms) are too quick to follow. */
|
|
1081
1116
|
declare const MOTION_MIN_CHANGE_MS = 120;
|
|
@@ -1171,6 +1206,32 @@ type MotionEditResult = {
|
|
|
1171
1206
|
declare function freshShotId(scene: MotionScene, base?: string): string;
|
|
1172
1207
|
/** Applies edits in order, as one change. Fails without changing anything when one fails. */
|
|
1173
1208
|
declare function applyMotionEdits(scene: MotionScene, edits: MotionEdit | readonly MotionEdit[]): MotionEditResult;
|
|
1209
|
+
/** What one edit made, for later edits in a batch to refer to (`"$0.indexes[0]"`). */
|
|
1210
|
+
interface MotionEditOutcome {
|
|
1211
|
+
op: string;
|
|
1212
|
+
/** The shot it changed or added to. */
|
|
1213
|
+
shot?: string;
|
|
1214
|
+
/** Shots it added. */
|
|
1215
|
+
shots?: string[];
|
|
1216
|
+
/** Indexes of the commands it added (or where it moved one). */
|
|
1217
|
+
indexes?: number[];
|
|
1218
|
+
/** The clip it set. */
|
|
1219
|
+
clip?: string;
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Resolves references to earlier edits' outcomes in a batch: a string `"$N.path"` (`$last` for the
|
|
1223
|
+
* one before) is replaced by that value, e.g. `"$0.indexes[0]"` for the index of the first command
|
|
1224
|
+
* edit 0 added; `"$$..."` is a literal `$`. Returns the resolved edits with what each made, or why
|
|
1225
|
+
* a reference does not resolve. Nothing is applied.
|
|
1226
|
+
*/
|
|
1227
|
+
declare function resolveMotionEditRefs(scene: MotionScene, edits: readonly MotionEdit[]): {
|
|
1228
|
+
ok: true;
|
|
1229
|
+
edits: MotionEdit[];
|
|
1230
|
+
outcomes: MotionEditOutcome[];
|
|
1231
|
+
} | {
|
|
1232
|
+
ok: false;
|
|
1233
|
+
error: string;
|
|
1234
|
+
};
|
|
1174
1235
|
/** An empty scene over `artwork`. */
|
|
1175
1236
|
declare function createMotionScene(artwork: VectorDocument, init?: Partial<Omit<MotionScene, 'artwork' | 'version'>>): MotionScene;
|
|
1176
1237
|
|
|
@@ -1674,6 +1735,14 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1674
1735
|
repeat?: number;
|
|
1675
1736
|
repeatMode?: "loop" | "mirror" | "offset";
|
|
1676
1737
|
steps?: number;
|
|
1738
|
+
order?: "together" | "sequence";
|
|
1739
|
+
pace?: "time" | "speed";
|
|
1740
|
+
align?: "start" | "end";
|
|
1741
|
+
sortBy?: "document" | "distance";
|
|
1742
|
+
origin?: {
|
|
1743
|
+
x: number;
|
|
1744
|
+
y: number;
|
|
1745
|
+
};
|
|
1677
1746
|
index: number;
|
|
1678
1747
|
} | {
|
|
1679
1748
|
flairPrimitive?: string | undefined;
|
|
@@ -1693,12 +1762,21 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1693
1762
|
repeat?: number;
|
|
1694
1763
|
repeatMode?: "loop" | "mirror" | "offset";
|
|
1695
1764
|
steps?: number;
|
|
1765
|
+
order?: "together" | "sequence";
|
|
1766
|
+
pace?: "time" | "speed";
|
|
1767
|
+
align?: "start" | "end";
|
|
1768
|
+
sortBy?: "document" | "distance";
|
|
1769
|
+
origin?: {
|
|
1770
|
+
x: number;
|
|
1771
|
+
y: number;
|
|
1772
|
+
};
|
|
1696
1773
|
index: number;
|
|
1697
1774
|
} | {
|
|
1698
1775
|
flairPrimitive?: string | undefined;
|
|
1699
1776
|
start: number;
|
|
1700
1777
|
end: number;
|
|
1701
1778
|
type: "draw";
|
|
1779
|
+
comet?: number;
|
|
1702
1780
|
to?: number;
|
|
1703
1781
|
from?: number;
|
|
1704
1782
|
targets: string[];
|
|
@@ -1711,6 +1789,14 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1711
1789
|
repeat?: number;
|
|
1712
1790
|
repeatMode?: "loop" | "mirror" | "offset";
|
|
1713
1791
|
steps?: number;
|
|
1792
|
+
order?: "together" | "sequence";
|
|
1793
|
+
pace?: "time" | "speed";
|
|
1794
|
+
align?: "start" | "end";
|
|
1795
|
+
sortBy?: "document" | "distance";
|
|
1796
|
+
origin?: {
|
|
1797
|
+
x: number;
|
|
1798
|
+
y: number;
|
|
1799
|
+
};
|
|
1714
1800
|
index: number;
|
|
1715
1801
|
} | {
|
|
1716
1802
|
flairPrimitive?: string | undefined;
|
|
@@ -2060,7 +2146,7 @@ declare function createAnimationEditorToolProvider(controller: AnimationEditorCo
|
|
|
2060
2146
|
* A short authoring guide for a model writing vector animations with the animation editor's
|
|
2061
2147
|
* tools. Static, so it caches well as part of a system prompt.
|
|
2062
2148
|
*/
|
|
2063
|
-
declare const ANIMATION_EDITOR_AGENT_INSTRUCTIONS = "You animate vector artwork. A scene is artwork (vector paths and groups, each with an id) plus shots.\n\nHow it plays\n- Shots play in order. A shot optionally moves the camera, plays its commands, then holds (default 600 ms).\n- Commands in a shot play one after another; give \"with\": \"previous\" to start one together with the command before, \"delay\" to wait, \"stagger\" to offset several targets.\n- Timing comes from the content: each command has a default length (enter 600 ms, move 700 ms, draw follows the path length). Only set \"duration\" to change the pace.\n- Anything that enters later is hidden until it enters. Things that never enter are visible from the start.\n- Every frame is a pure function of time: the same scene always plays the same frames.\n\nCommands\n- enter (fade, pop, grow, slide, draw) and exit (fade, shrink, slide, undraw) bring things in and out.\n- enter also reveals through a clip over the target's box: wipe (behind an edge travelling \"direction\", default right), iris (from the centre; \"shape\": circle or box) and split (from a line through the middle; \"orientation\": horizontal or vertical). exit wipe hides the same way. Reveals need a width and a height: use draw / undraw for a straight line.\n- draw draws strokes on to a fraction; move, rotate, scale and fade change the pose (about the centre); style blends solid colours and stroke width.\n- Reuse motion: set_animation_clip defines a clip (commands targeting \"$\"), and { \"type\": \"play\", \"clip\": name, \"targets\": [...] } plays it on any nodes (with stagger and speed). copy_animation gives other nodes one node's motion.\n- move takes \"via\" waypoints for a curved, smooth path that passes exactly through each point (steady speed by default); use it instead of chaining moves, which stop at each point.\n- enter also has zoom (settles from larger) and rise (rises a short way, overshooting a touch); pop and zoom take a starting \"scale\".\n- morph turns a shape into another node's shape (keep the target hidden); match does the same for a whole group, part by part (Smart Animate: draw the end state as a second, hidden group whose parts share names with the first); follow moves along a path node (with \"rotate\", moves made meanwhile turn with the path).\n- Emphasis draws the eye and returns to rest: pulse (swell), shake (side to side, or \"axis\": \"vertical\"), teeter (rock), wave (bob, no settling), wiggle (seeded wander; the same seed wanders the same way) and color-pulse (tint and back).\n- Emphasis stacks on other motion: a shake during a slide shakes as it slides. Give move, rotate or scale \"blend\": \"add\" to stack them too (what they add stays); \"blend\": \"replace\" makes a change take over instead.\n- Any command but enter and exit can \"repeat\" (loop, mirror back and forth, or offset to carry on: rotate by 90, repeat 4 is a full turn); \"duration\" is one cycle.\n- Springs (\"spring-gentle\", \"spring-quick\", \"spring-bouncy\", \"spring-slow\" or { \"type\": \"spring\", \u2026 }) feel physical; leave \"duration\" out and the spring sets it.\n- To time shots to music or a voiceover: set a \"beat\" grid or \"narration\" word timings with set_animation_settings, read them with get_timing_grid, and give a shot \"at\": { \"beat\": n } or { \"word\": i }. The shot before holds until the cue; check_animation warns when a cue is missed.\n- \"steps\": 12 (on a command, or for the whole scene with set_animation_settings) holds poses \"on twos\" for a hand-drawn look. \"geometric\": true on scale or a camera zooms at an even rate.\n- Commands share their names and defaults with Flair's motion primitives (get_animation shows each one's \"flairPrimitive\"), and emphasis, reveals and follows export to Flair exactly.\n- effect tweens a numeric parameter of a live path effect already on the node (twist angle, wiggle time, zig zag size).\n\nWorking method\n1. get_animation to learn the element ids (set_animation_artwork_svg first if there is no artwork: give every element you will animate an id; or import_flair_effect to start from a Flair effect and edit it).\n2. Plan a few shots, each one idea. Add them with insert_shots (add_commands, update_command, move_command and delete_commands refine a shot), or edit_animation to make several edits as one step (dry_run first when unsure).\n3. To hit a length, fit_animation (keep the shots whose pace matters). check_animation and fix every error and warning; render_animation_frame (shot + \"end\") to look at the result; add onion_skin or motion_paths to see the motion in one picture, or get_motion_path for the numbers.\n- For something the viewer plays (a button, a toggle, a step-by-step explainer), set \"trigger\" with set_animation_settings: click plays the next shot on each click and then starts over (make the last shot put things back for a toggle), hover or press plays and rewinds, scroll scrubs.\n4. To make a reusable Flair effect, set_animation_controls (colour controls stand for every use of their default colour) and export_flair_effect.\n\nKeep motion purposeful: one thing moving at a time reads best, ease-out for arrivals, ease-in for exits, and hold long enough to see each result.";
|
|
2149
|
+
declare const ANIMATION_EDITOR_AGENT_INSTRUCTIONS = "You animate vector artwork. A scene is artwork (vector paths and groups, each with an id) plus shots.\n\nHow it plays\n- Shots play in order. A shot optionally moves the camera, plays its commands, then holds (default 600 ms).\n- Commands in a shot play one after another; give \"with\": \"previous\" to start one together with the command before, \"delay\" to wait, \"stagger\" to offset several targets.\n- Timing comes from the content: each command has a default length (enter 600 ms, move 700 ms, draw follows the path length). Only set \"duration\" to change the pace.\n- Anything that enters later is hidden until it enters. Things that never enter are visible from the start.\n- Every frame is a pure function of time: the same scene always plays the same frames.\n\nCommands\n- enter (fade, pop, grow, slide, draw) and exit (fade, shrink, slide, undraw) bring things in and out.\n- enter also reveals through a clip over the target's box: wipe (behind an edge travelling \"direction\", default right), iris (from the centre; \"shape\": circle or box) and split (from a line through the middle; \"orientation\": horizontal or vertical). exit wipe hides the same way. Reveals need a width and a height: use draw / undraw for a straight line.\n- draw draws strokes on to a fraction; move, rotate, scale and fade change the pose (about the centre); style blends solid colours and stroke width.\n- Drawing a group of strokes: \"order\": \"sequence\" draws them one after another (a signature, a diagram), \"sortBy\": \"distance\" from \"origin\" reveals outward, \"pace\": \"speed\" keeps one speed; draw with \"comet\": 0.2 sends a short stroke along a path and off the end.\n- Reuse motion: set_animation_clip defines a clip (commands targeting \"$\"), and { \"type\": \"play\", \"clip\": name, \"targets\": [...] } plays it on any nodes (with stagger and speed). copy_animation gives other nodes one node's motion.\n- move takes \"via\" waypoints for a curved, smooth path that passes exactly through each point (steady speed by default); use it instead of chaining moves, which stop at each point.\n- enter also has zoom (settles from larger) and rise (rises a short way, overshooting a touch); pop and zoom take a starting \"scale\".\n- morph turns a shape into another node's shape (keep the target hidden); match does the same for a whole group, part by part (Smart Animate: draw the end state as a second, hidden group whose parts share names with the first); follow moves along a path node (with \"rotate\", moves made meanwhile turn with the path).\n- Emphasis draws the eye and returns to rest: pulse (swell), shake (side to side, or \"axis\": \"vertical\"), teeter (rock), wave (bob, no settling), wiggle (seeded wander; the same seed wanders the same way) and color-pulse (tint and back).\n- Emphasis stacks on other motion: a shake during a slide shakes as it slides. Give move, rotate or scale \"blend\": \"add\" to stack them too (what they add stays); \"blend\": \"replace\" makes a change take over instead.\n- Any command but enter and exit can \"repeat\" (loop, mirror back and forth, or offset to carry on: rotate by 90, repeat 4 is a full turn); \"duration\" is one cycle.\n- Springs (\"spring-gentle\", \"spring-quick\", \"spring-bouncy\", \"spring-slow\" or { \"type\": \"spring\", \u2026 }) feel physical; leave \"duration\" out and the spring sets it.\n- To time shots to music or a voiceover: set a \"beat\" grid or \"narration\" word timings with set_animation_settings, read them with get_timing_grid, and give a shot \"at\": { \"beat\": n } or { \"word\": i }. The shot before holds until the cue; check_animation warns when a cue is missed.\n- \"steps\": 12 (on a command, or for the whole scene with set_animation_settings) holds poses \"on twos\" for a hand-drawn look. \"geometric\": true on scale or a camera zooms at an even rate.\n- Commands share their names and defaults with Flair's motion primitives (get_animation shows each one's \"flairPrimitive\"), and emphasis, reveals and follows export to Flair exactly.\n- effect tweens a numeric parameter of a live path effect already on the node (twist angle, wiggle time, zig zag size).\n\nWorking method\n1. get_animation to learn the element ids (set_animation_artwork_svg first if there is no artwork: give every element you will animate an id; or import_flair_effect to start from a Flair effect and edit it).\n2. Plan a few shots, each one idea. Add them with insert_shots (add_commands, update_command, move_command and delete_commands refine a shot), or edit_animation to make several edits as one step (dry_run first when unsure).\n- In edit_animation, a later op can use what an earlier one made: \"$0.indexes[0]\" (the first command op 1 added), \"$last.shot\".\n3. To hit a length, fit_animation (keep the shots whose pace matters). check_animation and fix every error and warning; render_animation_frame (shot + \"end\") to look at the result, or with \"times\" for a contact sheet of several moments; add onion_skin or motion_paths to see the motion in one picture, or get_motion_path for the numbers.\n- For something the viewer plays (a button, a toggle, a step-by-step explainer), set \"trigger\" with set_animation_settings: click plays the next shot on each click and then starts over (make the last shot put things back for a toggle), hover or press plays and rewinds, scroll scrubs.\n4. To make a reusable Flair effect, set_animation_controls (colour controls stand for every use of their default colour) and export_flair_effect.\n\nKeep motion purposeful: one thing moving at a time reads best, ease-out for arrivals, ease-in for exits, and hold long enough to see each result.";
|
|
2064
2150
|
|
|
2065
2151
|
/**
|
|
2066
2152
|
* Helpers for hand-editing UIs (React's and Svelte's command inspector, ease picker, cue picker,
|
|
@@ -2207,4 +2293,4 @@ declare function parseMotionNarration(text: string): {
|
|
|
2207
2293
|
error: string;
|
|
2208
2294
|
};
|
|
2209
2295
|
|
|
2210
|
-
export { ANIMATION_EDITOR_AGENT_INSTRUCTIONS, AnimationEditorController, type AnimationEditorOptions, type AnimationEditorSelection, type AnimationEditorState, type AnimationEditorToolProviderOptions, FLAIR_EASES, FLAIR_EXPORT_VERSION, type FlairEase, type FlairEaseName, type FlairEffectDocument, type FlairEffectOptions, type FlairExportOptions, type FlairImportOptions, type FlairImportResult, type FlairMotionExport, type FlairSpringEase, type FlairSvgAnimation, type FlairSvgMotion, type FlairVectorEffect, type LottieAnimation, type LottieExport, type LottieExportOptions, type LottieKeyframe, type LottieShape, type LottieValue, MOTION_ADDITIVE_PROPERTIES, MOTION_BLENDS, MOTION_CAMERA_MS, MOTION_CLIP_TARGET, MOTION_COMMAND_SCHEMA, MOTION_COMMAND_TYPES, MOTION_DEFAULT_DURATIONS, MOTION_DEFAULT_HOLD, MOTION_DIRECTIONS, MOTION_DRAW_EFFECT_ID, MOTION_DRAW_MS_PER_UNIT, MOTION_DRAW_RANGE, MOTION_EASE_CHOICES, MOTION_EASE_IN_OUT, MOTION_EASE_OUT, MOTION_EDIT_OPS, MOTION_ENTER_STYLES, MOTION_EXIT_STYLES, MOTION_IRIS_SHAPES, MOTION_ISSUE_CODES, MOTION_MIN_CHANGE_MS, MOTION_REPEAT_MODES, MOTION_SPEED_RANGE, MOTION_SPLIT_ORIENTATIONS, MOTION_TRIGGERS, type MotionBeatGrid, type MotionCamera, type MotionClip, type MotionClipItem, type MotionClipShape, type MotionColorPulseCommand, type MotionCommand, type MotionCommandBase, type MotionCommandTiming, type MotionCommandType, type MotionControl, type MotionCue, type MotionDirection, type MotionDrawCommand, type MotionEasingCurve, type MotionEdit, type MotionEditOp, type MotionEditResult, type MotionEffectCommand, type MotionEnterCommand, type MotionEnterStyle, type MotionExitCommand, type MotionExitStyle, type MotionFadeCommand, type MotionFieldInput, type MotionFieldKind, type MotionFieldSpec, type MotionFit, type MotionFitOptions, type MotionFollowCommand, type MotionFrame, type MotionFrameOptions, type MotionGhost, type MotionIrisShape, type MotionIssue, type MotionIssueCode, type MotionIssueSeverity, type MotionMatch, type MotionMatchCommand, type MotionMorphCommand, type MotionMoveCommand, type MotionNarration, type MotionNodeEntry, type MotionOnionSkin, type MotionOverlayOptions, type MotionPath, type MotionPathOptions, type MotionPlayCommand, type MotionPreset, type MotionProperty, type MotionPulseCommand, type MotionRect, type MotionReveal, type MotionRotateCommand, type MotionScaleCommand, type MotionScene, MotionSceneFormatError, type MotionSegment, type MotionShakeCommand, type MotionShot, type MotionShotTiming, type MotionSmoothLeg, type MotionSplitOrientation, type MotionStyleCommand, type MotionSvgOptions, type MotionTeeterCommand, type MotionTimeline, type MotionTrigger, type MotionValue, type MotionWaitCommand, type MotionWaveCommand, type MotionWiggleCommand, activeSegment, applyMotionControlValues, applyMotionEdits, checkMotionScene, clipsShapeProblems, commandShapeProblems, compileMotionScene, createAnimationEditorToolProvider, createMotionScene, defaultMotionCommand, describeMotionElements, describeMotionShots, duplicateMotionCommandEdit, fitMotionRect, fitMotionScene, fitMotionSceneEdits, flairAtLeast, flairCurveFor, flairEaseFor, formatMotionNarration, freshShotId, fromFlairSvgMotion, fromFlairVectorEffect, highlightMotionSvg, indexMotionNodes, interpolateMotionValue, isMotionCommand, isMotionShot, matchMotionNodes, motionAddTrackKey, motionBeatAt, motionBeatTime, motionClipAttrs, motionClipLayout, motionCommandDuration, motionCommandFields, motionCommandRepeat, motionCommandRows, motionCommandSummary, motionCueChoices, motionCueFromKey, motionCueKey, motionCueTime, motionCycleDuration, motionEaseKey, motionEasingCurve, motionEasingGuides, motionEasingPath, motionFieldEdit, motionFieldLabel, motionFlairPrimitive, motionFollowRoute, motionFrameAt, motionFrameToSvg, motionGhosts, motionIssue, motionIssueKey, motionIssueLine, motionMovingIds, motionNodeAtElement, motionNodeClips, motionNodeOffset, motionPath, motionPathLength, motionPathsSvg, motionRestValue, motionRevealClip, motionRevealPadding, motionRulerTicks, motionSceneShapeProblems, motionSceneToJson, motionShotAt, motionShotCueTime, motionShotTimeScale, motionStageSvg, motionTrackKey, namedWithSuggestion, parseMotionFieldInput, parseMotionNarration, parseMotionScene, resolveMotionCamera, segmentProgress, segmentValue, shotShapeProblems, smoothMotionLegs, smoothMotionTimes, suggestName, toFlairEffectDocument, toFlairSvgMotion, toFlairVectorEffect, toLottie, trackValue, withMotionLayers, withViewBox };
|
|
2296
|
+
export { ANIMATION_EDITOR_AGENT_INSTRUCTIONS, AnimationEditorController, type AnimationEditorOptions, type AnimationEditorSelection, type AnimationEditorState, type AnimationEditorToolProviderOptions, FLAIR_EASES, FLAIR_EXPORT_VERSION, type FlairEase, type FlairEaseName, type FlairEffectDocument, type FlairEffectOptions, type FlairExportOptions, type FlairImportOptions, type FlairImportResult, type FlairMotionExport, type FlairSpringEase, type FlairSvgAnimation, type FlairSvgMotion, type FlairVectorEffect, type LottieAnimation, type LottieExport, type LottieExportOptions, type LottieKeyframe, type LottieShape, type LottieValue, MOTION_ADDITIVE_PROPERTIES, MOTION_BLENDS, MOTION_CAMERA_MS, MOTION_CLIP_TARGET, MOTION_COMMAND_SCHEMA, MOTION_COMMAND_TYPES, MOTION_DEFAULT_DURATIONS, MOTION_DEFAULT_HOLD, MOTION_DIRECTIONS, MOTION_DRAW_EFFECT_ID, MOTION_DRAW_MS_PER_UNIT, MOTION_DRAW_RANGE, MOTION_EASE_CHOICES, MOTION_EASE_IN_OUT, MOTION_EASE_OUT, MOTION_EDIT_OPS, MOTION_ENTER_STYLES, MOTION_EXIT_STYLES, MOTION_IRIS_SHAPES, MOTION_ISSUE_CODES, MOTION_MIN_CHANGE_MS, MOTION_REPEAT_MODES, MOTION_SPEED_RANGE, MOTION_SPLIT_ORIENTATIONS, MOTION_TRIGGERS, type MotionBeatGrid, type MotionCamera, type MotionClip, type MotionClipItem, type MotionClipShape, type MotionColorPulseCommand, type MotionCommand, type MotionCommandBase, type MotionCommandTiming, type MotionCommandType, type MotionContactSheetOptions, type MotionControl, type MotionCue, type MotionDirection, type MotionDrawCommand, type MotionDrawOrder, type MotionEasingCurve, type MotionEdit, type MotionEditOp, type MotionEditOutcome, type MotionEditResult, type MotionEffectCommand, type MotionEnterCommand, type MotionEnterStyle, type MotionExitCommand, type MotionExitStyle, type MotionFadeCommand, type MotionFieldInput, type MotionFieldKind, type MotionFieldSpec, type MotionFit, type MotionFitOptions, type MotionFollowCommand, type MotionFrame, type MotionFrameOptions, type MotionGhost, type MotionIrisShape, type MotionIssue, type MotionIssueCode, type MotionIssueSeverity, type MotionMatch, type MotionMatchCommand, type MotionMorphCommand, type MotionMoveCommand, type MotionNarration, type MotionNodeEntry, type MotionOnionSkin, type MotionOverlayOptions, type MotionPath, type MotionPathOptions, type MotionPlayCommand, type MotionPreset, type MotionProperty, type MotionPulseCommand, type MotionRect, type MotionReveal, type MotionRotateCommand, type MotionScaleCommand, type MotionScene, MotionSceneFormatError, type MotionSegment, type MotionShakeCommand, type MotionShot, type MotionShotTiming, type MotionSmoothLeg, type MotionSplitOrientation, type MotionStyleCommand, type MotionSvgOptions, type MotionTeeterCommand, type MotionTimeline, type MotionTrigger, type MotionValue, type MotionWaitCommand, type MotionWaveCommand, type MotionWiggleCommand, activeSegment, applyMotionControlValues, applyMotionEdits, checkMotionScene, clipsShapeProblems, commandShapeProblems, compileMotionScene, createAnimationEditorToolProvider, createMotionScene, defaultMotionCommand, describeMotionElements, describeMotionShots, duplicateMotionCommandEdit, fitMotionRect, fitMotionScene, fitMotionSceneEdits, flairAtLeast, flairCurveFor, flairEaseFor, formatMotionNarration, freshShotId, fromFlairSvgMotion, fromFlairVectorEffect, highlightMotionSvg, indexMotionNodes, interpolateMotionValue, isMotionCommand, isMotionShot, matchMotionNodes, motionAddTrackKey, motionBeatAt, motionBeatTime, motionClipAttrs, motionClipLayout, motionCommandDuration, motionCommandFields, motionCommandRepeat, motionCommandRows, motionCommandSummary, motionContactSheetSvg, motionCueChoices, motionCueFromKey, motionCueKey, motionCueTime, motionCycleDuration, motionEaseKey, motionEasingCurve, motionEasingGuides, motionEasingPath, motionFieldEdit, motionFieldLabel, motionFlairPrimitive, motionFollowRoute, motionFrameAt, motionFrameToSvg, motionGhosts, motionIssue, motionIssueKey, motionIssueLine, motionMovingIds, motionNodeAtElement, motionNodeClips, motionNodeOffset, motionPath, motionPathLength, motionPathsSvg, motionRestValue, motionRevealClip, motionRevealPadding, motionRulerTicks, motionSceneShapeProblems, motionSceneToJson, motionShotAt, motionShotCueTime, motionShotTimeScale, motionStageSvg, motionTrackKey, namedWithSuggestion, parseMotionFieldInput, parseMotionNarration, parseMotionScene, resolveMotionCamera, resolveMotionEditRefs, segmentProgress, segmentValue, shotShapeProblems, smoothMotionLegs, smoothMotionTimes, suggestName, toFlairEffectDocument, toFlairSvgMotion, toFlairVectorEffect, toLottie, trackValue, withMotionLayers, withViewBox };
|
|
@@ -174,7 +174,7 @@ type MotionSplitOrientation = 'horizontal' | 'vertical';
|
|
|
174
174
|
* Brings hidden targets in. Targets entered in a shot are hidden before it. Each style is a
|
|
175
175
|
* Flair motion primitive (`entrance.<style>`) with the same defaults.
|
|
176
176
|
*/
|
|
177
|
-
interface MotionEnterCommand extends MotionCommandBase {
|
|
177
|
+
interface MotionEnterCommand extends MotionCommandBase, MotionDrawOrder {
|
|
178
178
|
type: 'enter';
|
|
179
179
|
/**
|
|
180
180
|
* Default `fade`. `draw` draws the outline on, then fades the fill in. `pop` scales up past
|
|
@@ -198,7 +198,7 @@ interface MotionEnterCommand extends MotionCommandBase {
|
|
|
198
198
|
orientation?: MotionSplitOrientation;
|
|
199
199
|
}
|
|
200
200
|
/** Takes targets out. */
|
|
201
|
-
interface MotionExitCommand extends MotionCommandBase {
|
|
201
|
+
interface MotionExitCommand extends MotionCommandBase, MotionDrawOrder {
|
|
202
202
|
type: 'exit';
|
|
203
203
|
/** Default `fade`. `wipe` hides the target behind an edge travelling `direction` (a wipe in, reversed). */
|
|
204
204
|
style?: MotionExitStyle;
|
|
@@ -206,9 +206,33 @@ interface MotionExitCommand extends MotionCommandBase {
|
|
|
206
206
|
direction?: MotionDirection;
|
|
207
207
|
distance?: number;
|
|
208
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* How the strokes of a group (or several paths) draw on or off together. Default: all at once,
|
|
211
|
+
* each over the whole time.
|
|
212
|
+
*/
|
|
213
|
+
interface MotionDrawOrder {
|
|
214
|
+
/** `together` (default) or `sequence`: one stroke after another, each for a time in proportion to its length. */
|
|
215
|
+
order?: 'together' | 'sequence';
|
|
216
|
+
/** With `together`: `time` (default) gives every stroke the whole time; `speed` draws them all at one speed, so short ones take less. */
|
|
217
|
+
pace?: 'time' | 'speed';
|
|
218
|
+
/** With `pace: "speed"`: `start` (default) starts them together, `end` finishes them together. */
|
|
219
|
+
align?: 'start' | 'end';
|
|
220
|
+
/** With `sequence`: `document` (default, stacking order) or `distance` from `origin` (a radial reveal). */
|
|
221
|
+
sortBy?: 'document' | 'distance';
|
|
222
|
+
/** With `sortBy: "distance"`: the point (document units) strokes are drawn out from (default the target's centre). */
|
|
223
|
+
origin?: {
|
|
224
|
+
x: number;
|
|
225
|
+
y: number;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
209
228
|
/** Draws a stroke on (or off) between two fractions of its length. */
|
|
210
|
-
interface MotionDrawCommand extends MotionCommandBase {
|
|
229
|
+
interface MotionDrawCommand extends MotionCommandBase, MotionDrawOrder {
|
|
211
230
|
type: 'draw';
|
|
231
|
+
/**
|
|
232
|
+
* A travelling stroke this fraction of the length long (0–1): it runs along the path and off
|
|
233
|
+
* the end, instead of drawing it on and leaving it.
|
|
234
|
+
*/
|
|
235
|
+
comet?: number;
|
|
212
236
|
/** Fraction drawn at the end (default 1). */
|
|
213
237
|
to?: number;
|
|
214
238
|
/** Fraction drawn at the start (default: what is drawn now). */
|
|
@@ -1076,6 +1100,17 @@ interface MotionOverlayOptions {
|
|
|
1076
1100
|
* `motionFrameToSvg`.
|
|
1077
1101
|
*/
|
|
1078
1102
|
declare function motionStageSvg(scene: MotionScene, time: number, options?: MotionSvgOptions & MotionOverlayOptions): string;
|
|
1103
|
+
interface MotionContactSheetOptions extends MotionSvgOptions, MotionOverlayOptions {
|
|
1104
|
+
/** Frames a row (default: about square). */
|
|
1105
|
+
columns?: number;
|
|
1106
|
+
/** Write each frame's time (and shot) under it (default true). */
|
|
1107
|
+
labels?: boolean;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Several moments of the scene in one SVG, in a grid with each frame's time and shot under it:
|
|
1111
|
+
* a contact sheet, to see a whole animation (or an agent's change to it) at a glance.
|
|
1112
|
+
*/
|
|
1113
|
+
declare function motionContactSheetSvg(scene: MotionScene, times: readonly number[], options?: MotionContactSheetOptions): string;
|
|
1079
1114
|
|
|
1080
1115
|
/** Changes shorter than this (ms) are too quick to follow. */
|
|
1081
1116
|
declare const MOTION_MIN_CHANGE_MS = 120;
|
|
@@ -1171,6 +1206,32 @@ type MotionEditResult = {
|
|
|
1171
1206
|
declare function freshShotId(scene: MotionScene, base?: string): string;
|
|
1172
1207
|
/** Applies edits in order, as one change. Fails without changing anything when one fails. */
|
|
1173
1208
|
declare function applyMotionEdits(scene: MotionScene, edits: MotionEdit | readonly MotionEdit[]): MotionEditResult;
|
|
1209
|
+
/** What one edit made, for later edits in a batch to refer to (`"$0.indexes[0]"`). */
|
|
1210
|
+
interface MotionEditOutcome {
|
|
1211
|
+
op: string;
|
|
1212
|
+
/** The shot it changed or added to. */
|
|
1213
|
+
shot?: string;
|
|
1214
|
+
/** Shots it added. */
|
|
1215
|
+
shots?: string[];
|
|
1216
|
+
/** Indexes of the commands it added (or where it moved one). */
|
|
1217
|
+
indexes?: number[];
|
|
1218
|
+
/** The clip it set. */
|
|
1219
|
+
clip?: string;
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Resolves references to earlier edits' outcomes in a batch: a string `"$N.path"` (`$last` for the
|
|
1223
|
+
* one before) is replaced by that value, e.g. `"$0.indexes[0]"` for the index of the first command
|
|
1224
|
+
* edit 0 added; `"$$..."` is a literal `$`. Returns the resolved edits with what each made, or why
|
|
1225
|
+
* a reference does not resolve. Nothing is applied.
|
|
1226
|
+
*/
|
|
1227
|
+
declare function resolveMotionEditRefs(scene: MotionScene, edits: readonly MotionEdit[]): {
|
|
1228
|
+
ok: true;
|
|
1229
|
+
edits: MotionEdit[];
|
|
1230
|
+
outcomes: MotionEditOutcome[];
|
|
1231
|
+
} | {
|
|
1232
|
+
ok: false;
|
|
1233
|
+
error: string;
|
|
1234
|
+
};
|
|
1174
1235
|
/** An empty scene over `artwork`. */
|
|
1175
1236
|
declare function createMotionScene(artwork: VectorDocument, init?: Partial<Omit<MotionScene, 'artwork' | 'version'>>): MotionScene;
|
|
1176
1237
|
|
|
@@ -1674,6 +1735,14 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1674
1735
|
repeat?: number;
|
|
1675
1736
|
repeatMode?: "loop" | "mirror" | "offset";
|
|
1676
1737
|
steps?: number;
|
|
1738
|
+
order?: "together" | "sequence";
|
|
1739
|
+
pace?: "time" | "speed";
|
|
1740
|
+
align?: "start" | "end";
|
|
1741
|
+
sortBy?: "document" | "distance";
|
|
1742
|
+
origin?: {
|
|
1743
|
+
x: number;
|
|
1744
|
+
y: number;
|
|
1745
|
+
};
|
|
1677
1746
|
index: number;
|
|
1678
1747
|
} | {
|
|
1679
1748
|
flairPrimitive?: string | undefined;
|
|
@@ -1693,12 +1762,21 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1693
1762
|
repeat?: number;
|
|
1694
1763
|
repeatMode?: "loop" | "mirror" | "offset";
|
|
1695
1764
|
steps?: number;
|
|
1765
|
+
order?: "together" | "sequence";
|
|
1766
|
+
pace?: "time" | "speed";
|
|
1767
|
+
align?: "start" | "end";
|
|
1768
|
+
sortBy?: "document" | "distance";
|
|
1769
|
+
origin?: {
|
|
1770
|
+
x: number;
|
|
1771
|
+
y: number;
|
|
1772
|
+
};
|
|
1696
1773
|
index: number;
|
|
1697
1774
|
} | {
|
|
1698
1775
|
flairPrimitive?: string | undefined;
|
|
1699
1776
|
start: number;
|
|
1700
1777
|
end: number;
|
|
1701
1778
|
type: "draw";
|
|
1779
|
+
comet?: number;
|
|
1702
1780
|
to?: number;
|
|
1703
1781
|
from?: number;
|
|
1704
1782
|
targets: string[];
|
|
@@ -1711,6 +1789,14 @@ declare function describeMotionShots(scene: MotionScene): {
|
|
|
1711
1789
|
repeat?: number;
|
|
1712
1790
|
repeatMode?: "loop" | "mirror" | "offset";
|
|
1713
1791
|
steps?: number;
|
|
1792
|
+
order?: "together" | "sequence";
|
|
1793
|
+
pace?: "time" | "speed";
|
|
1794
|
+
align?: "start" | "end";
|
|
1795
|
+
sortBy?: "document" | "distance";
|
|
1796
|
+
origin?: {
|
|
1797
|
+
x: number;
|
|
1798
|
+
y: number;
|
|
1799
|
+
};
|
|
1714
1800
|
index: number;
|
|
1715
1801
|
} | {
|
|
1716
1802
|
flairPrimitive?: string | undefined;
|
|
@@ -2060,7 +2146,7 @@ declare function createAnimationEditorToolProvider(controller: AnimationEditorCo
|
|
|
2060
2146
|
* A short authoring guide for a model writing vector animations with the animation editor's
|
|
2061
2147
|
* tools. Static, so it caches well as part of a system prompt.
|
|
2062
2148
|
*/
|
|
2063
|
-
declare const ANIMATION_EDITOR_AGENT_INSTRUCTIONS = "You animate vector artwork. A scene is artwork (vector paths and groups, each with an id) plus shots.\n\nHow it plays\n- Shots play in order. A shot optionally moves the camera, plays its commands, then holds (default 600 ms).\n- Commands in a shot play one after another; give \"with\": \"previous\" to start one together with the command before, \"delay\" to wait, \"stagger\" to offset several targets.\n- Timing comes from the content: each command has a default length (enter 600 ms, move 700 ms, draw follows the path length). Only set \"duration\" to change the pace.\n- Anything that enters later is hidden until it enters. Things that never enter are visible from the start.\n- Every frame is a pure function of time: the same scene always plays the same frames.\n\nCommands\n- enter (fade, pop, grow, slide, draw) and exit (fade, shrink, slide, undraw) bring things in and out.\n- enter also reveals through a clip over the target's box: wipe (behind an edge travelling \"direction\", default right), iris (from the centre; \"shape\": circle or box) and split (from a line through the middle; \"orientation\": horizontal or vertical). exit wipe hides the same way. Reveals need a width and a height: use draw / undraw for a straight line.\n- draw draws strokes on to a fraction; move, rotate, scale and fade change the pose (about the centre); style blends solid colours and stroke width.\n- Reuse motion: set_animation_clip defines a clip (commands targeting \"$\"), and { \"type\": \"play\", \"clip\": name, \"targets\": [...] } plays it on any nodes (with stagger and speed). copy_animation gives other nodes one node's motion.\n- move takes \"via\" waypoints for a curved, smooth path that passes exactly through each point (steady speed by default); use it instead of chaining moves, which stop at each point.\n- enter also has zoom (settles from larger) and rise (rises a short way, overshooting a touch); pop and zoom take a starting \"scale\".\n- morph turns a shape into another node's shape (keep the target hidden); match does the same for a whole group, part by part (Smart Animate: draw the end state as a second, hidden group whose parts share names with the first); follow moves along a path node (with \"rotate\", moves made meanwhile turn with the path).\n- Emphasis draws the eye and returns to rest: pulse (swell), shake (side to side, or \"axis\": \"vertical\"), teeter (rock), wave (bob, no settling), wiggle (seeded wander; the same seed wanders the same way) and color-pulse (tint and back).\n- Emphasis stacks on other motion: a shake during a slide shakes as it slides. Give move, rotate or scale \"blend\": \"add\" to stack them too (what they add stays); \"blend\": \"replace\" makes a change take over instead.\n- Any command but enter and exit can \"repeat\" (loop, mirror back and forth, or offset to carry on: rotate by 90, repeat 4 is a full turn); \"duration\" is one cycle.\n- Springs (\"spring-gentle\", \"spring-quick\", \"spring-bouncy\", \"spring-slow\" or { \"type\": \"spring\", \u2026 }) feel physical; leave \"duration\" out and the spring sets it.\n- To time shots to music or a voiceover: set a \"beat\" grid or \"narration\" word timings with set_animation_settings, read them with get_timing_grid, and give a shot \"at\": { \"beat\": n } or { \"word\": i }. The shot before holds until the cue; check_animation warns when a cue is missed.\n- \"steps\": 12 (on a command, or for the whole scene with set_animation_settings) holds poses \"on twos\" for a hand-drawn look. \"geometric\": true on scale or a camera zooms at an even rate.\n- Commands share their names and defaults with Flair's motion primitives (get_animation shows each one's \"flairPrimitive\"), and emphasis, reveals and follows export to Flair exactly.\n- effect tweens a numeric parameter of a live path effect already on the node (twist angle, wiggle time, zig zag size).\n\nWorking method\n1. get_animation to learn the element ids (set_animation_artwork_svg first if there is no artwork: give every element you will animate an id; or import_flair_effect to start from a Flair effect and edit it).\n2. Plan a few shots, each one idea. Add them with insert_shots (add_commands, update_command, move_command and delete_commands refine a shot), or edit_animation to make several edits as one step (dry_run first when unsure).\n3. To hit a length, fit_animation (keep the shots whose pace matters). check_animation and fix every error and warning; render_animation_frame (shot + \"end\") to look at the result; add onion_skin or motion_paths to see the motion in one picture, or get_motion_path for the numbers.\n- For something the viewer plays (a button, a toggle, a step-by-step explainer), set \"trigger\" with set_animation_settings: click plays the next shot on each click and then starts over (make the last shot put things back for a toggle), hover or press plays and rewinds, scroll scrubs.\n4. To make a reusable Flair effect, set_animation_controls (colour controls stand for every use of their default colour) and export_flair_effect.\n\nKeep motion purposeful: one thing moving at a time reads best, ease-out for arrivals, ease-in for exits, and hold long enough to see each result.";
|
|
2149
|
+
declare const ANIMATION_EDITOR_AGENT_INSTRUCTIONS = "You animate vector artwork. A scene is artwork (vector paths and groups, each with an id) plus shots.\n\nHow it plays\n- Shots play in order. A shot optionally moves the camera, plays its commands, then holds (default 600 ms).\n- Commands in a shot play one after another; give \"with\": \"previous\" to start one together with the command before, \"delay\" to wait, \"stagger\" to offset several targets.\n- Timing comes from the content: each command has a default length (enter 600 ms, move 700 ms, draw follows the path length). Only set \"duration\" to change the pace.\n- Anything that enters later is hidden until it enters. Things that never enter are visible from the start.\n- Every frame is a pure function of time: the same scene always plays the same frames.\n\nCommands\n- enter (fade, pop, grow, slide, draw) and exit (fade, shrink, slide, undraw) bring things in and out.\n- enter also reveals through a clip over the target's box: wipe (behind an edge travelling \"direction\", default right), iris (from the centre; \"shape\": circle or box) and split (from a line through the middle; \"orientation\": horizontal or vertical). exit wipe hides the same way. Reveals need a width and a height: use draw / undraw for a straight line.\n- draw draws strokes on to a fraction; move, rotate, scale and fade change the pose (about the centre); style blends solid colours and stroke width.\n- Drawing a group of strokes: \"order\": \"sequence\" draws them one after another (a signature, a diagram), \"sortBy\": \"distance\" from \"origin\" reveals outward, \"pace\": \"speed\" keeps one speed; draw with \"comet\": 0.2 sends a short stroke along a path and off the end.\n- Reuse motion: set_animation_clip defines a clip (commands targeting \"$\"), and { \"type\": \"play\", \"clip\": name, \"targets\": [...] } plays it on any nodes (with stagger and speed). copy_animation gives other nodes one node's motion.\n- move takes \"via\" waypoints for a curved, smooth path that passes exactly through each point (steady speed by default); use it instead of chaining moves, which stop at each point.\n- enter also has zoom (settles from larger) and rise (rises a short way, overshooting a touch); pop and zoom take a starting \"scale\".\n- morph turns a shape into another node's shape (keep the target hidden); match does the same for a whole group, part by part (Smart Animate: draw the end state as a second, hidden group whose parts share names with the first); follow moves along a path node (with \"rotate\", moves made meanwhile turn with the path).\n- Emphasis draws the eye and returns to rest: pulse (swell), shake (side to side, or \"axis\": \"vertical\"), teeter (rock), wave (bob, no settling), wiggle (seeded wander; the same seed wanders the same way) and color-pulse (tint and back).\n- Emphasis stacks on other motion: a shake during a slide shakes as it slides. Give move, rotate or scale \"blend\": \"add\" to stack them too (what they add stays); \"blend\": \"replace\" makes a change take over instead.\n- Any command but enter and exit can \"repeat\" (loop, mirror back and forth, or offset to carry on: rotate by 90, repeat 4 is a full turn); \"duration\" is one cycle.\n- Springs (\"spring-gentle\", \"spring-quick\", \"spring-bouncy\", \"spring-slow\" or { \"type\": \"spring\", \u2026 }) feel physical; leave \"duration\" out and the spring sets it.\n- To time shots to music or a voiceover: set a \"beat\" grid or \"narration\" word timings with set_animation_settings, read them with get_timing_grid, and give a shot \"at\": { \"beat\": n } or { \"word\": i }. The shot before holds until the cue; check_animation warns when a cue is missed.\n- \"steps\": 12 (on a command, or for the whole scene with set_animation_settings) holds poses \"on twos\" for a hand-drawn look. \"geometric\": true on scale or a camera zooms at an even rate.\n- Commands share their names and defaults with Flair's motion primitives (get_animation shows each one's \"flairPrimitive\"), and emphasis, reveals and follows export to Flair exactly.\n- effect tweens a numeric parameter of a live path effect already on the node (twist angle, wiggle time, zig zag size).\n\nWorking method\n1. get_animation to learn the element ids (set_animation_artwork_svg first if there is no artwork: give every element you will animate an id; or import_flair_effect to start from a Flair effect and edit it).\n2. Plan a few shots, each one idea. Add them with insert_shots (add_commands, update_command, move_command and delete_commands refine a shot), or edit_animation to make several edits as one step (dry_run first when unsure).\n- In edit_animation, a later op can use what an earlier one made: \"$0.indexes[0]\" (the first command op 1 added), \"$last.shot\".\n3. To hit a length, fit_animation (keep the shots whose pace matters). check_animation and fix every error and warning; render_animation_frame (shot + \"end\") to look at the result, or with \"times\" for a contact sheet of several moments; add onion_skin or motion_paths to see the motion in one picture, or get_motion_path for the numbers.\n- For something the viewer plays (a button, a toggle, a step-by-step explainer), set \"trigger\" with set_animation_settings: click plays the next shot on each click and then starts over (make the last shot put things back for a toggle), hover or press plays and rewinds, scroll scrubs.\n4. To make a reusable Flair effect, set_animation_controls (colour controls stand for every use of their default colour) and export_flair_effect.\n\nKeep motion purposeful: one thing moving at a time reads best, ease-out for arrivals, ease-in for exits, and hold long enough to see each result.";
|
|
2064
2150
|
|
|
2065
2151
|
/**
|
|
2066
2152
|
* Helpers for hand-editing UIs (React's and Svelte's command inspector, ease picker, cue picker,
|
|
@@ -2207,4 +2293,4 @@ declare function parseMotionNarration(text: string): {
|
|
|
2207
2293
|
error: string;
|
|
2208
2294
|
};
|
|
2209
2295
|
|
|
2210
|
-
export { ANIMATION_EDITOR_AGENT_INSTRUCTIONS, AnimationEditorController, type AnimationEditorOptions, type AnimationEditorSelection, type AnimationEditorState, type AnimationEditorToolProviderOptions, FLAIR_EASES, FLAIR_EXPORT_VERSION, type FlairEase, type FlairEaseName, type FlairEffectDocument, type FlairEffectOptions, type FlairExportOptions, type FlairImportOptions, type FlairImportResult, type FlairMotionExport, type FlairSpringEase, type FlairSvgAnimation, type FlairSvgMotion, type FlairVectorEffect, type LottieAnimation, type LottieExport, type LottieExportOptions, type LottieKeyframe, type LottieShape, type LottieValue, MOTION_ADDITIVE_PROPERTIES, MOTION_BLENDS, MOTION_CAMERA_MS, MOTION_CLIP_TARGET, MOTION_COMMAND_SCHEMA, MOTION_COMMAND_TYPES, MOTION_DEFAULT_DURATIONS, MOTION_DEFAULT_HOLD, MOTION_DIRECTIONS, MOTION_DRAW_EFFECT_ID, MOTION_DRAW_MS_PER_UNIT, MOTION_DRAW_RANGE, MOTION_EASE_CHOICES, MOTION_EASE_IN_OUT, MOTION_EASE_OUT, MOTION_EDIT_OPS, MOTION_ENTER_STYLES, MOTION_EXIT_STYLES, MOTION_IRIS_SHAPES, MOTION_ISSUE_CODES, MOTION_MIN_CHANGE_MS, MOTION_REPEAT_MODES, MOTION_SPEED_RANGE, MOTION_SPLIT_ORIENTATIONS, MOTION_TRIGGERS, type MotionBeatGrid, type MotionCamera, type MotionClip, type MotionClipItem, type MotionClipShape, type MotionColorPulseCommand, type MotionCommand, type MotionCommandBase, type MotionCommandTiming, type MotionCommandType, type MotionControl, type MotionCue, type MotionDirection, type MotionDrawCommand, type MotionEasingCurve, type MotionEdit, type MotionEditOp, type MotionEditResult, type MotionEffectCommand, type MotionEnterCommand, type MotionEnterStyle, type MotionExitCommand, type MotionExitStyle, type MotionFadeCommand, type MotionFieldInput, type MotionFieldKind, type MotionFieldSpec, type MotionFit, type MotionFitOptions, type MotionFollowCommand, type MotionFrame, type MotionFrameOptions, type MotionGhost, type MotionIrisShape, type MotionIssue, type MotionIssueCode, type MotionIssueSeverity, type MotionMatch, type MotionMatchCommand, type MotionMorphCommand, type MotionMoveCommand, type MotionNarration, type MotionNodeEntry, type MotionOnionSkin, type MotionOverlayOptions, type MotionPath, type MotionPathOptions, type MotionPlayCommand, type MotionPreset, type MotionProperty, type MotionPulseCommand, type MotionRect, type MotionReveal, type MotionRotateCommand, type MotionScaleCommand, type MotionScene, MotionSceneFormatError, type MotionSegment, type MotionShakeCommand, type MotionShot, type MotionShotTiming, type MotionSmoothLeg, type MotionSplitOrientation, type MotionStyleCommand, type MotionSvgOptions, type MotionTeeterCommand, type MotionTimeline, type MotionTrigger, type MotionValue, type MotionWaitCommand, type MotionWaveCommand, type MotionWiggleCommand, activeSegment, applyMotionControlValues, applyMotionEdits, checkMotionScene, clipsShapeProblems, commandShapeProblems, compileMotionScene, createAnimationEditorToolProvider, createMotionScene, defaultMotionCommand, describeMotionElements, describeMotionShots, duplicateMotionCommandEdit, fitMotionRect, fitMotionScene, fitMotionSceneEdits, flairAtLeast, flairCurveFor, flairEaseFor, formatMotionNarration, freshShotId, fromFlairSvgMotion, fromFlairVectorEffect, highlightMotionSvg, indexMotionNodes, interpolateMotionValue, isMotionCommand, isMotionShot, matchMotionNodes, motionAddTrackKey, motionBeatAt, motionBeatTime, motionClipAttrs, motionClipLayout, motionCommandDuration, motionCommandFields, motionCommandRepeat, motionCommandRows, motionCommandSummary, motionCueChoices, motionCueFromKey, motionCueKey, motionCueTime, motionCycleDuration, motionEaseKey, motionEasingCurve, motionEasingGuides, motionEasingPath, motionFieldEdit, motionFieldLabel, motionFlairPrimitive, motionFollowRoute, motionFrameAt, motionFrameToSvg, motionGhosts, motionIssue, motionIssueKey, motionIssueLine, motionMovingIds, motionNodeAtElement, motionNodeClips, motionNodeOffset, motionPath, motionPathLength, motionPathsSvg, motionRestValue, motionRevealClip, motionRevealPadding, motionRulerTicks, motionSceneShapeProblems, motionSceneToJson, motionShotAt, motionShotCueTime, motionShotTimeScale, motionStageSvg, motionTrackKey, namedWithSuggestion, parseMotionFieldInput, parseMotionNarration, parseMotionScene, resolveMotionCamera, segmentProgress, segmentValue, shotShapeProblems, smoothMotionLegs, smoothMotionTimes, suggestName, toFlairEffectDocument, toFlairSvgMotion, toFlairVectorEffect, toLottie, trackValue, withMotionLayers, withViewBox };
|
|
2296
|
+
export { ANIMATION_EDITOR_AGENT_INSTRUCTIONS, AnimationEditorController, type AnimationEditorOptions, type AnimationEditorSelection, type AnimationEditorState, type AnimationEditorToolProviderOptions, FLAIR_EASES, FLAIR_EXPORT_VERSION, type FlairEase, type FlairEaseName, type FlairEffectDocument, type FlairEffectOptions, type FlairExportOptions, type FlairImportOptions, type FlairImportResult, type FlairMotionExport, type FlairSpringEase, type FlairSvgAnimation, type FlairSvgMotion, type FlairVectorEffect, type LottieAnimation, type LottieExport, type LottieExportOptions, type LottieKeyframe, type LottieShape, type LottieValue, MOTION_ADDITIVE_PROPERTIES, MOTION_BLENDS, MOTION_CAMERA_MS, MOTION_CLIP_TARGET, MOTION_COMMAND_SCHEMA, MOTION_COMMAND_TYPES, MOTION_DEFAULT_DURATIONS, MOTION_DEFAULT_HOLD, MOTION_DIRECTIONS, MOTION_DRAW_EFFECT_ID, MOTION_DRAW_MS_PER_UNIT, MOTION_DRAW_RANGE, MOTION_EASE_CHOICES, MOTION_EASE_IN_OUT, MOTION_EASE_OUT, MOTION_EDIT_OPS, MOTION_ENTER_STYLES, MOTION_EXIT_STYLES, MOTION_IRIS_SHAPES, MOTION_ISSUE_CODES, MOTION_MIN_CHANGE_MS, MOTION_REPEAT_MODES, MOTION_SPEED_RANGE, MOTION_SPLIT_ORIENTATIONS, MOTION_TRIGGERS, type MotionBeatGrid, type MotionCamera, type MotionClip, type MotionClipItem, type MotionClipShape, type MotionColorPulseCommand, type MotionCommand, type MotionCommandBase, type MotionCommandTiming, type MotionCommandType, type MotionContactSheetOptions, type MotionControl, type MotionCue, type MotionDirection, type MotionDrawCommand, type MotionDrawOrder, type MotionEasingCurve, type MotionEdit, type MotionEditOp, type MotionEditOutcome, type MotionEditResult, type MotionEffectCommand, type MotionEnterCommand, type MotionEnterStyle, type MotionExitCommand, type MotionExitStyle, type MotionFadeCommand, type MotionFieldInput, type MotionFieldKind, type MotionFieldSpec, type MotionFit, type MotionFitOptions, type MotionFollowCommand, type MotionFrame, type MotionFrameOptions, type MotionGhost, type MotionIrisShape, type MotionIssue, type MotionIssueCode, type MotionIssueSeverity, type MotionMatch, type MotionMatchCommand, type MotionMorphCommand, type MotionMoveCommand, type MotionNarration, type MotionNodeEntry, type MotionOnionSkin, type MotionOverlayOptions, type MotionPath, type MotionPathOptions, type MotionPlayCommand, type MotionPreset, type MotionProperty, type MotionPulseCommand, type MotionRect, type MotionReveal, type MotionRotateCommand, type MotionScaleCommand, type MotionScene, MotionSceneFormatError, type MotionSegment, type MotionShakeCommand, type MotionShot, type MotionShotTiming, type MotionSmoothLeg, type MotionSplitOrientation, type MotionStyleCommand, type MotionSvgOptions, type MotionTeeterCommand, type MotionTimeline, type MotionTrigger, type MotionValue, type MotionWaitCommand, type MotionWaveCommand, type MotionWiggleCommand, activeSegment, applyMotionControlValues, applyMotionEdits, checkMotionScene, clipsShapeProblems, commandShapeProblems, compileMotionScene, createAnimationEditorToolProvider, createMotionScene, defaultMotionCommand, describeMotionElements, describeMotionShots, duplicateMotionCommandEdit, fitMotionRect, fitMotionScene, fitMotionSceneEdits, flairAtLeast, flairCurveFor, flairEaseFor, formatMotionNarration, freshShotId, fromFlairSvgMotion, fromFlairVectorEffect, highlightMotionSvg, indexMotionNodes, interpolateMotionValue, isMotionCommand, isMotionShot, matchMotionNodes, motionAddTrackKey, motionBeatAt, motionBeatTime, motionClipAttrs, motionClipLayout, motionCommandDuration, motionCommandFields, motionCommandRepeat, motionCommandRows, motionCommandSummary, motionContactSheetSvg, motionCueChoices, motionCueFromKey, motionCueKey, motionCueTime, motionCycleDuration, motionEaseKey, motionEasingCurve, motionEasingGuides, motionEasingPath, motionFieldEdit, motionFieldLabel, motionFlairPrimitive, motionFollowRoute, motionFrameAt, motionFrameToSvg, motionGhosts, motionIssue, motionIssueKey, motionIssueLine, motionMovingIds, motionNodeAtElement, motionNodeClips, motionNodeOffset, motionPath, motionPathLength, motionPathsSvg, motionRestValue, motionRevealClip, motionRevealPadding, motionRulerTicks, motionSceneShapeProblems, motionSceneToJson, motionShotAt, motionShotCueTime, motionShotTimeScale, motionStageSvg, motionTrackKey, namedWithSuggestion, parseMotionFieldInput, parseMotionNarration, parseMotionScene, resolveMotionCamera, resolveMotionEditRefs, segmentProgress, segmentValue, shotShapeProblems, smoothMotionLegs, smoothMotionTimes, suggestName, toFlairEffectDocument, toFlairSvgMotion, toFlairVectorEffect, toLottie, trackValue, withMotionLayers, withViewBox };
|