pixi-effects 0.31.0 → 0.33.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 +29 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/lookup.mjs +29 -6
- package/ai/tools/pixi-effects.mjs +1 -1
- package/ai/tools/render.mjs +19 -2
- package/dist/{Base-jRiMHcWT.d.ts → Base-CXsMdmJB.d.ts} +1 -1
- package/dist/{Base-BKagtWc0.d.cts → Base-pNq6sVGl.d.cts} +1 -1
- package/dist/Composition-7XNPTM7L.js +7 -0
- package/dist/{Composition-DQCPJPFE.js.map → Composition-7XNPTM7L.js.map} +1 -1
- package/dist/Composition-L6OALWHI.cjs +16 -0
- package/dist/{Composition-V2XYSW6P.cjs.map → Composition-L6OALWHI.cjs.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/{Movie-BH81stkb.d.cts → Movie-CL6SsAWe.d.cts} +1 -1
- package/dist/{Movie-CfFPItoL.d.ts → Movie-f0tQG9y5.d.ts} +1 -1
- package/dist/Spans-KPZ2QDCN.js +53 -0
- package/dist/Spans-KPZ2QDCN.js.map +1 -0
- package/dist/Spans-VXNQXSI3.cjs +55 -0
- package/dist/Spans-VXNQXSI3.cjs.map +1 -0
- package/dist/{blendModes-RIVZXL5A.js → blendModes-PP5NPBXY.js} +4 -4
- package/dist/{blendModes-RIVZXL5A.js.map → blendModes-PP5NPBXY.js.map} +1 -1
- package/dist/{blendModes-ETMYWATF.cjs → blendModes-WIUCYIMC.cjs} +5 -5
- package/dist/{blendModes-ETMYWATF.cjs.map → blendModes-WIUCYIMC.cjs.map} +1 -1
- package/dist/{chunk-BGMCZA36.js → chunk-BMH4OCDX.js} +6 -6
- package/dist/chunk-BMH4OCDX.js.map +1 -0
- package/dist/{chunk-DJ5B7IKT.cjs → chunk-BVMZUPDU.cjs} +1379 -1161
- package/dist/chunk-BVMZUPDU.cjs.map +1 -0
- package/dist/{chunk-MMTESMJ5.js → chunk-E53QWHBK.js} +1363 -1151
- package/dist/chunk-E53QWHBK.js.map +1 -0
- package/dist/{chunk-LYOKH7KE.cjs → chunk-GL2AQFLQ.cjs} +57 -6
- package/dist/chunk-GL2AQFLQ.cjs.map +1 -0
- package/dist/{chunk-2DXPTKQZ.cjs → chunk-IMQJVRMT.cjs} +5 -5
- package/dist/{chunk-2DXPTKQZ.cjs.map → chunk-IMQJVRMT.cjs.map} +1 -1
- package/dist/{chunk-RCVZX2JP.js → chunk-ITDYFBB6.js} +57 -6
- package/dist/chunk-ITDYFBB6.js.map +1 -0
- package/dist/{chunk-X3WHETQ3.cjs → chunk-LD4VKNPQ.cjs} +81 -44
- package/dist/chunk-LD4VKNPQ.cjs.map +1 -0
- package/dist/{chunk-4KB3GUEK.js → chunk-RTJD3ZSW.js} +4 -4
- package/dist/{chunk-4KB3GUEK.js.map → chunk-RTJD3ZSW.js.map} +1 -1
- package/dist/{chunk-L73KRFXI.cjs → chunk-SBBXKPBP.cjs} +91 -91
- package/dist/chunk-SBBXKPBP.cjs.map +1 -0
- package/dist/{chunk-UTIBYMIO.js → chunk-WST432AP.js} +52 -15
- package/dist/chunk-WST432AP.js.map +1 -0
- package/dist/index.cjs +33 -33
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/loader.css +1 -1
- package/dist/present.cjs +5 -5
- package/dist/present.d.cts +2 -2
- package/dist/present.d.ts +2 -2
- package/dist/present.js +5 -5
- package/dist/three.cjs +6 -6
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +2 -2
- package/dist/{types-CK_crNAI.d.ts → types-CavnUvd5.d.cts} +26 -1
- package/dist/{types-CK_crNAI.d.cts → types-CavnUvd5.d.ts} +26 -1
- package/docs/dsl.md +16 -4
- package/llms-full.txt +28 -12
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +2 -2
- package/skills/pixi-effects/reference/pitfalls.md +5 -3
- package/skills/pixi-effects/reference/quickstart.md +3 -2
- package/skills/pixi-effects/reference/recipes.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-DQCPJPFE.js +0 -7
- package/dist/Composition-V2XYSW6P.cjs +0 -16
- package/dist/chunk-BGMCZA36.js.map +0 -1
- package/dist/chunk-DJ5B7IKT.cjs.map +0 -1
- package/dist/chunk-L73KRFXI.cjs.map +0 -1
- package/dist/chunk-LYOKH7KE.cjs.map +0 -1
- package/dist/chunk-MMTESMJ5.js.map +0 -1
- package/dist/chunk-RCVZX2JP.js.map +0 -1
- package/dist/chunk-UTIBYMIO.js.map +0 -1
- package/dist/chunk-X3WHETQ3.cjs.map +0 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunkLYOKH7KE_cjs = require('./chunk-LYOKH7KE.cjs');
|
|
3
|
+
var chunkSBBXKPBP_cjs = require('./chunk-SBBXKPBP.cjs');
|
|
4
|
+
var chunkBVMZUPDU_cjs = require('./chunk-BVMZUPDU.cjs');
|
|
5
|
+
var chunkIMQJVRMT_cjs = require('./chunk-IMQJVRMT.cjs');
|
|
7
6
|
var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
|
|
8
7
|
var pixi_js = require('pixi.js');
|
|
9
8
|
var mediabunny = require('mediabunny');
|
|
@@ -477,6 +476,7 @@ function analyzeAudio(mix, sources, stats, movieDuration, opts = {}) {
|
|
|
477
476
|
const b = s.buffer;
|
|
478
477
|
return measure(Array.from({ length: b.numberOfChannels }, (_, c) => b.getChannelData(c)), b.sampleRate);
|
|
479
478
|
};
|
|
479
|
+
const scoreNotes = [];
|
|
480
480
|
const list = [...sources].sort((a, b) => a.start - b.start).map((s) => {
|
|
481
481
|
const layer = s.layer ?? "an audio layer";
|
|
482
482
|
const source = s.source ?? "audio";
|
|
@@ -499,13 +499,18 @@ function analyzeAudio(mix, sources, stats, movieDuration, opts = {}) {
|
|
|
499
499
|
issues.push(`${layer} (${source}) is cut off by the end of the movie at ${movieDuration}s (it runs to ${s.end.toFixed(2)}s)`);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
+
if (s.music && !s.loop && s.start < movieDuration && !clock) {
|
|
503
|
+
const plays = Math.min(s.end, movieDuration) - s.start;
|
|
504
|
+
const over = s.music.seconds - plays;
|
|
505
|
+
if (over > 2 && over / s.music.seconds > 0.15) scoreNotes.push(`${layer} (${source}): the score is ${Math.round(s.music.seconds * 10) / 10}s long but only ${Math.round(plays * 100) / 100}s of it play, so it is cut off mid-phrase. Write fewer bars (or a faster tempo) so it ends with the movie`);
|
|
506
|
+
}
|
|
502
507
|
return { layer, source, start: s.start, end: s.end, peakDb, sound, ...s.music ? { music: s.music } : {} };
|
|
503
508
|
});
|
|
504
509
|
const whole = measureLoudness(chans, sr);
|
|
505
510
|
const silences = findSilences(chans, sr, { minLength: 1 });
|
|
506
511
|
if (whole.clippedSamples > 0) issues.push(`${whole.clippedSamples} sample(s) of the mix are at full scale (clipped) \u2014 lower the volume of the layers that play loudest`);
|
|
507
512
|
if (whole.truePeakDb > 0) issues.push(`the mix's true peak is ${whole.truePeakDb} dBTP: it will distort when the video is encoded \u2014 lower the volume`);
|
|
508
|
-
const notes = [];
|
|
513
|
+
const notes = [...scoreNotes];
|
|
509
514
|
if (whole.integratedLufs !== null) {
|
|
510
515
|
if (whole.integratedLufs < LOUDNESS_NOTES.quietBelow) notes.push(`the mix is quiet for web video: ${whole.integratedLufs} LUFS (typical \u221214 to \u221216); raise the volume if that is not on purpose`);
|
|
511
516
|
else if (whole.integratedLufs > LOUDNESS_NOTES.loudAbove) notes.push(`the mix is loud: ${whole.integratedLufs} LUFS (typical web video \u221214 to \u221216)`);
|
|
@@ -1485,8 +1490,8 @@ function expandTransitions(spec) {
|
|
|
1485
1490
|
}
|
|
1486
1491
|
const transitions = out.transitions;
|
|
1487
1492
|
const sequences = out.sequences ?? [];
|
|
1488
|
-
const remap = out.duration !== void 0 ?
|
|
1489
|
-
const parentDuration = remap ?
|
|
1493
|
+
const remap = out.duration !== void 0 ? chunkBVMZUPDU_cjs.timeRemapOf(out) : null;
|
|
1494
|
+
const parentDuration = remap ? chunkBVMZUPDU_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1490
1495
|
const compW = out.width;
|
|
1491
1496
|
const compH = out.height;
|
|
1492
1497
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1554,16 +1559,16 @@ function expandTransitions(spec) {
|
|
|
1554
1559
|
if (toUses > 1) {
|
|
1555
1560
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1556
1561
|
}
|
|
1557
|
-
const tStart =
|
|
1562
|
+
const tStart = chunkBVMZUPDU_cjs.resolveAt(t.at, parentDuration);
|
|
1558
1563
|
const tEnd = tStart + t.duration;
|
|
1559
1564
|
const fromSeq = fromEntry.seq;
|
|
1560
|
-
const fromStart =
|
|
1565
|
+
const fromStart = chunkBVMZUPDU_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1561
1566
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1562
1567
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1563
1568
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1564
1569
|
}
|
|
1565
1570
|
const toSeq = toEntry.seq;
|
|
1566
|
-
const toStart =
|
|
1571
|
+
const toStart = chunkBVMZUPDU_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1567
1572
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1568
1573
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1569
1574
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1623,7 +1628,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1623
1628
|
delete inner.at;
|
|
1624
1629
|
delete inner.duration;
|
|
1625
1630
|
const m = inner.mask;
|
|
1626
|
-
const carriesMatte = m !== void 0 &&
|
|
1631
|
+
const carriesMatte = m !== void 0 && chunkSBBXKPBP_cjs.maskSourceOf(m).kind === "refs";
|
|
1627
1632
|
if (carriesMatte) delete inner.mask;
|
|
1628
1633
|
return {
|
|
1629
1634
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1890,15 +1895,42 @@ var clip = (a, b) => {
|
|
|
1890
1895
|
const w = Math.min(a.x + a.width, b.x + b.width) - x, h = Math.min(a.y + a.height, b.y + b.height) - y;
|
|
1891
1896
|
return w > 0 && h > 0 ? { x, y, width: w, height: h } : null;
|
|
1892
1897
|
};
|
|
1898
|
+
var GEOMETRY = /* @__PURE__ */ new Set(["x", "y", "z", "scale", "scaleX", "scaleY", "rotation", "rotationX", "rotationY", "skewX", "skewY", "positionX", "positionY", "pivotX", "pivotY", "anchorX", "anchorY"]);
|
|
1899
|
+
var NO_MOTION = { running: false, ever: false };
|
|
1900
|
+
var either = (a, b) => ({ running: a.running || b.running, ever: a.ever || b.ever });
|
|
1901
|
+
var TRANSLATION = /* @__PURE__ */ new Set(["x", "y", "z", "positionX", "positionY"]);
|
|
1902
|
+
function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
1903
|
+
let running = false, ever = false;
|
|
1904
|
+
for (const kf of keyframes ?? []) {
|
|
1905
|
+
const names = [kf.set, kf.to, kf.from].flatMap((bag) => bag ? Object.keys(bag) : []);
|
|
1906
|
+
if (!names.some(keys)) continue;
|
|
1907
|
+
let length = 0;
|
|
1908
|
+
if (typeof kf.duration === "number") length = kf.duration;
|
|
1909
|
+
else if (kf.duration === "auto") {
|
|
1910
|
+
const sp = chunkBVMZUPDU_cjs.parseSpring(kf.ease);
|
|
1911
|
+
length = sp ? Math.round(chunkBVMZUPDU_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1912
|
+
}
|
|
1913
|
+
if (!(length > 0)) continue;
|
|
1914
|
+
const kat = kf.at ?? 0;
|
|
1915
|
+
const start = kat < 0 ? lives + kat : kat;
|
|
1916
|
+
const repeats = kf.repeat ?? 0;
|
|
1917
|
+
const end = start + length * (repeats + 1) + (kf.repeatDelay ?? 0) * repeats;
|
|
1918
|
+
if (names.some((k) => TRANSLATION.has(k))) ever = true;
|
|
1919
|
+
if (local >= start - 1e-6 && local <= end + 1e-6) running = true;
|
|
1920
|
+
}
|
|
1921
|
+
return { running, ever };
|
|
1922
|
+
}
|
|
1893
1923
|
function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
1894
1924
|
const layers = [];
|
|
1895
1925
|
const view = { x: 0, y: 0, width: canvas.width, height: canvas.height };
|
|
1896
1926
|
const seen = /* @__PURE__ */ new Map();
|
|
1897
1927
|
const scene = /* @__PURE__ */ new Map();
|
|
1898
1928
|
const scaledToNothing = /* @__PURE__ */ new Set();
|
|
1899
|
-
const
|
|
1929
|
+
const hasMotion = /* @__PURE__ */ new Set();
|
|
1930
|
+
const walk2 = (comp, prefix, insideThreeD, parentVisible, parentScene, parentMotion = NO_MOTION, parentZero = false) => {
|
|
1900
1931
|
const blending = /* @__PURE__ */ new Set();
|
|
1901
1932
|
const now = comp.childTime(time);
|
|
1933
|
+
const cameraMotion = (comp.spec.sequences ?? []).filter((q) => q.type === "camera").reduce((m, q) => either(m, motionOf(q.keyframes, now - comp.childBase - (q.at ?? 0), q.duration ?? comp.duration ?? Infinity, () => true)), NO_MOTION);
|
|
1902
1934
|
for (const w of transitionWindowsOf(comp.spec)) {
|
|
1903
1935
|
const start = comp.childBase + w.start, end = comp.childBase + w.end;
|
|
1904
1936
|
if (now >= start - 1e-9 && now <= end + 1e-9) {
|
|
@@ -1925,12 +1957,11 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1925
1957
|
onCanvas = inter === 0 && area > 0 ? "none" : inter >= area - 1e-6 ? "full" : "partial";
|
|
1926
1958
|
if (area === 0) onCanvas = "none";
|
|
1927
1959
|
}
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
const moving = parentMoving || carried || (seq.spec.keyframes ?? []).length > 0 && (keys.has("x") || keys.has("y"));
|
|
1960
|
+
const localOf = (q) => now - comp.childBase - q.at;
|
|
1961
|
+
let motion = either(parentMotion, motionOf(seq.spec.keyframes, localOf(seq), seq.duration ?? Infinity));
|
|
1962
|
+
for (const c of carriers) motion = either(motion, motionOf(c.spec.keyframes, localOf(c), c.duration ?? Infinity));
|
|
1963
|
+
if (threeD) motion = either(motion, cameraMotion);
|
|
1964
|
+
const moving = motion.running;
|
|
1934
1965
|
const zeroScale = (o) => {
|
|
1935
1966
|
const s = o?.scale;
|
|
1936
1967
|
return !!s && (s.x === 0 || s.y === 0);
|
|
@@ -1940,9 +1971,10 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1940
1971
|
if (threeD) info.depthBlur = Number(depthBlur.toFixed(2));
|
|
1941
1972
|
if (threeD && light !== void 0) info.light = Number(light.toFixed(2));
|
|
1942
1973
|
layers.push(info);
|
|
1974
|
+
if (motion.ever) hasMotion.add(info);
|
|
1943
1975
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1944
1976
|
const maskTarget = seq.maskSequence?.target;
|
|
1945
|
-
const maskSrc =
|
|
1977
|
+
const maskSrc = chunkSBBXKPBP_cjs.maskSourceOf(seq.spec.mask);
|
|
1946
1978
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1947
1979
|
const m = maskTarget.getBounds();
|
|
1948
1980
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1951,7 +1983,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1951
1983
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1952
1984
|
if (group) scene.set(info, group);
|
|
1953
1985
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1954
|
-
if (seq instanceof
|
|
1986
|
+
if (seq instanceof chunkSBBXKPBP_cjs.CompositionSequence) walk2(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero);
|
|
1955
1987
|
});
|
|
1956
1988
|
};
|
|
1957
1989
|
walk2(root, "", false, true);
|
|
@@ -1964,6 +1996,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1964
1996
|
if (scaledToNothing.has(l)) continue;
|
|
1965
1997
|
issues.push(`${who} has no size (empty text, or not drawn yet)`);
|
|
1966
1998
|
} else if (l.moving || scene.has(l)) ; else if (l.onCanvas === "none") {
|
|
1999
|
+
if (hasMotion.has(l)) continue;
|
|
1967
2000
|
issues.push(`${who} is entirely outside the canvas (at ${Math.round(b.x)},${Math.round(b.y)}, ${Math.round(b.width)}\xD7${Math.round(b.height)})`);
|
|
1968
2001
|
} else if (l.onCanvas === "partial") {
|
|
1969
2002
|
const over = [];
|
|
@@ -1998,6 +2031,8 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
1998
2031
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
1999
2032
|
function detailOf(seq) {
|
|
2000
2033
|
const s = seq.spec;
|
|
2034
|
+
const spans = chunkBVMZUPDU_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2035
|
+
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2001
2036
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2002
2037
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
2003
2038
|
if (typeof s.sfx === "string") return `sfx \u201C${s.sfx}\u201D`;
|
|
@@ -2012,10 +2047,10 @@ function walk(comp, parentStart, parentEnd, depth, prefix, rows, transitions, lo
|
|
|
2012
2047
|
const start = parentStart + (seq.at ?? 0);
|
|
2013
2048
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2014
2049
|
const span = end - start;
|
|
2015
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2050
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkBVMZUPDU_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2016
2051
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2017
2052
|
const inner = [];
|
|
2018
|
-
const isComp = seq instanceof
|
|
2053
|
+
const isComp = seq instanceof chunkSBBXKPBP_cjs.CompositionSequence;
|
|
2019
2054
|
if (isComp) {
|
|
2020
2055
|
const label = seq.remapLabel();
|
|
2021
2056
|
walk(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2174,7 +2209,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2174
2209
|
}
|
|
2175
2210
|
|
|
2176
2211
|
// src/core/vars.ts
|
|
2177
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2212
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkBVMZUPDU_cjs.EXPRESSION_NAMES];
|
|
2178
2213
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2179
2214
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2180
2215
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2707,8 +2742,8 @@ var Movie = class {
|
|
|
2707
2742
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2708
2743
|
this._posterFrame = poster.frame;
|
|
2709
2744
|
this.background = options.background ?? "#000000";
|
|
2710
|
-
this.timeline =
|
|
2711
|
-
|
|
2745
|
+
this.timeline = chunkBVMZUPDU_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2746
|
+
chunkBVMZUPDU_cjs.lengthen(this.timeline, this.duration);
|
|
2712
2747
|
const baseAppOptions = {
|
|
2713
2748
|
width: this.width,
|
|
2714
2749
|
height: this.height,
|
|
@@ -2802,8 +2837,8 @@ var Movie = class {
|
|
|
2802
2837
|
height: sizeWins ? height : spec.height ?? height,
|
|
2803
2838
|
duration: spec.duration ?? this.duration
|
|
2804
2839
|
} : void 0;
|
|
2805
|
-
await
|
|
2806
|
-
if (
|
|
2840
|
+
await chunkBVMZUPDU_cjs.ensureFilterLibrary(seededComposition);
|
|
2841
|
+
if (chunkIMQJVRMT_cjs.usesAdvancedBlend(seededComposition)) await chunkIMQJVRMT_cjs.enableAdvancedBlend(this.app.renderer);
|
|
2807
2842
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
2808
2843
|
const rootSeqSpec = {
|
|
2809
2844
|
type: "composition",
|
|
@@ -2813,7 +2848,7 @@ var Movie = class {
|
|
|
2813
2848
|
...userComposition
|
|
2814
2849
|
};
|
|
2815
2850
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
2816
|
-
const sequence = new
|
|
2851
|
+
const sequence = new chunkSBBXKPBP_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
2817
2852
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
2818
2853
|
try {
|
|
2819
2854
|
await sequence.build();
|
|
@@ -2949,8 +2984,8 @@ var Movie = class {
|
|
|
2949
2984
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
2950
2985
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged);
|
|
2951
2986
|
alive();
|
|
2952
|
-
const timeline =
|
|
2953
|
-
|
|
2987
|
+
const timeline = chunkBVMZUPDU_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2988
|
+
chunkBVMZUPDU_cjs.lengthen(timeline, this.duration);
|
|
2954
2989
|
sequence.bindTimeline(timeline);
|
|
2955
2990
|
const hadSound = this.audioBuffer !== null;
|
|
2956
2991
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3590,7 +3625,9 @@ function countLayers(spec) {
|
|
|
3590
3625
|
for (const s of spec?.sequences ?? []) {
|
|
3591
3626
|
const mask = s.mask;
|
|
3592
3627
|
n += 1 + countLayers(s);
|
|
3593
|
-
const
|
|
3628
|
+
const spans = s.spans;
|
|
3629
|
+
if (Array.isArray(spans)) n += spans.length;
|
|
3630
|
+
const src = chunkSBBXKPBP_cjs.maskSourceOf(mask);
|
|
3594
3631
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3595
3632
|
}
|
|
3596
3633
|
return n;
|
|
@@ -3648,8 +3685,8 @@ function splitText(text, style = {}, opts = {}) {
|
|
|
3648
3685
|
|
|
3649
3686
|
// src/presets/_ease.ts
|
|
3650
3687
|
function parseEase2(name) {
|
|
3651
|
-
|
|
3652
|
-
return
|
|
3688
|
+
chunkBVMZUPDU_cjs.checkEase(name, "a preset");
|
|
3689
|
+
return chunkBVMZUPDU_cjs.parseEase(name);
|
|
3653
3690
|
}
|
|
3654
3691
|
|
|
3655
3692
|
// src/presets/kenBurns.ts
|
|
@@ -3784,17 +3821,17 @@ function orbit(opts) {
|
|
|
3784
3821
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
3785
3822
|
}
|
|
3786
3823
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
3787
|
-
const fixedR = opts.radius ??
|
|
3824
|
+
const fixedR = opts.radius ?? chunkBVMZUPDU_cjs.homeDistance(height, fov ?? chunkBVMZUPDU_cjs.DEFAULT_FOV);
|
|
3788
3825
|
const start = opts.start ?? -degrees / 2;
|
|
3789
3826
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
3790
3827
|
const easeFn = parseEase2(ease);
|
|
3791
3828
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
3792
3829
|
const pos = (i) => {
|
|
3793
3830
|
const p = i / steps;
|
|
3794
|
-
const a = (start + degrees * easeFn(p)) *
|
|
3831
|
+
const a = (start + degrees * easeFn(p)) * chunkBVMZUPDU_cjs.DEG;
|
|
3795
3832
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
3796
3833
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
3797
|
-
const R =
|
|
3834
|
+
const R = chunkBVMZUPDU_cjs.homeDistance(height, f);
|
|
3798
3835
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
3799
3836
|
};
|
|
3800
3837
|
const keyframes = [];
|
|
@@ -3849,7 +3886,7 @@ function particles(opts) {
|
|
|
3849
3886
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
3850
3887
|
const out = [];
|
|
3851
3888
|
for (let i = 0; i < count; i++) {
|
|
3852
|
-
const r =
|
|
3889
|
+
const r = chunkBVMZUPDU_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
3853
3890
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
3854
3891
|
const born = at + r() * emit;
|
|
3855
3892
|
const lifetime = pick(life);
|
|
@@ -3862,7 +3899,7 @@ function particles(opts) {
|
|
|
3862
3899
|
const turn = spin ? pick(spin) : 0;
|
|
3863
3900
|
const startAngle = spin ? r() * 360 : 0;
|
|
3864
3901
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
3865
|
-
const n0 = sway ?
|
|
3902
|
+
const n0 = sway ? chunkBVMZUPDU_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
3866
3903
|
const at_ = (t) => {
|
|
3867
3904
|
const axis = (p0, v0, acc) => {
|
|
3868
3905
|
if (drag > 0) {
|
|
@@ -3871,7 +3908,7 @@ function particles(opts) {
|
|
|
3871
3908
|
}
|
|
3872
3909
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
3873
3910
|
};
|
|
3874
|
-
const sw = sway ? swayAmp * (
|
|
3911
|
+
const sw = sway ? swayAmp * (chunkBVMZUPDU_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
3875
3912
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
3876
3913
|
};
|
|
3877
3914
|
const kfs = [];
|
|
@@ -3933,7 +3970,7 @@ function followPath(opts) {
|
|
|
3933
3970
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
3934
3971
|
const segments = [];
|
|
3935
3972
|
let total = 0;
|
|
3936
|
-
for (const line of
|
|
3973
|
+
for (const line of chunkBVMZUPDU_cjs.flattenSvgPath(d)) {
|
|
3937
3974
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
3938
3975
|
for (let i = 2; i < p.length; i += 2) {
|
|
3939
3976
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4087,7 +4124,7 @@ function distances(n, from, grid, seed) {
|
|
|
4087
4124
|
if (n === 0) return [];
|
|
4088
4125
|
if (from === "random") {
|
|
4089
4126
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4090
|
-
const r =
|
|
4127
|
+
const r = chunkBVMZUPDU_cjs.random(seed);
|
|
4091
4128
|
for (let i = n - 1; i > 0; i--) {
|
|
4092
4129
|
const j = Math.floor(r() * (i + 1));
|
|
4093
4130
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4149,7 +4186,7 @@ function wiggle(opts) {
|
|
|
4149
4186
|
to[n] = p.around;
|
|
4150
4187
|
return;
|
|
4151
4188
|
}
|
|
4152
|
-
const off = (
|
|
4189
|
+
const off = (chunkBVMZUPDU_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4153
4190
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4154
4191
|
});
|
|
4155
4192
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -4607,5 +4644,5 @@ exports.splitText = splitText;
|
|
|
4607
4644
|
exports.stagger = stagger;
|
|
4608
4645
|
exports.wiggle = wiggle;
|
|
4609
4646
|
exports.withFade = withFade;
|
|
4610
|
-
//# sourceMappingURL=chunk-
|
|
4611
|
-
//# sourceMappingURL=chunk-
|
|
4647
|
+
//# sourceMappingURL=chunk-LD4VKNPQ.cjs.map
|
|
4648
|
+
//# sourceMappingURL=chunk-LD4VKNPQ.cjs.map
|