pixi-effects 0.1.0 → 0.3.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 +31 -0
- package/README.md +117 -7
- package/ai/SKILL.md +44 -0
- package/ai/reference/cheatsheet.md +120 -0
- package/ai/reference/pitfalls.md +54 -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-BDw6dKRB.d.cts +92 -0
- package/dist/Base-Ba4Ta4ap.d.ts +92 -0
- package/dist/Composition-6FDH5OPM.cjs +13 -0
- package/dist/Composition-6FDH5OPM.cjs.map +1 -0
- package/dist/Composition-FEYAUMFI.js +4 -0
- package/dist/Composition-FEYAUMFI.js.map +1 -0
- package/dist/Controller.d.cts +2 -1
- package/dist/Controller.d.ts +2 -1
- package/dist/Movie-DMpaT67V.d.ts +179 -0
- package/dist/Movie-W8ISiEBB.d.cts +179 -0
- package/dist/chunk-DIJG2RSF.js +370 -0
- package/dist/chunk-DIJG2RSF.js.map +1 -0
- package/dist/chunk-PN5A6QA7.js +2031 -0
- package/dist/chunk-PN5A6QA7.js.map +1 -0
- package/dist/chunk-SIRVULFF.cjs +2049 -0
- package/dist/chunk-SIRVULFF.cjs.map +1 -0
- package/dist/chunk-ZL262ZRM.cjs +372 -0
- package/dist/chunk-ZL262ZRM.cjs.map +1 -0
- package/dist/index.cjs +371 -1798
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +95 -24
- package/dist/index.d.ts +95 -24
- package/dist/index.js +364 -1796
- package/dist/index.js.map +1 -1
- package/dist/three.cjs +161 -0
- package/dist/three.cjs.map +1 -0
- package/dist/three.d.cts +79 -0
- package/dist/three.d.ts +79 -0
- package/dist/three.js +157 -0
- package/dist/three.js.map +1 -0
- package/dist/{Movie-Bp66rkaC.d.cts → types-3c8Vymgw.d.cts} +84 -81
- package/dist/{Movie-Bp66rkaC.d.ts → types-3c8Vymgw.d.ts} +84 -81
- package/docs/api.md +333 -0
- package/docs/dsl.md +1017 -0
- package/llms-full.txt +1966 -0
- package/llms.txt +30 -0
- package/package.json +19 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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-W8ISiEBB.cjs';
|
|
2
|
+
import { S as Sequence } from './Base-BDw6dKRB.cjs';
|
|
3
|
+
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, b as SequenceCommon } from './types-3c8Vymgw.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-3c8Vymgw.cjs';
|
|
3
5
|
import 'pixi.js';
|
|
4
6
|
import 'gsap';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* - `scale` : zoom in or out around an arbitrary 9-point pivot.
|
|
13
|
-
* - `rotation` : gentle rotation while keeping the image filling the
|
|
14
|
-
* canvas (the scale is over-set so even at the steepest
|
|
15
|
-
* rotation the bounding box still covers).
|
|
16
|
-
* - `position` : pan the image between two points within its over-scaled
|
|
17
|
-
* bounds (corner-to-corner by default).
|
|
18
|
-
*
|
|
19
|
-
* The image fits the canvas by `cover` (default) or `contain` — both
|
|
20
|
-
* computed at runtime from the texture's intrinsic size, so you don't pass
|
|
21
|
-
* `imageWidth` / `imageHeight`. Position keyframes assume the image is
|
|
22
|
-
* anchored at its centre (anchor 0.5/0.5).
|
|
23
|
-
*
|
|
24
|
-
* Note: this preset emits no fade keyframes; pair it with `crossfade` /
|
|
25
|
-
* `dip` / etc. transitions to chain images.
|
|
26
|
-
*/
|
|
8
|
+
type SequenceCtor = {
|
|
9
|
+
new (spec: SequenceSpec, parent: CompositionShape | null, root: CompositionShape): Sequence;
|
|
10
|
+
};
|
|
11
|
+
/** Register an external sequence type. Later registrations overwrite earlier ones. */
|
|
12
|
+
declare function registerSequenceType(type: string, ctor: SequenceCtor): void;
|
|
13
|
+
|
|
27
14
|
type KenBurnsOptions = KenBurnsBase & ({
|
|
28
15
|
motion: 'still';
|
|
29
16
|
} | KenBurnsScale | KenBurnsRotation | KenBurnsPosition);
|
|
@@ -76,4 +63,88 @@ interface KenBurnsPosition {
|
|
|
76
63
|
}
|
|
77
64
|
declare function kenBurns(opts: KenBurnsOptions): ImageSequenceSpec;
|
|
78
65
|
|
|
79
|
-
|
|
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
|
+
|
|
116
|
+
interface WithFadeOptions {
|
|
117
|
+
/** Fade-in duration (seconds), at the start of the sequence. */
|
|
118
|
+
in?: number;
|
|
119
|
+
/** Fade-out duration (seconds), ending at the end of the sequence. Requires `duration` to be set on the spec. */
|
|
120
|
+
out?: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Add alpha fade-in / fade-out keyframes to a sequence spec. Mutates and
|
|
124
|
+
* returns the spec so the result can be dropped straight into `sequences[]`.
|
|
125
|
+
*
|
|
126
|
+
* ```ts
|
|
127
|
+
* sequences: [
|
|
128
|
+
* withFade(
|
|
129
|
+
* kenBurns({ asset: 'p', at: 0, duration: 6, motion: 'scale' }),
|
|
130
|
+
* { in: 0.5, out: 0.5 },
|
|
131
|
+
* ),
|
|
132
|
+
*
|
|
133
|
+
* withFade(
|
|
134
|
+
* { type: 'text', text: 'hi', at: 5, duration: 3, initial: { x: 'GW/2' } },
|
|
135
|
+
* { in: 0.4 },
|
|
136
|
+
* ),
|
|
137
|
+
* ]
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* The added keyframes are layered on top of any keyframes the spec already
|
|
141
|
+
* has — kenBurns's scale / position / rotation tweens keep working.
|
|
142
|
+
*
|
|
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.
|
|
147
|
+
*/
|
|
148
|
+
declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
|
|
149
|
+
|
|
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,29 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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-DMpaT67V.js';
|
|
2
|
+
import { S as Sequence } from './Base-Ba4Ta4ap.js';
|
|
3
|
+
import { S as SequenceSpec, C as CompositionShape, I as ImageSequenceSpec, a as CameraSequenceSpec, b as SequenceCommon } from './types-3c8Vymgw.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-3c8Vymgw.js';
|
|
3
5
|
import 'pixi.js';
|
|
4
6
|
import 'gsap';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* - `scale` : zoom in or out around an arbitrary 9-point pivot.
|
|
13
|
-
* - `rotation` : gentle rotation while keeping the image filling the
|
|
14
|
-
* canvas (the scale is over-set so even at the steepest
|
|
15
|
-
* rotation the bounding box still covers).
|
|
16
|
-
* - `position` : pan the image between two points within its over-scaled
|
|
17
|
-
* bounds (corner-to-corner by default).
|
|
18
|
-
*
|
|
19
|
-
* The image fits the canvas by `cover` (default) or `contain` — both
|
|
20
|
-
* computed at runtime from the texture's intrinsic size, so you don't pass
|
|
21
|
-
* `imageWidth` / `imageHeight`. Position keyframes assume the image is
|
|
22
|
-
* anchored at its centre (anchor 0.5/0.5).
|
|
23
|
-
*
|
|
24
|
-
* Note: this preset emits no fade keyframes; pair it with `crossfade` /
|
|
25
|
-
* `dip` / etc. transitions to chain images.
|
|
26
|
-
*/
|
|
8
|
+
type SequenceCtor = {
|
|
9
|
+
new (spec: SequenceSpec, parent: CompositionShape | null, root: CompositionShape): Sequence;
|
|
10
|
+
};
|
|
11
|
+
/** Register an external sequence type. Later registrations overwrite earlier ones. */
|
|
12
|
+
declare function registerSequenceType(type: string, ctor: SequenceCtor): void;
|
|
13
|
+
|
|
27
14
|
type KenBurnsOptions = KenBurnsBase & ({
|
|
28
15
|
motion: 'still';
|
|
29
16
|
} | KenBurnsScale | KenBurnsRotation | KenBurnsPosition);
|
|
@@ -76,4 +63,88 @@ interface KenBurnsPosition {
|
|
|
76
63
|
}
|
|
77
64
|
declare function kenBurns(opts: KenBurnsOptions): ImageSequenceSpec;
|
|
78
65
|
|
|
79
|
-
|
|
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
|
+
|
|
116
|
+
interface WithFadeOptions {
|
|
117
|
+
/** Fade-in duration (seconds), at the start of the sequence. */
|
|
118
|
+
in?: number;
|
|
119
|
+
/** Fade-out duration (seconds), ending at the end of the sequence. Requires `duration` to be set on the spec. */
|
|
120
|
+
out?: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Add alpha fade-in / fade-out keyframes to a sequence spec. Mutates and
|
|
124
|
+
* returns the spec so the result can be dropped straight into `sequences[]`.
|
|
125
|
+
*
|
|
126
|
+
* ```ts
|
|
127
|
+
* sequences: [
|
|
128
|
+
* withFade(
|
|
129
|
+
* kenBurns({ asset: 'p', at: 0, duration: 6, motion: 'scale' }),
|
|
130
|
+
* { in: 0.5, out: 0.5 },
|
|
131
|
+
* ),
|
|
132
|
+
*
|
|
133
|
+
* withFade(
|
|
134
|
+
* { type: 'text', text: 'hi', at: 5, duration: 3, initial: { x: 'GW/2' } },
|
|
135
|
+
* { in: 0.4 },
|
|
136
|
+
* ),
|
|
137
|
+
* ]
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* The added keyframes are layered on top of any keyframes the spec already
|
|
141
|
+
* has — kenBurns's scale / position / rotation tweens keep working.
|
|
142
|
+
*
|
|
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.
|
|
147
|
+
*/
|
|
148
|
+
declare function withFade<T extends SequenceCommon>(spec: T, opts: WithFadeOptions): T;
|
|
149
|
+
|
|
150
|
+
export { CameraSequenceSpec, ImageSequenceSpec, type KenBurnsOptions, type OrbitOptions, SequenceCommon, type SequenceCtor, SequenceSpec, type WithFadeOptions, kenBurns, orbit, registerSequenceType, withFade };
|