pixi-effects 0.49.0 → 0.50.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 (80) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +8 -7
  3. package/ai/chat-template.html +4 -4
  4. package/ai/tools/check.mjs +6 -6
  5. package/dist/3d.cjs +17 -13
  6. package/dist/3d.cjs.map +1 -1
  7. package/dist/3d.d.cts +3 -1
  8. package/dist/3d.d.ts +3 -1
  9. package/dist/3d.js +9 -5
  10. package/dist/3d.js.map +1 -1
  11. package/dist/Composition-47U5U637.cjs +16 -0
  12. package/dist/{Composition-464AWDV6.cjs.map → Composition-47U5U637.cjs.map} +1 -1
  13. package/dist/Composition-GVWWLFDL.js +7 -0
  14. package/dist/{Composition-5U63LMPX.js.map → Composition-GVWWLFDL.js.map} +1 -1
  15. package/dist/Controller.d.cts +2 -2
  16. package/dist/Controller.d.ts +2 -2
  17. package/dist/{Movie-BxB7bauG.d.cts → Movie-DogzDBuW.d.cts} +20 -5
  18. package/dist/{Movie-6EWOz6Yw.d.ts → Movie-Y7iHg2V8.d.ts} +20 -5
  19. package/dist/{Spans-W5VJRMGC.js → Spans-3SEZSTQV.js} +6 -6
  20. package/dist/{Spans-W5VJRMGC.js.map → Spans-3SEZSTQV.js.map} +1 -1
  21. package/dist/{Spans-DUR2W5EH.cjs → Spans-R426NVY3.cjs} +11 -11
  22. package/dist/{Spans-DUR2W5EH.cjs.map → Spans-R426NVY3.cjs.map} +1 -1
  23. package/dist/{blendModes-NC76DNVX.cjs → blendModes-2IDILRN6.cjs} +5 -5
  24. package/dist/{blendModes-NC76DNVX.cjs.map → blendModes-2IDILRN6.cjs.map} +1 -1
  25. package/dist/{blendModes-ZOBLPSR3.js → blendModes-4QH44GOL.js} +4 -4
  26. package/dist/{blendModes-ZOBLPSR3.js.map → blendModes-4QH44GOL.js.map} +1 -1
  27. package/dist/{chunk-ABWRISRK.cjs → chunk-3FCDRLW3.cjs} +4 -3
  28. package/dist/chunk-3FCDRLW3.cjs.map +1 -0
  29. package/dist/{chunk-MXACRKAN.js → chunk-C2HL5236.js} +4 -4
  30. package/dist/{chunk-MXACRKAN.js.map → chunk-C2HL5236.js.map} +1 -1
  31. package/dist/{chunk-5YNME6AH.cjs → chunk-GXGIISFS.cjs} +5 -5
  32. package/dist/{chunk-5YNME6AH.cjs.map → chunk-GXGIISFS.cjs.map} +1 -1
  33. package/dist/{chunk-H363KMJR.js → chunk-J4ZP76IL.js} +4 -3
  34. package/dist/chunk-J4ZP76IL.js.map +1 -0
  35. package/dist/{chunk-BSFWVTSR.cjs → chunk-O2MD3L4J.cjs} +92 -92
  36. package/dist/{chunk-BSFWVTSR.cjs.map → chunk-O2MD3L4J.cjs.map} +1 -1
  37. package/dist/{chunk-DOGY3EAW.js → chunk-SSVHAF3Q.js} +470 -17
  38. package/dist/chunk-SSVHAF3Q.js.map +1 -0
  39. package/dist/{chunk-USUUAYTE.js → chunk-TXNQLMRT.js} +5 -5
  40. package/dist/{chunk-USUUAYTE.js.map → chunk-TXNQLMRT.js.map} +1 -1
  41. package/dist/{chunk-PBMDZT2T.js → chunk-UTUUOQ47.js} +39 -16
  42. package/dist/chunk-UTUUOQ47.js.map +1 -0
  43. package/dist/{chunk-33USHRV5.cjs → chunk-VVUSZVP7.cjs} +493 -39
  44. package/dist/chunk-VVUSZVP7.cjs.map +1 -0
  45. package/dist/{chunk-GUDLIAIG.cjs → chunk-YOKRPAKA.cjs} +82 -59
  46. package/dist/chunk-YOKRPAKA.cjs.map +1 -0
  47. package/dist/index.cjs +35 -35
  48. package/dist/index.d.cts +3 -3
  49. package/dist/index.d.ts +3 -3
  50. package/dist/index.js +5 -5
  51. package/dist/loader.css +1 -1
  52. package/dist/present.cjs +5 -5
  53. package/dist/present.d.cts +2 -2
  54. package/dist/present.d.ts +2 -2
  55. package/dist/present.js +5 -5
  56. package/dist/three.cjs +13 -9
  57. package/dist/three.cjs.map +1 -1
  58. package/dist/three.d.cts +3 -1
  59. package/dist/three.d.ts +3 -1
  60. package/dist/three.js +8 -4
  61. package/dist/three.js.map +1 -1
  62. package/dist/{types-kt7DQKfO.d.cts → types-BZngm4nT.d.cts} +48 -5
  63. package/dist/{types-kt7DQKfO.d.ts → types-BZngm4nT.d.ts} +48 -5
  64. package/docs/api.md +4 -1
  65. package/docs/dsl.md +35 -1
  66. package/llms-full.txt +91 -3
  67. package/package.json +1 -1
  68. package/skills/pixi-effects/SKILL.md +2 -1
  69. package/skills/pixi-effects/reference/cheatsheet.md +2 -0
  70. package/skills/pixi-effects/reference/pitfalls.md +6 -0
  71. package/skills/pixi-effects/reference/recipes.md +42 -0
  72. package/skills/pixi-effects/template.html +8 -7
  73. package/dist/Composition-464AWDV6.cjs +0 -16
  74. package/dist/Composition-5U63LMPX.js +0 -7
  75. package/dist/chunk-33USHRV5.cjs.map +0 -1
  76. package/dist/chunk-ABWRISRK.cjs.map +0 -1
  77. package/dist/chunk-DOGY3EAW.js.map +0 -1
  78. package/dist/chunk-GUDLIAIG.cjs.map +0 -1
  79. package/dist/chunk-H363KMJR.js.map +0 -1
  80. package/dist/chunk-PBMDZT2T.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.50.0
4
+
5
+ Nothing breaks: `scene2d`, a layer of PixiJS 2D objects built by your code (core, nothing to import), and two fixes for every engine: a rebuild that keeps a scene starts its keyframes from setup's values, and a routed `tint` keyframe moves by channel.
6
+
7
+ - **PixiJS 2D built by code: the `scene2d` layer** (core, nothing to import). `{ type: 'scene2d', setup({ root, width, height, texture }), update(t, ctx), dispose, width, height, reuse }`: your PixiJS display objects (`Graphics`, `Sprite`, `AnimatedSprite`, `Text`, a thousand pieces) as one layer, shaped like the `scene3d` layer, so a free box of PixiJS 2D no longer needs a `Sequence` subclass. Keyframes reach `scene2d.<object>.<path>` (raw PixiJS values); `anchorX` / `anchorY` place its box; `update` with a clock or `Math.random` warns; an `AnimatedSprite` left playing is posed from the layer's time (anything else with `autoUpdate` is turned off and said, a `<video>` texture is said); `check` draws it in two orders and names a layer whose same frame differs; `movie.pick` names the object under a point (`kind: 'scene2d'`, `hit.scene2d.object` by its label, `grab().move(x, y)`; empty space falls through) and `check --pick` prints it; `ctx.texture(name)` is a movie asset's texture; a named layer keeps its scene across `setVars` (`setup` runs once). Recipe `scene2d-basics`.
8
+ - **Fixed: a rebuild that keeps a scene (`scene2d`, `scene3d`, `three` with `reuse`) started its keyframes from the last frame the old movie showed.** After `setVars` late in a movie, a keyframe into the scene (`scene3d.cube.position.y`, `three.box.position.y`) began where the old movie had left the object, not where `setup` put it, so the picture differed from a fresh page. The values `setup` left are noted and put back at the swap; the old movie is not touched while the new tree is built. A layer used as a matte source that keeps its scene is committed too.
9
+ - **Fixed: a keyframe on a routed `tint`** (`scene2d.box.tint`, any `<router>.<object>.tint`) moves channel by channel and takes any colour form (it was interpolated as one number, or started from a colour it could not read).
10
+ - PixiJS 3D's own pointer events (`mesh.on('pointerdown')`) are tested to work in a scene3d layer; README and every gallery / interactive example load pixi.js 8.23.0.
11
+
3
12
  ## 0.49.0
4
13
 
5
14
  Nothing breaks: 3D scenes drawn by PixiJS 3D (`@pixi/3d`), the new main 3D engine, as a `scene3d` layer (entry `pixi-effects/3d`); three.js stays as the sub engine. PixiJS 8.23 in the template.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pixi-effects
2
2
 
3
- > **Status**: experimental — current release `0.49.0`. The API may still change between minor versions; see the [CHANGELOG](./CHANGELOG.md) for what each release changed.
3
+ > **Status**: experimental — current release `0.50.0`. The API may still change between minor versions; see the [CHANGELOG](./CHANGELOG.md) for what each release changed.
4
4
 
5
5
  **[Gallery →](https://yjmtmtk.github.io/pixi-effects/examples/gallery/)** · 43 pieces written as plain data by AI models · **[For AI →](https://yjmtmtk.github.io/pixi-effects/for-ai.html)** · what an AI reads and runs · **[Playground →](https://yjmtmtk.github.io/pixi-effects/examples/playground.html)** in the browser.
6
6
 
@@ -25,6 +25,7 @@ Declarative composition and video rendering for the web. After Effects-style tim
25
25
  - **Music written as text** — `{ type: 'audio', music: { bpm: 96, tracks: [{ inst: 'keys', notes: 'Cmaj7:4 Am7:4' }], drums: { kick: 'x...x...' } } }`: a tune with no audio file, played by a small built-in synthesiser (keys, pluck, pad, bass, lead, bell, music box, drums; chords by name, swing, fades, a ritardando). Deterministic, in the exported file at the same moment; an AI writes it as easily as a title.
26
26
  - **Audio-reactive visuals** — `audioEnvelope('music.mp3')` analyses loudness, bass / mid / treble and the beats per frame; `react()` turns them into keyframes, so the picture follows the music and still renders identically.
27
27
  - **2.5D layers & camera** — add `threeD: true`, `z`, `rotationX/Y` and a `{ type: 'camera' }` layer for parallax, flips and dolly zooms; no three.js needed.
28
+ - **PixiJS 2D by code** — a `scene2d` layer hands you a PixiJS container: build `Graphics`, `Sprite`s, `AnimatedSprite`s or a thousand pieces in `setup`, set them from the time in `update`, and it is a layer like any other (keyframes reach its objects as `scene2d.dot.alpha`, `movie.pick` names them, `check` holds it to "a function of the time").
28
29
  - **3D scenes** *(optional)* — a real 3D scene (meshes, glTF models, PBR, lights, shadows) as a layer via `pixi-effects/3d`, drawn by [PixiJS 3D](https://pixijs.com/3d) inside PixiJS's own renderer, so masks, filters, blend modes and opacity work on it like on any layer; keyframes drive its objects (`scene3d.cube.rotation.y`). It can live in the composition's space (`followCamera`, `followLights`, `followFog`), load and pose a glTF from the time (`loadModel`), show a 2D layer on a mesh (`layerTexture`) and be clicked into (`movie.pick`).
29
30
  - **three.js layer** *(optional)* — drop a real three.js scene in as a layer via `pixi-effects/three`; keyframes drive its objects (`three.cube.rotation.y`). It can live in the composition's space: the composition's camera, lights, shadows and fog drive the scene, so one `cameraPath()` flies through the flat layers and a glTF model together (`threeGltf`).
30
31
  - **Built-in player UI — or your own** — a drop-in HTML5-`<video>`-style overlay controller (play, scrub, mute, volume, fullscreen, export-to-file) whose colours are one option (`theme: { accent: '#ff4d6d' }`); or build a player yourself on the movie's `<video>`-named events (`play pause ended seeking seeked volumechange error`).
@@ -49,10 +50,10 @@ Drop the imports into an [importmap](https://developer.mozilla.org/docs/Web/HTML
49
50
  <script type="importmap">
50
51
  {
51
52
  "imports": {
52
- "pixi.js": "https://esm.sh/pixi.js@8.22.0?bundle-deps",
53
+ "pixi.js": "https://esm.sh/pixi.js@8.23.0?bundle-deps",
53
54
  "mediabunny": "https://esm.sh/mediabunny",
54
- "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/index.js",
55
- "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/Controller.js"
55
+ "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/index.js",
56
+ "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/Controller.js"
56
57
  }
57
58
  }
58
59
  </script>
@@ -65,7 +66,7 @@ Drop the imports into an [importmap](https://developer.mozilla.org/docs/Web/HTML
65
66
 
66
67
  The `mediabunny` line is needed only to export (the download button, `movie.render()`) or for a `video` layer; a page that only plays can leave it out and never fetches it (or call `useMediabunny(url)` instead, see [the API](docs/api.md#where-the-encoder-comes-from-usemediabunnysource)).
67
68
 
68
- Load the `dist/` files **as they are** (jsDelivr's `/npm/…/dist/…`, or unpkg's `https://unpkg.com/pixi-effects@0.49.0/dist/index.js`) rather than a CDN-rebundled build such as `esm.sh/pixi-effects` or jsDelivr's `+esm`: the entries (`pixi-effects`, `…/controller`, `…/three`) share internal chunks, which only works when each file is served untouched.
69
+ Load the `dist/` files **as they are** (jsDelivr's `/npm/…/dist/…`, or unpkg's `https://unpkg.com/pixi-effects@0.50.0/dist/index.js`) rather than a CDN-rebundled build such as `esm.sh/pixi-effects` or jsDelivr's `+esm`: the entries (`pixi-effects`, `…/controller`, `…/three`) share internal chunks, which only works when each file is served untouched.
69
70
 
70
71
  > **A 3D scene?** Add three more entries (`pixi-effects/3d`, `@pixi/3d`, `@pixi/3d/extras`) — see [Adding a 3D scene](#adding-a-3d-scene-optional) below. **Using three.js?** Add two more entries (`three` and `pixi-effects/three`) to this importmap — see [Adding three.js](#adding-threejs-optional) below.
71
72
  >
@@ -80,7 +81,7 @@ Add three entries to the importmap above (PixiJS 3D needs `pixi.js` 8.23.0 or la
80
81
  {
81
82
  "imports": {
82
83
  "...": "(everything from the importmap above)",
83
- "pixi-effects/3d": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/3d.js",
84
+ "pixi-effects/3d": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/3d.js",
84
85
  "@pixi/3d": "https://cdn.jsdelivr.net/npm/@pixi/3d@0.1.0/dist/pixijs-3d.min.mjs",
85
86
  "@pixi/3d/extras": "https://cdn.jsdelivr.net/npm/@pixi/3d@0.1.0/dist/pixijs-3d-extras.min.mjs"
86
87
  }
@@ -124,7 +125,7 @@ Add two more entries to the importmap above: three.js itself, and the `pixi-effe
124
125
  "...": "(everything from the importmap above)",
125
126
  "three": "https://esm.sh/three@0.178.0",
126
127
  "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.178.0/examples/jsm/",
127
- "pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/three.js"
128
+ "pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/three.js"
128
129
  }
129
130
  }
130
131
  </script>
@@ -59,10 +59,10 @@
59
59
  "imports": {
60
60
  "pixi.js": "https://cdn.jsdelivr.net/npm/pixi.js@8.23.0/dist/pixi.min.mjs",
61
61
  "mediabunny": "https://cdn.jsdelivr.net/npm/mediabunny@1.61.3/+esm",
62
- "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/index.js",
63
- "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/Controller.js",
64
- "pixi-effects/present": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/present.js",
65
- "pixi-effects/3d": "https://cdn.jsdelivr.net/npm/pixi-effects@0.49.0/dist/3d.js",
62
+ "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/index.js",
63
+ "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/Controller.js",
64
+ "pixi-effects/present": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/present.js",
65
+ "pixi-effects/3d": "https://cdn.jsdelivr.net/npm/pixi-effects@0.50.0/dist/3d.js",
66
66
  "@pixi/3d": "https://cdn.jsdelivr.net/npm/@pixi/3d@0.1.0/dist/pixijs-3d.min.mjs",
67
67
  "@pixi/3d/extras": "https://cdn.jsdelivr.net/npm/@pixi/3d@0.1.0/dist/pixijs-3d-extras.min.mjs"
68
68
  }
@@ -520,7 +520,7 @@ export async function runCheck(opts, log = console.log) {
520
520
  const layoutProblems = rv.problems.filter(g => g.kind !== 'canvas'), canvasProblems = rv.problems.filter(g => g.kind === 'canvas');
521
521
  report.inspect = { checkedFrames: rv.frames, issues: layoutProblems, review: rv.review, canvas: canvasProblems.map(g => g.message), canvasLayers: rv.canvas ?? [] };
522
522
  if (layoutProblems.length) report.problems.push(`${layoutProblems.length} kind(s) of layout issue from movie.inspect`);
523
- if (canvasProblems.length) report.problems.push(`${canvasProblems.length} layer(s) (canvas / three / scene3d) that do not draw the same picture for the same time (movie.canvasProblems)`);
523
+ if (canvasProblems.length) report.problems.push(`${canvasProblems.length} layer(s) (canvas / three / scene3d / scene2d) that do not draw the same picture for the same time (movie.canvasProblems)`);
524
524
  // fonts: a web font whose file did not load is a problem (the library lists a layer with no available font for review)
525
525
  report.fonts = rv.fonts;
526
526
  if (rv.fonts.failed.length) report.problems.push(`${rv.fonts.failed.length} web font(s) failed to load: ${rv.fonts.failed.join(', ')} (the layers that use them are drawn in a fallback)`);
@@ -553,7 +553,7 @@ export async function runCheck(opts, log = console.log) {
553
553
  if (rows.some(([, px]) => px > 0)) w.depthBlur = Object.fromEntries(rows);
554
554
  // pick: what is under each --pick point at this moment (the frame is on screen after the snapshot above)
555
555
  if (opts.pick.length) {
556
- w.pick = await cdp.eval(`(${JSON.stringify(opts.pick)}).map(p => ({ x: p.x, y: p.y, hits: movie.pickAll(p.x, p.y).map(h => ({ name: h.name ?? h.path, path: h.path, kind: h.kind, object: h.three ? h.three.object : h.scene3d ? h.scene3d.object : undefined })) }))`).catch(() => []);
556
+ w.pick = await cdp.eval(`(${JSON.stringify(opts.pick)}).map(p => ({ x: p.x, y: p.y, hits: movie.pickAll(p.x, p.y).map(h => ({ name: h.name ?? h.path, path: h.path, kind: h.kind, object: h.three ? h.three.object : h.scene3d ? h.scene3d.object : h.scene2d ? h.scene2d.object : undefined })) }))`).catch(() => []);
557
557
  }
558
558
  // light: how lit each threeD layer is at this moment (left out when the composition has no light)
559
559
  const lit = await cdp.eval(`movie.inspect(${w.frame}).then(r => r.layers.filter(l => l.light !== undefined).map(l => [l.path, l.light]))`).catch(() => []);
@@ -895,7 +895,7 @@ export async function runSteps(cdp, steps, outDir, size, consoleLines, seenLogs)
895
895
  await sleep(300); // the page's handlers and rebuilds settle
896
896
  const after = await cdp.eval('JSON.parse(JSON.stringify(movie.vars || {}))').catch(() => ({}));
897
897
  res.vars = Object.fromEntries(Object.keys({ ...before, ...after }).filter(k => JSON.stringify(before[k]) !== JSON.stringify(after[k])).map(k => [k, [before[k], after[k]]]));
898
- if (last) res.hits = await cdp.eval(`movie.pickAll(${last.x}, ${last.y}).map(h => h.kind === 'three' ? h.path + ' (three: ' + (h.three && h.three.object || '?') + ')' : h.kind === 'scene3d' ? h.path + ' (scene3d: ' + (h.scene3d && h.scene3d.object || '?') + ')' : h.path)`).catch(() => []);
898
+ if (last) res.hits = await cdp.eval(`movie.pickAll(${last.x}, ${last.y}).map(h => h.kind === 'three' ? h.path + ' (three: ' + (h.three && h.three.object || '?') + ')' : h.kind === 'scene3d' ? h.path + ' (scene3d: ' + (h.scene3d && h.scene3d.object || '?') + ')' : h.kind === 'scene2d' ? h.path + ' (scene2d: ' + (h.scene2d && h.scene2d.object || '?') + ')' : h.path)`).catch(() => []);
899
899
  res.frame = await cdp.eval('movie.currentFrame').catch(() => null);
900
900
  res.playing = await cdp.eval('!!movie.isPlaying').catch(() => null);
901
901
  const now = await pageLogs();
@@ -930,8 +930,8 @@ function finish(report, outDir, log) {
930
930
  if (g.length > 8) L.push(` … ${g.length - 8} more (report.json)`);
931
931
  const cv = report.inspect.canvas ?? [];
932
932
  const rows = report.inspect.canvasLayers ?? [];
933
- if (cv.length) { L.push(` canvas ${cv.length} layer(s) (canvas / three / scene3d) that do not draw the same picture for the same time:`); for (const m of cv.slice(0, 4)) L.push(` - ${m}`); }
934
- for (const kind of ['canvas', 'three', 'scene3d']) { // silence must not be the only sign that the check ran
933
+ if (cv.length) { L.push(` canvas ${cv.length} layer(s) (canvas / three / scene3d / scene2d) that do not draw the same picture for the same time:`); for (const m of cv.slice(0, 4)) L.push(` - ${m}`); }
934
+ for (const kind of ['canvas', 'three', 'scene3d', 'scene2d']) { // silence must not be the only sign that the check ran
935
935
  const mine = rows.filter(r => (r.kind ?? 'canvas') === kind);
936
936
  if (!mine.length) continue;
937
937
  const good = mine.filter(r => r.ok), slow = [...mine].sort((a, b) => b.drawMs - a.drawMs)[0];
@@ -952,7 +952,7 @@ function finish(report, outDir, log) {
952
952
  }
953
953
  for (const w of (report.at ?? []).filter(x => x.pick)) {
954
954
  for (const p of w.pick) {
955
- const says = p.hits.length ? p.hits.map(h => h.kind === 'three' || h.kind === 'scene3d' ? `${h.name} (${h.kind}: ${h.object || '?'})` : h.name).join(', ') : 'nothing';
955
+ const says = p.hits.length ? p.hits.map(h => h.kind === 'three' || h.kind === 'scene3d' || h.kind === 'scene2d' ? `${h.name} (${h.kind}: ${h.object || '?'})` : h.name).join(', ') : 'nothing';
956
956
  L.push(` pick ${w.label} (${p.x}, ${p.y}) — ${says}`);
957
957
  }
958
958
  }
package/dist/3d.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunk33USHRV5_cjs = require('./chunk-33USHRV5.cjs');
4
- var chunk5YNME6AH_cjs = require('./chunk-5YNME6AH.cjs');
5
- var chunkABWRISRK_cjs = require('./chunk-ABWRISRK.cjs');
3
+ var chunkVVUSZVP7_cjs = require('./chunk-VVUSZVP7.cjs');
4
+ var chunkGXGIISFS_cjs = require('./chunk-GXGIISFS.cjs');
5
+ var chunk3FCDRLW3_cjs = require('./chunk-3FCDRLW3.cjs');
6
6
  var chunkDOLTCXCL_cjs = require('./chunk-DOLTCXCL.cjs');
7
7
  var _3d = require('@pixi/3d');
8
8
  var pixi_js = require('pixi.js');
@@ -247,7 +247,7 @@ async function layerTexture(ctx, name, options = {}) {
247
247
  var OWN_KEYS = ["width", "height", "view", "resolution", "setup", "update", "dispose", "followCamera", "followLights", "followFog", "reuse"];
248
248
  var THREE_ONLY = ["renderer", "shareGpu", "antialias"];
249
249
  var LAYER_OWNED = ["width", "height", "autoResize"];
250
- var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
250
+ var Scene3DSequence = class extends chunkVVUSZVP7_cjs.Sequence {
251
251
  _view = null;
252
252
  _ctx = null;
253
253
  _objects = {};
@@ -271,6 +271,8 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
271
271
  _borrowed = null;
272
272
  /** True once another layer took this layer's scene: destroying this one must not let it go. */
273
273
  _donated = false;
274
+ /** What setup left on the objects the keyframes reach, shared with a layer that takes the scene over (core/setupValues.ts). */
275
+ _setupValues = new chunkVVUSZVP7_cjs.SetupValues();
274
276
  _pendingRebinds = [];
275
277
  _lightMirror = null;
276
278
  _fogMirror = null;
@@ -301,14 +303,14 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
301
303
  if (this.duration === void 0) this.duration = this.parent?.duration ?? this.root.duration;
302
304
  this._checkKeys();
303
305
  this._checkTint();
304
- if (typeof spec.update === "function" && chunk33USHRV5_cjs.NOT_PURE.test(spec.update.toString())) {
306
+ if (typeof spec.update === "function" && chunkVVUSZVP7_cjs.NOT_PURE.test(spec.update.toString())) {
305
307
  this._say("pure", "update calls Math.random, Date.now, performance.now or new Date, so it is not deterministic: the same frame would draw differently in playback, in a seek and in an export. Derive the value from t");
306
308
  }
307
309
  const renderer = this.root.pixiRenderer;
308
310
  if (renderer && !renderer.renderPipes.view3d) {
309
311
  throw new Error(`${this._who()}: PixiJS 3D was loaded after the renderer started; import 'pixi-effects/3d' (and call register3D()) before movie.init`);
310
312
  }
311
- const scope = chunk33USHRV5_cjs.buildScope(this, this.parent, this.root);
313
+ const scope = chunkVVUSZVP7_cjs.buildScope(this, this.parent, this.root);
312
314
  const width = resolveDim(spec.width, scope) ?? this.parent?.width ?? this.root.width;
313
315
  const height = resolveDim(spec.height, scope) ?? this.parent?.height ?? this.root.height;
314
316
  const viewOptions = { ...spec.view ?? {} };
@@ -324,7 +326,7 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
324
326
  this.intrinsicWidth = width;
325
327
  this.intrinsicHeight = height;
326
328
  this._key = spec.reuse === false || !spec.name ? null : reuseKeyOf(spec, width, height);
327
- const donor = this._key !== null ? this.root.reuse?.claim(this._key) : null;
329
+ const donor = this._key !== null ? this.root.reuse?.claim(this._key, this) : null;
328
330
  if (donor && donor._lendable()) {
329
331
  this._borrow(donor, view, renderer ?? null, width, height);
330
332
  if (spec.followCamera) this._checkFollowShape(width, height);
@@ -367,6 +369,7 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
367
369
  const objects = { ...d._objects, ...d._objects.view === d._view ? { view } : {} };
368
370
  this._objects = objects;
369
371
  this._players = d._players;
372
+ this._setupValues = d._setupValues;
370
373
  const ctx = { view, root: view.root, camera: d._view.camera, renderer, width, height, objects };
371
374
  const host = this._makeHost(renderer);
372
375
  Object.defineProperty(ctx, HOST, { value: host, enumerable: false });
@@ -378,6 +381,7 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
378
381
  const d = this._borrowed, view = this._view, ctx = this._ctx;
379
382
  if (!d || !view || !ctx) return;
380
383
  const from = d._view;
384
+ this._setupValues.restore();
381
385
  const own = view.camera;
382
386
  for (const child of [...from.root.children]) view.root.addChild(child);
383
387
  view.camera = ctx.camera;
@@ -415,7 +419,7 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
415
419
  }
416
420
  /** Unknown keys (with the likely one), and the keys only a three layer has. */
417
421
  _checkKeys() {
418
- const valid = [...chunkABWRISRK_cjs.COMMON, ...OWN_KEYS];
422
+ const valid = [...chunk3FCDRLW3_cjs.COMMON, ...OWN_KEYS];
419
423
  for (const key of Object.keys(this.spec)) {
420
424
  if (valid.includes(key)) continue;
421
425
  if (THREE_ONLY.includes(key)) {
@@ -496,8 +500,8 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
496
500
  const current = view.filters ?? [];
497
501
  const others = current.filter((f) => f !== this._look && f !== this._blend);
498
502
  const authored = String(this.spec.blendMode ?? "normal");
499
- if (others.length === 0 && chunk5YNME6AH_cjs.isAdvancedBlend(authored) && !this._blend) {
500
- this._blend = chunk5YNME6AH_cjs.blendFilterFor(authored);
503
+ if (others.length === 0 && chunkGXGIISFS_cjs.isAdvancedBlend(authored) && !this._blend) {
504
+ this._blend = chunkGXGIISFS_cjs.blendFilterFor(authored);
501
505
  if (this._blend) view.blendMode = "normal";
502
506
  }
503
507
  const mode = String(view.blendMode ?? "normal");
@@ -782,7 +786,7 @@ var Scene3DSequence = class extends chunk33USHRV5_cjs.Sequence {
782
786
  this._warnPath(path, `no property "${prop}"`);
783
787
  return null;
784
788
  }
785
- return { target: obj, prop };
789
+ return this._borrowed ? this._setupValues.view(obj, prop, () => this._borrowed !== null) : (this._setupValues.note(obj, prop), { target: obj, prop });
786
790
  }
787
791
  _warnPath(path, why) {
788
792
  this._say(`path:${path}`, `keyframe path scene3d.${path}: ${why}; skipped`);
@@ -861,7 +865,7 @@ function reuseKeyOf(spec, width, height) {
861
865
  function resolveDim(v, scope) {
862
866
  if (v === void 0) return void 0;
863
867
  if (typeof v === "number") return v;
864
- return chunk33USHRV5_cjs.evaluateExpr(v, scope);
868
+ return chunkVVUSZVP7_cjs.evaluateExpr(v, scope);
865
869
  }
866
870
  var label2 = "pixi-effects: loadModel";
867
871
  async function loadModel(url, options = {}) {
@@ -947,7 +951,7 @@ function register3D() {
947
951
  }
948
952
  _3d.Model3D.defaultOptions.autoUpdate = false;
949
953
  _3d.AnimationPlayer.defaultOptions.autoUpdate = false;
950
- chunk33USHRV5_cjs.registerSequenceType("scene3d", Scene3DSequence);
954
+ chunkVVUSZVP7_cjs.registerSequenceType("scene3d", Scene3DSequence);
951
955
  }
952
956
  function scene3d(spec) {
953
957
  return spec;