pixi-effects 0.38.1 → 0.40.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +16 -30
  3. package/ai/chat-template.html +3 -3
  4. package/ai/tools/check.mjs +109 -13
  5. package/ai/tools/gltfProbe.mjs +122 -0
  6. package/ai/tools/media.mjs +129 -10
  7. package/ai/tools/pixi-effects.mjs +1 -1
  8. package/ai/tools/render.mjs +34 -8
  9. package/dist/{Base-BKKwxavW.d.cts → Base-DQWIJ6bJ.d.cts} +1 -1
  10. package/dist/{Base-ioh_AjLB.d.ts → Base-Jgkud1Aw.d.ts} +1 -1
  11. package/dist/Composition-C3UEVHQG.cjs +16 -0
  12. package/dist/{Composition-23KGIJX4.cjs.map → Composition-C3UEVHQG.cjs.map} +1 -1
  13. package/dist/Composition-KRWH72MA.js +7 -0
  14. package/dist/{Composition-5SQXSZNA.js.map → Composition-KRWH72MA.js.map} +1 -1
  15. package/dist/Controller.d.cts +2 -2
  16. package/dist/Controller.d.ts +2 -2
  17. package/dist/{Movie-BtwFI2ne.d.ts → Movie-CG6Jy1tx.d.ts} +6 -1
  18. package/dist/{Movie-CSWUTnMd.d.cts → Movie-CMq4KFmc.d.cts} +6 -1
  19. package/dist/{Spans-WJFPHMSQ.cjs → Spans-APNJHCYO.cjs} +9 -9
  20. package/dist/{Spans-WJFPHMSQ.cjs.map → Spans-APNJHCYO.cjs.map} +1 -1
  21. package/dist/{Spans-4IBQASGK.js → Spans-TWO4VN5H.js} +4 -4
  22. package/dist/{Spans-4IBQASGK.js.map → Spans-TWO4VN5H.js.map} +1 -1
  23. package/dist/{chunk-4CSL5QSL.js → chunk-26Z544SH.js} +24 -13
  24. package/dist/chunk-26Z544SH.js.map +1 -0
  25. package/dist/{chunk-FE42PKHP.cjs → chunk-27PYJ4JY.cjs} +83 -72
  26. package/dist/chunk-27PYJ4JY.cjs.map +1 -0
  27. package/dist/{chunk-7NXKBRT7.cjs → chunk-7EI2N7WO.cjs} +27 -7
  28. package/dist/{chunk-7NXKBRT7.cjs.map → chunk-7EI2N7WO.cjs.map} +1 -1
  29. package/dist/{chunk-XOCRS5MW.js → chunk-CT5CZVT5.js} +15 -8
  30. package/dist/chunk-CT5CZVT5.js.map +1 -0
  31. package/dist/{chunk-KNMDDUA3.cjs → chunk-LEL7UNYQ.cjs} +50 -43
  32. package/dist/chunk-LEL7UNYQ.cjs.map +1 -0
  33. package/dist/{chunk-UDTLYYGY.js → chunk-LMWXR5OC.js} +27 -7
  34. package/dist/{chunk-UDTLYYGY.js.map → chunk-LMWXR5OC.js.map} +1 -1
  35. package/dist/index.cjs +33 -33
  36. package/dist/index.d.cts +4 -4
  37. package/dist/index.d.ts +4 -4
  38. package/dist/index.js +3 -3
  39. package/dist/loader.css +1 -1
  40. package/dist/present.cjs +3 -3
  41. package/dist/present.d.cts +2 -2
  42. package/dist/present.d.ts +2 -2
  43. package/dist/present.js +3 -3
  44. package/dist/three.cjs +505 -12
  45. package/dist/three.cjs.map +1 -1
  46. package/dist/three.d.cts +139 -7
  47. package/dist/three.d.ts +139 -7
  48. package/dist/three.js +501 -10
  49. package/dist/three.js.map +1 -1
  50. package/dist/{types-BXi-0iZS.d.cts → types-DIh93lFb.d.cts} +82 -1
  51. package/dist/{types-BXi-0iZS.d.ts → types-DIh93lFb.d.ts} +82 -1
  52. package/docs/api.md +21 -11
  53. package/docs/dsl.md +73 -5
  54. package/docs/media.md +17 -2
  55. package/llms-full.txt +188 -23
  56. package/llms.txt +1 -1
  57. package/package.json +11 -12
  58. package/skills/pixi-effects/SKILL.md +5 -3
  59. package/skills/pixi-effects/reference/cheatsheet.md +2 -2
  60. package/skills/pixi-effects/reference/pitfalls.md +1 -0
  61. package/skills/pixi-effects/reference/recipes.md +69 -0
  62. package/skills/pixi-effects/template.html +9 -8
  63. package/dist/Composition-23KGIJX4.cjs +0 -16
  64. package/dist/Composition-5SQXSZNA.js +0 -7
  65. package/dist/chunk-4CSL5QSL.js.map +0 -1
  66. package/dist/chunk-FE42PKHP.cjs.map +0 -1
  67. package/dist/chunk-KNMDDUA3.cjs.map +0 -1
  68. package/dist/chunk-XOCRS5MW.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { CompositionSequence, maskSourceOf } from './chunk-4CSL5QSL.js';
2
- import { EXPRESSION_NAMES, createTimeline, lengthen, ensureFilterLibrary, checkEase, parseEase, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, trimPolylines, rand, DEG, timeRemapOf, contentLength, resolveAt, parseSpring, springDuration, spansMeta } from './chunk-UDTLYYGY.js';
1
+ import { CompositionSequence, maskSourceOf } from './chunk-26Z544SH.js';
2
+ import { EXPRESSION_NAMES, createTimeline, lengthen, ensureFilterLibrary, checkEase, parseEase, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, trimPolylines, rand, DEG, timeRemapOf, contentLength, resolveAt, parseSpring, springDuration, spansMeta } from './chunk-LMWXR5OC.js';
3
3
  import { analyzeAudio, fft, resampleThrough, playSpan } from './chunk-UHNSL2KJ.js';
4
4
  import { usesAdvancedBlend, enableAdvancedBlend } from './chunk-VNP7QCJE.js';
5
5
  import { describeLayer } from './chunk-32MMNDDN.js';
@@ -583,7 +583,7 @@ async function exportFrames(movie, options = {}) {
583
583
  const keyframeIntervalFrames = Math.max(1, Math.round(interval * movie.frameRate));
584
584
  try {
585
585
  const count = Math.max(1, range2.toFrame - range2.fromFrame);
586
- for (let frame = range2.fromFrame; frame <= range2.toFrame; frame++) {
586
+ for (let frame = range2.fromFrame; frame < range2.toFrame; frame++) {
587
587
  if (mb && blurCanvas) await movie._exposeFrame(frame, mb, blurCanvas, false);
588
588
  else await movie.gotoFrame(frame, true);
589
589
  if (small && smallCtx) smallCtx.drawImage(blurCanvas ?? stage, 0, 0, small.width, small.height);
@@ -594,9 +594,10 @@ async function exportFrames(movie, options = {}) {
594
594
  const progress = Math.floor(rel / count * 100);
595
595
  movie.emit("progress", { progress, frame, totalFrames: movie.totalFrames });
596
596
  }
597
+ movie.emit("progress", { progress: 100, frame: range2.toFrame, totalFrames: movie.totalFrames });
597
598
  await canvasSource.close();
598
599
  await output.finalize();
599
- if (mb) await movie.gotoFrame(range2.toFrame, true);
600
+ if (mb) await movie.gotoFrame(range2.toFrame - 1, true);
600
601
  return new Blob([output.target.buffer], { type: output.format.mimeType });
601
602
  } finally {
602
603
  movie.app.ticker.start();
@@ -1506,8 +1507,9 @@ function canvasReport(root) {
1506
1507
  const moments = [0.15, 0.4, 0.65, 0.9].map((f) => Math.round(f * length * 1e3) / 1e3);
1507
1508
  const { differs, drawMs, threw } = seq.checkDeterminism(moments);
1508
1509
  const name = describeLayer(seq.spec);
1509
- const problem = threw.length ? `${name} could not draw at ${threw.map((t) => `${t} s`).join(", ")} (its draw threw, or the layer failed to build): it shows a magenta checkerboard there; the warning above says why, so the layer cannot be called deterministic` : differs.length ? `${name} does not draw the same picture for the same time (checked at ${differs.map(describeDiff).join(", ")}; drawn in two orders after one draw that was thrown away): usually its draw uses Math.random, Date.now or state that outlives the call (a value it keeps from the last call), so playback, a seek and an export would not agree: use info.random() (seeded) and derive everything from t. If it uses none of these, look at the canvases it draws from: make sprites and masks with info.canvas(w, h) (not document.createElement) and draw them into the picture before the strokes that depend on them` : "";
1510
- out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem });
1510
+ const kind = seq.spec.type === "three" ? "three" : "canvas";
1511
+ const problem = threw.length ? `${name} could not draw at ${threw.map((t) => `${t} s`).join(", ")} (its ${kind === "three" ? "update or render threw" : "draw threw"}, or the layer failed to build): ${kind === "three" ? "the warning above says why" : "it shows a magenta checkerboard there; the warning above says why"}, so the layer cannot be called deterministic` : differs.length ? `${name} does not draw the same picture for the same time (checked at ${differs.map(describeDiff).join(", ")}; drawn in two orders after one draw that was thrown away): ` + (kind === "three" ? "usually its update uses Math.random, Date.now, a clock, or state that builds up from call to call: a mixer advanced with mixer.update(dt) is one (pose a clip with mixer.setTime(t), or threeGltf(url).pose(t)), and so is a value moved by the time since the last call. A skinned model of your own (not loaded by threeGltf) that moves and casts a shadow does it too: three culls a skinned mesh by a bounding sphere that does not follow it, so set mesh.frustumCulled = false. Set every object from t, so playback, a seek and an export agree" : "usually its draw uses Math.random, Date.now or state that outlives the call (a value it keeps from the last call), so playback, a seek and an export would not agree: use info.random() (seeded) and derive everything from t. If it uses none of these, look at the canvases it draws from: make sprites and masks with info.canvas(w, h) (not document.createElement) and draw them into the picture before the strokes that depend on them") : "";
1512
+ out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem, kind });
1511
1513
  }
1512
1514
  if (seq instanceof CompositionSequence) walk2(seq);
1513
1515
  };
@@ -1628,6 +1630,11 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
1628
1630
  const info = { path: prefix + label, name, type: seq.spec.type, threeD, visible, alpha, moving, bounds, onCanvas };
1629
1631
  if (threeD) info.depthBlur = Number(depthBlur.toFixed(2));
1630
1632
  if (threeD && light !== void 0) info.light = Number(light.toFixed(2));
1633
+ const drawn = seq;
1634
+ if (typeof drawn.renderer === "string") {
1635
+ info.renderer = drawn.renderer;
1636
+ if (typeof drawn.backend === "string") info.backend = drawn.backend;
1637
+ }
1631
1638
  layers.push(info);
1632
1639
  chainAlpha.set(info, parentAlpha * alpha);
1633
1640
  chains.set(info, chainOf(display));
@@ -4478,5 +4485,5 @@ function withFade(spec, opts) {
4478
4485
  }
4479
4486
 
4480
4487
  export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, parseEase2 as parseEase, particles, react, resolveLoader, samplePath, splitText, stagger, wiggle, withFade };
4481
- //# sourceMappingURL=chunk-XOCRS5MW.js.map
4482
- //# sourceMappingURL=chunk-XOCRS5MW.js.map
4488
+ //# sourceMappingURL=chunk-CT5CZVT5.js.map
4489
+ //# sourceMappingURL=chunk-CT5CZVT5.js.map