pixi-effects 0.2.0 → 0.4.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/CHANGELOG.md +55 -0
- package/README.md +16 -6
- package/ai/SKILL.md +46 -0
- package/ai/reference/cheatsheet.md +121 -0
- package/ai/reference/pitfalls.md +75 -0
- package/ai/reference/recipes.md +375 -0
- package/ai/template.html +82 -0
- package/ai/tools/save-image.py +24 -0
- package/dist/{Base-Bh_VSusi.d.ts → Base-5R7C5pHR.d.cts} +7 -1
- package/dist/{Base-B1Tdn0Cv.d.cts → Base-DhY9oMxr.d.ts} +7 -1
- package/dist/Composition-D7RCAGEA.cjs +13 -0
- package/dist/{Composition-BI5HZJFL.cjs.map → Composition-D7RCAGEA.cjs.map} +1 -1
- package/dist/Composition-RGTRZ2JX.js +4 -0
- package/dist/{Composition-IO7ZN32J.js.map → Composition-RGTRZ2JX.js.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/Movie-CghFXprP.d.cts +179 -0
- package/dist/Movie-DRZtIGU7.d.ts +179 -0
- package/dist/{chunk-7OIWYXGV.cjs → chunk-6BQ6IEW2.cjs} +363 -91
- package/dist/chunk-6BQ6IEW2.cjs.map +1 -0
- package/dist/{chunk-H55V3U56.js → chunk-A574IA4F.js} +68 -13
- package/dist/chunk-A574IA4F.js.map +1 -0
- package/dist/{chunk-64IHCYYN.cjs → chunk-QGBOC5YL.cjs} +76 -21
- package/dist/chunk-QGBOC5YL.cjs.map +1 -0
- package/dist/{chunk-VJCDG6YG.js → chunk-ZQX7WIYL.js} +359 -93
- package/dist/chunk-ZQX7WIYL.js.map +1 -0
- package/dist/index.cjs +366 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -31
- package/dist/index.d.ts +61 -31
- package/dist/index.js +363 -22
- package/dist/index.js.map +1 -1
- package/dist/three.cjs +5 -5
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +1 -1
- package/dist/{types-CNBilhpz.d.cts → types-CRE9WKd4.d.cts} +59 -6
- package/dist/{types-CNBilhpz.d.ts → types-CRE9WKd4.d.ts} +59 -6
- package/docs/api.md +333 -0
- package/docs/dsl.md +1028 -0
- package/llms-full.txt +2001 -0
- package/llms.txt +30 -0
- package/package.json +5 -3
- package/dist/Composition-BI5HZJFL.cjs +0 -13
- package/dist/Composition-IO7ZN32J.js +0 -4
- package/dist/Movie-CcR6h2jO.d.cts +0 -82
- package/dist/Movie-D-n8glA6.d.ts +0 -82
- package/dist/chunk-64IHCYYN.cjs.map +0 -1
- package/dist/chunk-7OIWYXGV.cjs.map +0 -1
- package/dist/chunk-H55V3U56.js.map +0 -1
- package/dist/chunk-VJCDG6YG.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { F as FrameEvent, M as Movie,
|
|
2
|
-
import { S as Sequence } from './Base-
|
|
3
|
-
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as SequenceCommon } from './types-
|
|
4
|
-
export { A as AssetSpec,
|
|
1
|
+
export { C as ContactSheetOptions, F as FrameEvent, I as InspectOptions, a as InspectReport, L as LayerInfo, M as Movie, b as MovieOptions, P as ProgressEvent, R as RenderOptions, S as SnapshotOptions } from './Movie-CghFXprP.cjs';
|
|
2
|
+
import { S as Sequence } from './Base-5R7C5pHR.cjs';
|
|
3
|
+
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, b as SequenceCommon } from './types-CRE9WKd4.cjs';
|
|
4
|
+
export { A as AssetSpec, c as AudioSequenceSpec, d as ChromaKeyFilterSpec, e as CircleShapeSpec, f as CompositionSequenceSpec, g as CompositionSpec, h as CrossfadeTransition, i as CustomFilterSpec, D as DipTransition, j as DissolveTransition, E as EllipseShapeSpec, k as Expr, F as FilterSpec, G as GradientSpec, l as IrisTransition, K as Keyframe, L as LineShapeSpec, P as PathShapeSpec, m as PolygonShapeSpec, n as PropValue, o as Props, R as RectShapeSpec, p as ShapeSequenceSpec, q as SlideTransition, T as TextSequenceSpec, r as TransitionCommon, s as TransitionSpec, V as VideoSequenceSpec, W as WipeTransition, Z as ZoomTransition } from './types-CRE9WKd4.cjs';
|
|
5
5
|
import 'pixi.js';
|
|
6
6
|
import 'gsap';
|
|
7
7
|
|
|
@@ -11,27 +11,6 @@ type SequenceCtor = {
|
|
|
11
11
|
/** Register an external sequence type. Later registrations overwrite earlier ones. */
|
|
12
12
|
declare function registerSequenceType(type: string, ctor: SequenceCtor): void;
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Ken Burns preset for a single image. Returns an `ImageSequenceSpec` ready
|
|
16
|
-
* to drop into a composition's `sequences[]`.
|
|
17
|
-
*
|
|
18
|
-
* Four motion modes:
|
|
19
|
-
* - `still` : just sit at the canvas centre, fitted but unanimated.
|
|
20
|
-
* - `scale` : zoom in or out around an arbitrary 9-point pivot.
|
|
21
|
-
* - `rotation` : gentle rotation while keeping the image filling the
|
|
22
|
-
* canvas (the scale is over-set so even at the steepest
|
|
23
|
-
* rotation the bounding box still covers).
|
|
24
|
-
* - `position` : pan the image between two points within its over-scaled
|
|
25
|
-
* bounds (corner-to-corner by default).
|
|
26
|
-
*
|
|
27
|
-
* The image fits the canvas by `cover` (default) or `contain` — both
|
|
28
|
-
* computed at runtime from the texture's intrinsic size, so you don't pass
|
|
29
|
-
* `imageWidth` / `imageHeight`. Position keyframes assume the image is
|
|
30
|
-
* anchored at its centre (anchor 0.5/0.5).
|
|
31
|
-
*
|
|
32
|
-
* Note: this preset emits no fade keyframes; pair it with `crossfade` /
|
|
33
|
-
* `dip` / etc. transitions to chain images.
|
|
34
|
-
*/
|
|
35
14
|
type KenBurnsOptions = KenBurnsBase & ({
|
|
36
15
|
motion: 'still';
|
|
37
16
|
} | KenBurnsScale | KenBurnsRotation | KenBurnsPosition);
|
|
@@ -84,10 +63,60 @@ interface KenBurnsPosition {
|
|
|
84
63
|
}
|
|
85
64
|
declare function kenBurns(opts: KenBurnsOptions): ImageSequenceSpec;
|
|
86
65
|
|
|
66
|
+
interface OrbitOptions {
|
|
67
|
+
/** Length of the move in seconds. Required, > 0. */
|
|
68
|
+
duration: number;
|
|
69
|
+
/** Total sweep in degrees (negative = the other way). The camera passes straight-ahead (angle 0) in the middle when `start` is left at its default. */
|
|
70
|
+
degrees: number;
|
|
71
|
+
/** Angle the move starts at, in degrees (0 = straight in front of the centre). Default `-degrees / 2`. */
|
|
72
|
+
start?: number;
|
|
73
|
+
/** Distance from the centre. Default: the default camera distance for `height` and `fov` (so `z = 0` is 1:1 at angle 0). */
|
|
74
|
+
radius?: number;
|
|
75
|
+
/** The point to circle around and look at, in composition pixels. Default: the centre of `width` × `height`. */
|
|
76
|
+
center?: [number, number];
|
|
77
|
+
/** Composition size, used for the default `center` and `radius`. Default 1280 × 720. */
|
|
78
|
+
width?: number;
|
|
79
|
+
height?: number;
|
|
80
|
+
/** Vertical field of view, degrees. Default 40. Written to the camera. */
|
|
81
|
+
fov?: number;
|
|
82
|
+
/** Easing of the sweep as a whole (any GSAP ease). Default `'sine.inOut'`. */
|
|
83
|
+
ease?: string;
|
|
84
|
+
/**
|
|
85
|
+
* A dolly zoom while orbiting: `fov` animates from `from` to `to` (degrees) and the radius follows it
|
|
86
|
+
* (`R = (height/2) / tan(fov/2)`), so the `z = 0` plane keeps its size while the perspective changes.
|
|
87
|
+
* Cannot be combined with `radius`. `ease` defaults to the sweep's ease.
|
|
88
|
+
*/
|
|
89
|
+
dollyZoom?: {
|
|
90
|
+
from: number;
|
|
91
|
+
to: number;
|
|
92
|
+
ease?: string;
|
|
93
|
+
};
|
|
94
|
+
/** Start time in seconds (composition time, like any layer). */
|
|
95
|
+
at?: number;
|
|
96
|
+
name?: string;
|
|
97
|
+
/** Sampling density. Default one segment per 0.1 s. */
|
|
98
|
+
stepsPerSecond?: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A camera that orbits a point. There is no per-frame expression in the DSL, so the circle is sampled
|
|
102
|
+
* into short linear keyframes (the easing is applied to the angle). Drop the result into `sequences[]`
|
|
103
|
+
* next to `threeD` layers.
|
|
104
|
+
*
|
|
105
|
+
* ```ts
|
|
106
|
+
* orbit({ duration: 6, degrees: 40 }) // sweep ±20° around the centre
|
|
107
|
+
* orbit({ duration: 4, degrees: 90, start: 0, radius: 900 })
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* `z` is specified, so it no longer follows `fov`. For a dolly zoom WHILE orbiting pass
|
|
111
|
+
* `dollyZoom: { from: 38, to: 64 }`: `fov` animates and the radius follows it (`z = (H/2) / tan(fov/2)`),
|
|
112
|
+
* keeping the `z = 0` plane the same size.
|
|
113
|
+
*/
|
|
114
|
+
declare function orbit(opts: OrbitOptions): CameraSequenceSpec;
|
|
115
|
+
|
|
87
116
|
interface WithFadeOptions {
|
|
88
|
-
/** Fade-in duration (seconds),
|
|
117
|
+
/** Fade-in duration (seconds), at the start of the sequence. */
|
|
89
118
|
in?: number;
|
|
90
|
-
/** Fade-out duration (seconds),
|
|
119
|
+
/** Fade-out duration (seconds), ending at the end of the sequence. Requires `duration` to be set on the spec. */
|
|
91
120
|
out?: number;
|
|
92
121
|
}
|
|
93
122
|
/**
|
|
@@ -111,10 +140,11 @@ interface WithFadeOptions {
|
|
|
111
140
|
* The added keyframes are layered on top of any keyframes the spec already
|
|
112
141
|
* has — kenBurns's scale / position / rotation tweens keep working.
|
|
113
142
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* spec sits directly under the root composition or nested inside
|
|
143
|
+
* Keyframe `at` is sequence-local: the fade-in starts at 0 and the fade-out
|
|
144
|
+
* at `duration - out`, whatever the sequence's own `at` is. Works the same
|
|
145
|
+
* whether the spec sits directly under the root composition or nested inside
|
|
146
|
+
* another.
|
|
117
147
|
*/
|
|
118
148
|
declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
|
|
119
149
|
|
|
120
|
-
export { ImageSequenceSpec, type KenBurnsOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type WithFadeOptions, kenBurns, registerSequenceType, withFade };
|
|
150
|
+
export { CameraSequenceSpec, ImageSequenceSpec, type KenBurnsOptions, type OrbitOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type WithFadeOptions, kenBurns, orbit, registerSequenceType, withFade };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { F as FrameEvent, M as Movie,
|
|
2
|
-
import { S as Sequence } from './Base-
|
|
3
|
-
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as SequenceCommon } from './types-
|
|
4
|
-
export { A as AssetSpec,
|
|
1
|
+
export { C as ContactSheetOptions, F as FrameEvent, I as InspectOptions, a as InspectReport, L as LayerInfo, M as Movie, b as MovieOptions, P as ProgressEvent, R as RenderOptions, S as SnapshotOptions } from './Movie-DRZtIGU7.js';
|
|
2
|
+
import { S as Sequence } from './Base-DhY9oMxr.js';
|
|
3
|
+
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, b as SequenceCommon } from './types-CRE9WKd4.js';
|
|
4
|
+
export { A as AssetSpec, c as AudioSequenceSpec, d as ChromaKeyFilterSpec, e as CircleShapeSpec, f as CompositionSequenceSpec, g as CompositionSpec, h as CrossfadeTransition, i as CustomFilterSpec, D as DipTransition, j as DissolveTransition, E as EllipseShapeSpec, k as Expr, F as FilterSpec, G as GradientSpec, l as IrisTransition, K as Keyframe, L as LineShapeSpec, P as PathShapeSpec, m as PolygonShapeSpec, n as PropValue, o as Props, R as RectShapeSpec, p as ShapeSequenceSpec, q as SlideTransition, T as TextSequenceSpec, r as TransitionCommon, s as TransitionSpec, V as VideoSequenceSpec, W as WipeTransition, Z as ZoomTransition } from './types-CRE9WKd4.js';
|
|
5
5
|
import 'pixi.js';
|
|
6
6
|
import 'gsap';
|
|
7
7
|
|
|
@@ -11,27 +11,6 @@ type SequenceCtor = {
|
|
|
11
11
|
/** Register an external sequence type. Later registrations overwrite earlier ones. */
|
|
12
12
|
declare function registerSequenceType(type: string, ctor: SequenceCtor): void;
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Ken Burns preset for a single image. Returns an `ImageSequenceSpec` ready
|
|
16
|
-
* to drop into a composition's `sequences[]`.
|
|
17
|
-
*
|
|
18
|
-
* Four motion modes:
|
|
19
|
-
* - `still` : just sit at the canvas centre, fitted but unanimated.
|
|
20
|
-
* - `scale` : zoom in or out around an arbitrary 9-point pivot.
|
|
21
|
-
* - `rotation` : gentle rotation while keeping the image filling the
|
|
22
|
-
* canvas (the scale is over-set so even at the steepest
|
|
23
|
-
* rotation the bounding box still covers).
|
|
24
|
-
* - `position` : pan the image between two points within its over-scaled
|
|
25
|
-
* bounds (corner-to-corner by default).
|
|
26
|
-
*
|
|
27
|
-
* The image fits the canvas by `cover` (default) or `contain` — both
|
|
28
|
-
* computed at runtime from the texture's intrinsic size, so you don't pass
|
|
29
|
-
* `imageWidth` / `imageHeight`. Position keyframes assume the image is
|
|
30
|
-
* anchored at its centre (anchor 0.5/0.5).
|
|
31
|
-
*
|
|
32
|
-
* Note: this preset emits no fade keyframes; pair it with `crossfade` /
|
|
33
|
-
* `dip` / etc. transitions to chain images.
|
|
34
|
-
*/
|
|
35
14
|
type KenBurnsOptions = KenBurnsBase & ({
|
|
36
15
|
motion: 'still';
|
|
37
16
|
} | KenBurnsScale | KenBurnsRotation | KenBurnsPosition);
|
|
@@ -84,10 +63,60 @@ interface KenBurnsPosition {
|
|
|
84
63
|
}
|
|
85
64
|
declare function kenBurns(opts: KenBurnsOptions): ImageSequenceSpec;
|
|
86
65
|
|
|
66
|
+
interface OrbitOptions {
|
|
67
|
+
/** Length of the move in seconds. Required, > 0. */
|
|
68
|
+
duration: number;
|
|
69
|
+
/** Total sweep in degrees (negative = the other way). The camera passes straight-ahead (angle 0) in the middle when `start` is left at its default. */
|
|
70
|
+
degrees: number;
|
|
71
|
+
/** Angle the move starts at, in degrees (0 = straight in front of the centre). Default `-degrees / 2`. */
|
|
72
|
+
start?: number;
|
|
73
|
+
/** Distance from the centre. Default: the default camera distance for `height` and `fov` (so `z = 0` is 1:1 at angle 0). */
|
|
74
|
+
radius?: number;
|
|
75
|
+
/** The point to circle around and look at, in composition pixels. Default: the centre of `width` × `height`. */
|
|
76
|
+
center?: [number, number];
|
|
77
|
+
/** Composition size, used for the default `center` and `radius`. Default 1280 × 720. */
|
|
78
|
+
width?: number;
|
|
79
|
+
height?: number;
|
|
80
|
+
/** Vertical field of view, degrees. Default 40. Written to the camera. */
|
|
81
|
+
fov?: number;
|
|
82
|
+
/** Easing of the sweep as a whole (any GSAP ease). Default `'sine.inOut'`. */
|
|
83
|
+
ease?: string;
|
|
84
|
+
/**
|
|
85
|
+
* A dolly zoom while orbiting: `fov` animates from `from` to `to` (degrees) and the radius follows it
|
|
86
|
+
* (`R = (height/2) / tan(fov/2)`), so the `z = 0` plane keeps its size while the perspective changes.
|
|
87
|
+
* Cannot be combined with `radius`. `ease` defaults to the sweep's ease.
|
|
88
|
+
*/
|
|
89
|
+
dollyZoom?: {
|
|
90
|
+
from: number;
|
|
91
|
+
to: number;
|
|
92
|
+
ease?: string;
|
|
93
|
+
};
|
|
94
|
+
/** Start time in seconds (composition time, like any layer). */
|
|
95
|
+
at?: number;
|
|
96
|
+
name?: string;
|
|
97
|
+
/** Sampling density. Default one segment per 0.1 s. */
|
|
98
|
+
stepsPerSecond?: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A camera that orbits a point. There is no per-frame expression in the DSL, so the circle is sampled
|
|
102
|
+
* into short linear keyframes (the easing is applied to the angle). Drop the result into `sequences[]`
|
|
103
|
+
* next to `threeD` layers.
|
|
104
|
+
*
|
|
105
|
+
* ```ts
|
|
106
|
+
* orbit({ duration: 6, degrees: 40 }) // sweep ±20° around the centre
|
|
107
|
+
* orbit({ duration: 4, degrees: 90, start: 0, radius: 900 })
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* `z` is specified, so it no longer follows `fov`. For a dolly zoom WHILE orbiting pass
|
|
111
|
+
* `dollyZoom: { from: 38, to: 64 }`: `fov` animates and the radius follows it (`z = (H/2) / tan(fov/2)`),
|
|
112
|
+
* keeping the `z = 0` plane the same size.
|
|
113
|
+
*/
|
|
114
|
+
declare function orbit(opts: OrbitOptions): CameraSequenceSpec;
|
|
115
|
+
|
|
87
116
|
interface WithFadeOptions {
|
|
88
|
-
/** Fade-in duration (seconds),
|
|
117
|
+
/** Fade-in duration (seconds), at the start of the sequence. */
|
|
89
118
|
in?: number;
|
|
90
|
-
/** Fade-out duration (seconds),
|
|
119
|
+
/** Fade-out duration (seconds), ending at the end of the sequence. Requires `duration` to be set on the spec. */
|
|
91
120
|
out?: number;
|
|
92
121
|
}
|
|
93
122
|
/**
|
|
@@ -111,10 +140,11 @@ interface WithFadeOptions {
|
|
|
111
140
|
* The added keyframes are layered on top of any keyframes the spec already
|
|
112
141
|
* has — kenBurns's scale / position / rotation tweens keep working.
|
|
113
142
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* spec sits directly under the root composition or nested inside
|
|
143
|
+
* Keyframe `at` is sequence-local: the fade-in starts at 0 and the fade-out
|
|
144
|
+
* at `duration - out`, whatever the sequence's own `at` is. Works the same
|
|
145
|
+
* whether the spec sits directly under the root composition or nested inside
|
|
146
|
+
* another.
|
|
117
147
|
*/
|
|
118
148
|
declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
|
|
119
149
|
|
|
120
|
-
export { ImageSequenceSpec, type KenBurnsOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type WithFadeOptions, kenBurns, registerSequenceType, withFade };
|
|
150
|
+
export { CameraSequenceSpec, ImageSequenceSpec, type KenBurnsOptions, type OrbitOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type WithFadeOptions, kenBurns, orbit, registerSequenceType, withFade };
|