pixi-effects 0.3.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 +24 -0
- package/README.md +6 -6
- package/ai/SKILL.md +3 -1
- package/ai/reference/cheatsheet.md +6 -5
- package/ai/reference/pitfalls.md +24 -3
- package/ai/template.html +3 -3
- package/dist/{Base-Ba4Ta4ap.d.ts → Base-5R7C5pHR.d.cts} +7 -1
- package/dist/{Base-BDw6dKRB.d.cts → Base-DhY9oMxr.d.ts} +7 -1
- package/dist/Composition-D7RCAGEA.cjs +13 -0
- package/dist/{Composition-6FDH5OPM.cjs.map → Composition-D7RCAGEA.cjs.map} +1 -1
- package/dist/Composition-RGTRZ2JX.js +4 -0
- package/dist/{Composition-FEYAUMFI.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-W8ISiEBB.d.cts → Movie-CghFXprP.d.cts} +1 -1
- package/dist/{Movie-DMpaT67V.d.ts → Movie-DRZtIGU7.d.ts} +1 -1
- package/dist/{chunk-SIRVULFF.cjs → chunk-6BQ6IEW2.cjs} +119 -36
- package/dist/chunk-6BQ6IEW2.cjs.map +1 -0
- package/dist/{chunk-DIJG2RSF.js → chunk-A574IA4F.js} +44 -6
- package/dist/chunk-A574IA4F.js.map +1 -0
- package/dist/{chunk-ZL262ZRM.cjs → chunk-QGBOC5YL.cjs} +56 -18
- package/dist/chunk-QGBOC5YL.cjs.map +1 -0
- package/dist/{chunk-PN5A6QA7.js → chunk-ZQX7WIYL.js} +119 -37
- package/dist/chunk-ZQX7WIYL.js.map +1 -0
- package/dist/index.cjs +58 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +50 -8
- 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-3c8Vymgw.d.cts → types-CRE9WKd4.d.cts} +6 -0
- package/dist/{types-3c8Vymgw.d.ts → types-CRE9WKd4.d.ts} +6 -0
- package/docs/dsl.md +12 -1
- package/llms-full.txt +45 -10
- package/package.json +2 -1
- package/dist/Composition-6FDH5OPM.cjs +0 -13
- package/dist/Composition-FEYAUMFI.js +0 -4
- package/dist/chunk-DIJG2RSF.js.map +0 -1
- package/dist/chunk-PN5A6QA7.js.map +0 -1
- package/dist/chunk-SIRVULFF.cjs.map +0 -1
- package/dist/chunk-ZL262ZRM.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/space/camera.ts","../src/space/depth.ts","../src/space/Layer3D.ts","../src/space/lint.ts","../src/core/blend.ts","../src/sequences/Composition.ts"],"names":["i","frameOf","Container"],"mappings":";;;;AAQO,SAAS,gBAAA,CACd,IAAA,EACA,CAAA,EACA,OAAA,EACU;AACV,EAAA,KAAA,IAAS,IAAI,IAAA,CAAK,MAAA,GAAS,CAAA,EAAG,CAAA,IAAK,GAAG,CAAA,EAAA,EAAK;AACzC,IAAA,MAAM,CAAA,GAAI,KAAK,CAAC,CAAA;AAChB,IAAA,MAAM,MAAA,GAAS,CAAA,IAAK,CAAA,CAAE,KAAA,KAAU,CAAA,GAAI,EAAE,GAAA,IAAQ,CAAA,CAAE,GAAA,IAAO,OAAA,IAAW,CAAA,IAAK,OAAA,CAAA;AACvE,IAAA,IAAI,QAAQ,OAAO,CAAA;AAAA,EACrB;AACA,EAAA,OAAO,IAAA;AACT;AAGO,SAAS,YAAY,IAAA,EAAwD;AAClF,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK;AACpC,IAAA,KAAA,IAAS,IAAI,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK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CAAE,OAAA,EAAQ;AAC1C,IAAA,IAAA,CAAK,YAAY,EAAC;AAClB,IAAA,KAAA,MAAW,CAAA,IAAK,IAAA,CAAK,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ;AAC1C,IAAA,KAAA,CAAM,OAAA,EAAQ;AAAA,EAChB;AACF;AAGA,SAAS,QAAQ,KAAA,EAAgF;AAC/F,EAAA,IAAI,iBAAiB,mBAAA,EAAqB;AACxC,IAAA,OAAO,OAAO,EAAE,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,KAAA,EAAO,KAAA,CAAM,cAAA,EAAgB,MAAA,EAAQ,KAAA,CAAM,eAAA,EAAgB,CAAA;AAAA,EACzF;AACA,EAAA,OAAO,MAAM,KAAA,CAAM,MAAA,CAAQ,cAAA,EAAe;AAC5C","file":"chunk-A574IA4F.js","sourcesContent":["/** A camera layer's lifespan on the global timeline, seconds. */\nexport interface CameraWindow { start: number; end: number }\n\n/**\n * The active camera at time `t`: the last-listed (top-most) camera whose\n * lifespan covers `t`. Windows are [start, end), except that a camera running\n * to the end of its composition also covers the final instant `t === compEnd`.\n */\nexport function pickActiveCamera<T extends CameraWindow>(\n cams: readonly T[],\n t: number,\n compEnd: number,\n): T | null {\n for (let i = cams.length - 1; i >= 0; i--) {\n const c = cams[i]!;\n const inside = t >= c.start && (t < c.end || (c.end >= compEnd && t <= compEnd));\n if (inside) return c;\n }\n return null;\n}\n\n/** First pair of camera indices whose lifespans strictly overlap, or null. */\nexport function findOverlap(cams: readonly CameraWindow[]): [number, number] | null {\n for (let i = 0; i < cams.length; i++) {\n for (let j = i + 1; j < cams.length; j++) {\n const a = cams[i]!;\n const b = cams[j]!;\n if (a.start < b.end && b.start < a.end) return [i, j];\n }\n }\n return null;\n}\n","export interface DepthItem {\n /** Position in the composition's stack (monotonic; gaps allowed). */\n stackIndex: number;\n threeD: boolean;\n /** Camera-space depth (larger = farther). Only read for threeD items. */\n depth: number;\n}\n\nconst finite = (n: number): number => (Number.isFinite(n) ? n : 0);\n\n/**\n * zIndex per item. Non-3D items keep their stack index. Each run of\n * consecutive threeD items is redistributed over the same index slots,\n * farthest first (drawn first), ties in stack order.\n */\nexport function assignDepthOrder(items: readonly DepthItem[]): number[] {\n const out = items.map(i => i.stackIndex);\n let i = 0;\n while (i < items.length) {\n if (!items[i]!.threeD) { i++; continue; }\n let j = i;\n while (j + 1 < items.length && items[j + 1]!.threeD) j++;\n const run = items.slice(i, j + 1).map((it, k) => ({ it, pos: i + k }));\n const slots = run.map(r => r.it.stackIndex);\n const farthestFirst = [...run].sort((a, b) => finite(b.it.depth) - finite(a.it.depth));\n farthestFirst.forEach((r, k) => { out[r.pos] = slots[k]!; });\n i = j + 1;\n }\n return out;\n}\n","import { Container, Matrix, PerspectiveMesh, RenderTexture, Texture } from 'pixi.js';\nimport type { Sequence } from '../sequences/Base';\nimport { describeLayer } from '../core/lint';\nimport { DEG, projectLayer, type CameraBasis, type LayerTransform, type Rect } from './math';\n\n/** Render textures are capped at this many pixels on the long side; larger layers are downscaled. */\nexport const MAX_TEXTURE_SIZE = 4096;\n/**\n * Render textures are drawn at this multiple of the layer size (until the caps),\n * so a layer enlarged by perspective (z > 0) stays sharp instead of showing\n * jagged edges and soft text.\n */\nexport const SUPERSAMPLE = 2;\n/** Total texture pixels per layer are capped here (≈ one 2048² target); resolution drops to fit. */\nexport const MAX_TEXTURE_PIXELS = 2048 * 2048;\n/** MSAA multiplies target memory ~4x, so only small textures get it (supersampling covers the rest). */\nexport const ANTIALIAS_MAX_PIXELS = 1024 * 1024;\n/** Mesh grid per side. 20 keeps steeply tilted planes free of visible affine warping. */\nexport const MESH_GRID = 20;\n\n/** The slice of a Pixi renderer Layer3D needs (also what tests fake). */\nexport interface SpaceHost {\n render(options: {\n container: Container;\n target: RenderTexture;\n transform: Matrix;\n clear: boolean;\n clearColor: number[];\n }): void;\n}\n\ntype Carrier = Container & { z?: number; rotationX?: number; rotationY?: number };\n\ninterface TextureSize { w: number; h: number; resolution: number; antialias: boolean }\n\n/** Sum of the target's filter paddings: the texture must be this much larger on every side or filter output is clipped. */\nfunction filterPadding(target: Container): number {\n const filters = (target as unknown as { filters?: ReadonlyArray<{ padding?: number }> | null }).filters;\n if (!Array.isArray(filters)) return 0;\n let pad = 0;\n for (const f of filters) pad += f?.padding ?? 0;\n return Number.isFinite(pad) && pad > 0 ? Math.ceil(pad) : 0;\n}\n\nexport function readLayerTransform(target: Container): LayerTransform {\n const c = target as Carrier;\n return {\n x: c.x, y: c.y, z: c.z ?? 0,\n rotationX: (c.rotationX ?? 0) * DEG,\n rotationY: (c.rotationY ?? 0) * DEG,\n rotationZ: c.rotation,\n scaleX: c.scale.x, scaleY: c.scale.y,\n pivotX: c.pivot.x, pivotY: c.pivot.y,\n };\n}\n\n/**\n * Draws one `threeD` sequence: its display object is rendered into a\n * RenderTexture (with its own 2D transform replaced, so layer-local content\n * lands at the texture origin) and shown on a PerspectiveMesh whose four\n * corners come from projecting the layer through the active camera.\n *\n * The sequence's `target` is never in the scene graph; the composition adds\n * `display` instead. `z`, `rotationX`, `rotationY` live on `target` as plain\n * numeric props so GSAP tweens them like any other prop.\n */\nexport class Layer3D {\n readonly display: PerspectiveMesh;\n /** Camera-space depth from the last update (larger = farther). */\n depth = 0;\n private rt: RenderTexture | null = null;\n /**\n * Textures replaced by a bigger / smaller one. Destroying one right away warns \"destroyed while still\n * bound\": the mesh's bind group still points at it until the next render. They go at the next update,\n * by which time a frame has been drawn with the new texture.\n */\n private retired: RenderTexture[] = [];\n private size: TextureSize | null = null;\n private warnedBehind = false;\n\n constructor(\n private readonly seq: Sequence,\n private readonly frameOf: () => Rect,\n ) {\n const target = seq.target as Carrier;\n target.z ??= 0;\n target.rotationX ??= 0;\n target.rotationY ??= 0;\n this.display = new PerspectiveMesh({ texture: Texture.WHITE, verticesX: MESH_GRID, verticesY: MESH_GRID });\n if (seq.spec.name) this.display.label = seq.spec.name;\n this.display.visible = false;\n }\n\n update(host: SpaceHost, basis: CameraBasis): void {\n this.flushRetired();\n const target = this.seq.target as Carrier | null;\n // Pixi skips rendering (and clearing) a container that is not `visible`\n // (e.g. PixiPlugin autoAlpha at alpha 0), which would leave a stale texture.\n if (!target || !target.renderable || !target.visible) return this.hide();\n\n const bounds = this.frameOf();\n const pad = filterPadding(target);\n const needW = Math.ceil(bounds.width + 2 * pad);\n const needH = Math.ceil(bounds.height + 2 * pad);\n if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();\n\n const size = this.sizeFor(needW, needH);\n // The quad covers exactly the texture's pixel rect in layer space.\n const frame: Rect = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };\n const projected = projectLayer(readLayerTransform(target), frame, basis);\n this.depth = projected.depth;\n if (!projected.visible) {\n if (!this.warnedBehind) {\n this.warnedBehind = true;\n console.warn(\n `pixi-effects: ${describeLayer(this.seq.spec)} is at or behind the camera plane (z = ${(target.z ?? 0).toFixed(0)}) and is hidden. ` +\n `If that is unintended, lower its z or move the camera back (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`,\n );\n }\n return this.hide();\n }\n\n this.ensureTexture(size);\n // `transform` replaces the container's own local transform for this render\n // (Pixi RenderGroupSystem), while `container.alpha` still applies — so the\n // texture carries the layer's alpha and the mesh alpha stays at 1.\n host.render({\n container: target,\n target: this.rt!,\n transform: new Matrix().translate(-frame.x, -frame.y),\n clear: true,\n clearColor: [0, 0, 0, 0],\n });\n this.display.geometry.setCorners(...projected.corners);\n this.display.visible = true;\n }\n\n destroy(): void {\n this.display.destroy();\n this.rt?.destroy(true);\n this.rt = null;\n this.flushRetired();\n }\n\n private flushRetired(): void {\n for (const t of this.retired) t.destroy(true);\n this.retired = [];\n }\n\n private hide(): void {\n this.display.visible = false;\n }\n\n /**\n * Texture size for content of w×h. An existing texture is kept while it is at\n * least that big and at most 2x too big, so content whose bounds change every\n * frame (typewriter text, growing shapes) does not reallocate each frame.\n */\n private sizeFor(w: number, h: number): TextureSize {\n const cur = this.size;\n if (cur && cur.w >= w && cur.h >= h && cur.w <= 2 * w && cur.h <= 2 * h) return cur;\n const resolution = Math.min(\n SUPERSAMPLE,\n MAX_TEXTURE_SIZE / Math.max(w, h),\n Math.sqrt(MAX_TEXTURE_PIXELS / (w * h)),\n );\n const antialias = w * h * resolution * resolution <= ANTIALIAS_MAX_PIXELS;\n return { w, h, resolution, antialias };\n }\n\n private ensureTexture(size: TextureSize): void {\n if (this.rt && this.size === size) return;\n // Same sampling: resize the texture where it is. Replacing it makes Pixi warn that the old one was\n // destroyed while still bound, because the mesh keeps pointing at it until the next render.\n if (this.rt && this.size && this.size.antialias === size.antialias) {\n this.rt.resize(size.w, size.h, size.resolution);\n this.size = size;\n return;\n }\n const next = RenderTexture.create({\n width: size.w, height: size.h, resolution: size.resolution, antialias: size.antialias,\n });\n this.display.texture = next;\n if (this.rt) this.retired.push(this.rt);\n this.rt = next;\n this.size = size;\n }\n}\n","import { collectPropKeys } from './specKeys';\nimport { describeLayer } from '../core/lint';\nimport type { SequenceSpec } from '../types';\n\ntype Warn = (message: string) => void;\nconst defaultWarn: Warn = m => console.warn(m);\n\nconst FOV_HINT = 'perspective is the camera\\'s \"fov\" — add a { type: \"camera\" } layer and set fov in its initial / keyframes';\n\n/** Keys that are never valid for any layer, with a hint at what the author probably meant. */\nconst LAYER_ALIASES: Record<string, string> = {\n rotateX: 'did you mean \"rotationX\"?',\n rotateY: 'did you mean \"rotationY\"?',\n rotateZ: 'did you mean \"rotation\"?',\n rotationZ: 'did you mean \"rotation\" (it is the Z rotation)?',\n translateZ: 'did you mean \"z\"?',\n depth: 'did you mean \"z\"?',\n posZ: 'did you mean \"z\"?',\n perspective: FOV_HINT,\n zoom: FOV_HINT,\n};\n\n/** Camera-only mistakes. */\nconst CAMERA_ALIASES: Record<string, string> = {\n pointOfInterest: 'did you mean \"lookAtX / lookAtY / lookAtZ\"?',\n lookAt: 'did you mean \"lookAtX / lookAtY / lookAtZ\"?',\n};\n\nconst CAMERA_PROPS = ['x', 'y', 'z', 'fov', 'lookAtX', 'lookAtY', 'lookAtZ'];\nconst NEEDS_THREE_D = ['z', 'rotationX', 'rotationY'];\nconst SKEW_KEYS = ['skew', 'skewX', 'skewY'];\n\n/**\n * Warn (never throw) about the inputs an AI author is most likely to get wrong,\n * with a message that says what to change. One call per layer, at build time.\n */\nexport function lintSequence(spec: SequenceSpec, warn: Warn = defaultWarn): void {\n const who = describeLayer(spec);\n const keys = collectPropKeys(spec);\n const explained = new Set<string>();\n\n for (const k of keys) {\n const hint = LAYER_ALIASES[k] ?? (spec.type === 'camera' ? CAMERA_ALIASES[k] : undefined);\n if (hint) {\n explained.add(k);\n warn(`pixi-effects: ${who}: \"${k}\" is not a property — ${hint}`);\n }\n }\n\n if (spec.type === 'camera') {\n const raw = spec as unknown as Record<string, unknown>;\n for (const p of CAMERA_PROPS) {\n if (p in raw) warn(`pixi-effects: ${who}: \"${p}\" must go inside initial / keyframes, not on the camera itself`);\n }\n for (const k of Object.keys(raw)) {\n const hint = CAMERA_ALIASES[k] ?? LAYER_ALIASES[k];\n if (hint) warn(`pixi-effects: ${who}: \"${k}\" is not a property — ${hint} (inside initial)`);\n }\n for (const k of keys) {\n if (!explained.has(k) && !CAMERA_PROPS.includes(k)) {\n warn(`pixi-effects: ${who}: \"${k}\" has no effect on a camera (use ${CAMERA_PROPS.join(', ')})`);\n }\n }\n return;\n }\n\n if (spec.type === 'audio') {\n if (spec.threeD) warn(`pixi-effects: ${who}: threeD has no effect on audio`);\n return;\n }\n\n if (!spec.threeD) {\n for (const k of NEEDS_THREE_D) {\n if (keys.has(k)) warn(`pixi-effects: ${who}: \"${k}\" needs threeD: true (it is ignored otherwise)`);\n }\n } else {\n for (const k of SKEW_KEYS) {\n if (keys.has(k)) warn(`pixi-effects: ${who}: \"${k}\" is ignored on threeD layers`);\n }\n }\n}\n","import { describeLayer } from './lint';\n\nconst MODES = ['normal', 'add', 'screen', 'multiply'];\n\n/** Apply a layer's `blendMode` to its display object; an unknown mode warns and is ignored. */\nexport function applyBlendMode(spec: { blendMode?: string; name?: string; type: string }, display: { blendMode?: unknown }): void {\n const mode = spec.blendMode;\n if (mode === undefined) return;\n if (!MODES.includes(mode)) {\n console.warn(`pixi-effects: ${describeLayer(spec)}: blendMode \"${mode}\" is not supported (use ${MODES.join(', ')})`);\n return;\n }\n display.blendMode = mode;\n}\n","import { Container, Rectangle } from 'pixi.js';\nimport { Sequence } from './Base';\nimport { buildSequenceTree } from '../core/Composition';\nimport { CameraSequence } from '../space/CameraSequence';\nimport { findOverlap, pickActiveCamera } from '../space/camera';\nimport { assignDepthOrder } from '../space/depth';\nimport { Layer3D, type SpaceHost } from '../space/Layer3D';\nimport { lintSequence } from '../space/lint';\nimport { describeLayer, lintText, lintTiming, summarizeWarnings } from '../core/lint';\nimport { applyBlendMode } from '../core/blend';\nimport { cameraBasis, homeCamera } from '../space/math';\nimport type { CompositionSequenceSpec, AudioDescriptor, CompositionShape, SequenceSpec } from '../types';\n\nimport type { gsap } from 'gsap';\ntype Timeline = ReturnType<typeof gsap.timeline>;\n\nexport class CompositionSequence extends Sequence {\n declare spec: CompositionSequenceSpec;\n private _innerContainer: Container | null = null;\n private _compositionShape: CompositionShape | null = null;\n _children: Sequence[] = [];\n private _cameras: CameraSequence[] = [];\n private _layers3d: Layer3D[] = [];\n /** Drawn children in stack order (cameras and target-less sequences excluded). */\n private _visual: Array<{ seq: Sequence; layer: Layer3D | null }> = [];\n\n async build(): Promise<void> {\n const width = this.spec.width ?? this.parent?.width ?? this.root.width;\n const height = this.spec.height ?? this.parent?.height ?? this.root.height;\n if (this.duration === undefined) {\n this.duration = this.spec.duration ?? this.parent?.duration ?? this.root.duration;\n }\n const wrapper = new Container();\n wrapper.cullable = true;\n wrapper.cullableChildren = true;\n wrapper.cullArea = new Rectangle(0, 0, width, height);\n\n const inner = new Container();\n inner.cullable = true;\n inner.cullableChildren = true;\n wrapper.addChild(inner);\n\n this.target = wrapper;\n this.intrinsicWidth = width;\n this.intrinsicHeight = height;\n this._innerContainer = inner;\n this._compositionShape = { width, height, duration: this.duration };\n\n const lateKeyframes: string[] = [];\n for (const s of this.spec.sequences ?? []) {\n lintSequence(s);\n lintTiming(s, this.duration, (message, kind) => (kind === 'late-keyframe' ? lateKeyframes.push(message) : console.warn(message)));\n lintText(s);\n }\n for (const message of summarizeWarnings(lateKeyframes)) console.warn(message);\n\n this._children = await buildSequenceTree(\n this.spec.sequences ?? [],\n this._compositionShape,\n this.root,\n );\n for (const child of this._children) {\n // Cameras are display-less: they only feed the projection pass.\n if (child instanceof CameraSequence) {\n this._cameras.push(child);\n continue;\n }\n if (!child.target) continue;\n\n const maskSpec = (child.spec as { mask?: SequenceSpec }).mask;\n\n // threeD layers never enter the scene graph themselves: their display\n // object is rendered into a texture and a perspective mesh stands in.\n if (child.spec.threeD) {\n const layer = new Layer3D(child, frameOf(child));\n inner.addChild(layer.display);\n this._layers3d.push(layer);\n this._visual.push({ seq: child, layer });\n applyBlendMode(child.spec, layer.display);\n if (maskSpec) {\n console.warn(`pixi-effects: ${describeLayer(child.spec)}: mask is not supported on threeD layers yet; ignored`);\n }\n continue;\n }\n\n inner.addChild(child.target);\n this._visual.push({ seq: child, layer: null });\n applyBlendMode(child.spec, child.target);\n // If this child has a `mask` spec, build the mask sequence in the same\n // composition shape, add its target to the same parent (so its\n // transforms resolve in the same coord space), and wire PIXI's\n // mask channel. PIXI v8 renders mask containers into the stencil /\n // alpha buffer; they don't render as normal children.\n if (maskSpec) {\n // The mask lives and animates with the layer it masks: with no `at` of its own its `at` and\n // `duration` are the layer's, so its keyframes are measured from the layer's start too. An\n // explicit `at` is composition time, exactly like a layer's.\n const lifetime = maskSpec.at === undefined\n ? { at: child.at, duration: maskSpec.duration ?? child.duration }\n : {};\n const built = await buildSequenceTree([{ ...maskSpec, ...lifetime } as SequenceSpec], this._compositionShape, this.root);\n const maskSeq = built[0];\n if (maskSeq?.target) {\n inner.addChild(maskSeq.target);\n // PIXI v8 `setMask` accepts an `inverse` flag — that's how we\n // expose `maskInverted` from the spec. Falls back to plain\n // `target.mask = …` for runtimes that don't have setMask\n // (older PIXI builds).\n const inverse = (child.spec as { maskInverted?: boolean }).maskInverted ?? false;\n const t = child.target as Container & {\n setMask?: (opts: { mask: Container | null; inverse?: boolean }) => void;\n mask: Container | null;\n };\n if (typeof t.setMask === 'function') {\n t.setMask({ mask: maskSeq.target, inverse });\n } else {\n t.mask = maskSeq.target;\n }\n child.maskSequence = maskSeq;\n }\n }\n }\n\n if (this._layers3d.length > 0) {\n // Stack order becomes explicit zIndex so threeD layers can be re-sorted\n // by depth each frame without reparenting.\n inner.sortableChildren = true;\n this._visual.forEach((v, i) => {\n (v.layer?.display ?? v.seq.target!).zIndex = i;\n });\n } else if (this._cameras.length > 0) {\n console.warn('pixi-effects: camera has no effect: this composition has no threeD layers');\n }\n\n this.buildFilters();\n }\n\n override bindTimeline(timeline: Timeline, offset = 0): void {\n super.bindTimeline(timeline, offset);\n // Children's `at` is relative to this composition's start, so push them\n // forward by our absolute start time on the global timeline.\n const childOffset = offset + this.at;\n for (const child of this._children) {\n child.bindTimeline(timeline, childOffset);\n // The mask shares the maskee's offset — its `at` is interpreted\n // relative to the composition's start, just like the child itself,\n // so a reveal-from-zero animation lines up naturally.\n child.maskSequence?.bindTimeline(timeline, childOffset);\n }\n const overlap = findOverlap(this._cameras.map(c => c.window()));\n if (overlap) {\n console.warn(`pixi-effects: cameras #${overlap[0] + 1} and #${overlap[1] + 1} overlap in time; the top-most one wins`);\n }\n }\n\n /** Drawn children in stack order, with the display object that stands in for each (the mesh for a threeD layer). */\n layers(): Array<{ seq: Sequence; display: Container; threeD: boolean }> {\n return this._visual.map(v => ({\n seq: v.seq,\n display: (v.layer?.display ?? v.seq.target!) as unknown as Container,\n threeD: v.layer !== null,\n }));\n }\n\n override syncFrame(): void {\n super.syncFrame();\n for (const child of this._children) child.syncFrame();\n }\n\n override updateSpace(t: number, host: SpaceHost): void {\n // Inner compositions first: a threeD composition is rendered into its own\n // texture by this level, so its content must already be projected.\n for (const child of this._children) child.updateSpace(t, host);\n if (this._layers3d.length === 0 || !this._compositionShape) return;\n\n const { width, height } = this._compositionShape;\n const compEnd = (this.absoluteStart ?? 0) + (this.duration ?? 0);\n const active = pickActiveCamera(\n this._cameras.map(cam => ({ cam, ...cam.window() })),\n t,\n compEnd,\n );\n const basis = cameraBasis(active ? active.cam.state() : homeCamera(width, height), width, height);\n\n for (const layer of this._layers3d) layer.update(host, basis);\n\n const order = assignDepthOrder(\n this._visual.map((v, i) => ({ stackIndex: i, threeD: v.layer !== null, depth: v.layer?.depth ?? 0 })),\n );\n this._visual.forEach((v, i) => {\n if (v.layer) v.layer.display.zIndex = order[i]!;\n });\n }\n\n override collectAudio(out: AudioDescriptor[], baseTime: number): void {\n super.collectAudio(out, baseTime);\n const childBase = baseTime + this.at;\n for (const child of this._children) child.collectAudio(out, childBase);\n }\n\n override destroy(): void {\n for (const l of this._layers3d) l.destroy();\n this._layers3d = [];\n for (const c of this._children) c.destroy();\n super.destroy();\n }\n}\n\n/** Layer-space rectangle a threeD child projects: a composition's frame, otherwise its content bounds. */\nfunction frameOf(child: Sequence): () => { x: number; y: number; width: number; height: number } {\n if (child instanceof CompositionSequence) {\n return () => ({ x: 0, y: 0, width: child.intrinsicWidth, height: child.intrinsicHeight });\n }\n return () => child.target!.getLocalBounds();\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6BQ6IEW2_cjs = require('./chunk-6BQ6IEW2.cjs');
|
|
4
4
|
var pixi_js = require('pixi.js');
|
|
5
5
|
|
|
6
6
|
// src/space/camera.ts
|
|
@@ -63,8 +63,8 @@ function readLayerTransform(target) {
|
|
|
63
63
|
x: c.x,
|
|
64
64
|
y: c.y,
|
|
65
65
|
z: c.z ?? 0,
|
|
66
|
-
rotationX: (c.rotationX ?? 0) *
|
|
67
|
-
rotationY: (c.rotationY ?? 0) *
|
|
66
|
+
rotationX: (c.rotationX ?? 0) * chunk6BQ6IEW2_cjs.DEG,
|
|
67
|
+
rotationY: (c.rotationY ?? 0) * chunk6BQ6IEW2_cjs.DEG,
|
|
68
68
|
rotationZ: c.rotation,
|
|
69
69
|
scaleX: c.scale.x,
|
|
70
70
|
scaleY: c.scale.y,
|
|
@@ -90,9 +90,16 @@ var Layer3D = class {
|
|
|
90
90
|
/** Camera-space depth from the last update (larger = farther). */
|
|
91
91
|
depth = 0;
|
|
92
92
|
rt = null;
|
|
93
|
+
/**
|
|
94
|
+
* Textures replaced by a bigger / smaller one. Destroying one right away warns "destroyed while still
|
|
95
|
+
* bound": the mesh's bind group still points at it until the next render. They go at the next update,
|
|
96
|
+
* by which time a frame has been drawn with the new texture.
|
|
97
|
+
*/
|
|
98
|
+
retired = [];
|
|
93
99
|
size = null;
|
|
94
100
|
warnedBehind = false;
|
|
95
101
|
update(host, basis) {
|
|
102
|
+
this.flushRetired();
|
|
96
103
|
const target = this.seq.target;
|
|
97
104
|
if (!target || !target.renderable || !target.visible) return this.hide();
|
|
98
105
|
const bounds = this.frameOf();
|
|
@@ -102,13 +109,13 @@ var Layer3D = class {
|
|
|
102
109
|
if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();
|
|
103
110
|
const size = this.sizeFor(needW, needH);
|
|
104
111
|
const frame = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };
|
|
105
|
-
const projected =
|
|
112
|
+
const projected = chunk6BQ6IEW2_cjs.projectLayer(readLayerTransform(target), frame, basis);
|
|
106
113
|
this.depth = projected.depth;
|
|
107
114
|
if (!projected.visible) {
|
|
108
115
|
if (!this.warnedBehind) {
|
|
109
116
|
this.warnedBehind = true;
|
|
110
117
|
console.warn(
|
|
111
|
-
`pixi-effects: ${
|
|
118
|
+
`pixi-effects: ${chunk6BQ6IEW2_cjs.describeLayer(this.seq.spec)} is at or behind the camera plane (z = ${(target.z ?? 0).toFixed(0)}) and is hidden. If that is unintended, lower its z or move the camera back (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
|
|
112
119
|
);
|
|
113
120
|
}
|
|
114
121
|
return this.hide();
|
|
@@ -128,6 +135,11 @@ var Layer3D = class {
|
|
|
128
135
|
this.display.destroy();
|
|
129
136
|
this.rt?.destroy(true);
|
|
130
137
|
this.rt = null;
|
|
138
|
+
this.flushRetired();
|
|
139
|
+
}
|
|
140
|
+
flushRetired() {
|
|
141
|
+
for (const t of this.retired) t.destroy(true);
|
|
142
|
+
this.retired = [];
|
|
131
143
|
}
|
|
132
144
|
hide() {
|
|
133
145
|
this.display.visible = false;
|
|
@@ -150,6 +162,11 @@ var Layer3D = class {
|
|
|
150
162
|
}
|
|
151
163
|
ensureTexture(size) {
|
|
152
164
|
if (this.rt && this.size === size) return;
|
|
165
|
+
if (this.rt && this.size && this.size.antialias === size.antialias) {
|
|
166
|
+
this.rt.resize(size.w, size.h, size.resolution);
|
|
167
|
+
this.size = size;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
153
170
|
const next = pixi_js.RenderTexture.create({
|
|
154
171
|
width: size.w,
|
|
155
172
|
height: size.h,
|
|
@@ -157,7 +174,7 @@ var Layer3D = class {
|
|
|
157
174
|
antialias: size.antialias
|
|
158
175
|
});
|
|
159
176
|
this.display.texture = next;
|
|
160
|
-
this.rt
|
|
177
|
+
if (this.rt) this.retired.push(this.rt);
|
|
161
178
|
this.rt = next;
|
|
162
179
|
this.size = size;
|
|
163
180
|
}
|
|
@@ -185,8 +202,8 @@ var CAMERA_PROPS = ["x", "y", "z", "fov", "lookAtX", "lookAtY", "lookAtZ"];
|
|
|
185
202
|
var NEEDS_THREE_D = ["z", "rotationX", "rotationY"];
|
|
186
203
|
var SKEW_KEYS = ["skew", "skewX", "skewY"];
|
|
187
204
|
function lintSequence(spec, warn = defaultWarn) {
|
|
188
|
-
const who =
|
|
189
|
-
const keys =
|
|
205
|
+
const who = chunk6BQ6IEW2_cjs.describeLayer(spec);
|
|
206
|
+
const keys = chunk6BQ6IEW2_cjs.collectPropKeys(spec);
|
|
190
207
|
const explained = /* @__PURE__ */ new Set();
|
|
191
208
|
for (const k of keys) {
|
|
192
209
|
const hint = LAYER_ALIASES[k] ?? (spec.type === "camera" ? CAMERA_ALIASES[k] : void 0);
|
|
@@ -226,8 +243,20 @@ function lintSequence(spec, warn = defaultWarn) {
|
|
|
226
243
|
}
|
|
227
244
|
}
|
|
228
245
|
|
|
246
|
+
// src/core/blend.ts
|
|
247
|
+
var MODES = ["normal", "add", "screen", "multiply"];
|
|
248
|
+
function applyBlendMode(spec, display) {
|
|
249
|
+
const mode = spec.blendMode;
|
|
250
|
+
if (mode === void 0) return;
|
|
251
|
+
if (!MODES.includes(mode)) {
|
|
252
|
+
console.warn(`pixi-effects: ${chunk6BQ6IEW2_cjs.describeLayer(spec)}: blendMode "${mode}" is not supported (use ${MODES.join(", ")})`);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
display.blendMode = mode;
|
|
256
|
+
}
|
|
257
|
+
|
|
229
258
|
// src/sequences/Composition.ts
|
|
230
|
-
var CompositionSequence = class extends
|
|
259
|
+
var CompositionSequence = class extends chunk6BQ6IEW2_cjs.Sequence {
|
|
231
260
|
_innerContainer = null;
|
|
232
261
|
_compositionShape = null;
|
|
233
262
|
_children = [];
|
|
@@ -254,18 +283,20 @@ var CompositionSequence = class extends chunkSIRVULFF_cjs.Sequence {
|
|
|
254
283
|
this.intrinsicHeight = height;
|
|
255
284
|
this._innerContainer = inner;
|
|
256
285
|
this._compositionShape = { width, height, duration: this.duration };
|
|
286
|
+
const lateKeyframes = [];
|
|
257
287
|
for (const s of this.spec.sequences ?? []) {
|
|
258
288
|
lintSequence(s);
|
|
259
|
-
|
|
260
|
-
|
|
289
|
+
chunk6BQ6IEW2_cjs.lintTiming(s, this.duration, (message, kind) => kind === "late-keyframe" ? lateKeyframes.push(message) : console.warn(message));
|
|
290
|
+
chunk6BQ6IEW2_cjs.lintText(s);
|
|
261
291
|
}
|
|
262
|
-
|
|
292
|
+
for (const message of chunk6BQ6IEW2_cjs.summarizeWarnings(lateKeyframes)) console.warn(message);
|
|
293
|
+
this._children = await chunk6BQ6IEW2_cjs.buildSequenceTree(
|
|
263
294
|
this.spec.sequences ?? [],
|
|
264
295
|
this._compositionShape,
|
|
265
296
|
this.root
|
|
266
297
|
);
|
|
267
298
|
for (const child of this._children) {
|
|
268
|
-
if (child instanceof
|
|
299
|
+
if (child instanceof chunk6BQ6IEW2_cjs.CameraSequence) {
|
|
269
300
|
this._cameras.push(child);
|
|
270
301
|
continue;
|
|
271
302
|
}
|
|
@@ -276,15 +307,18 @@ var CompositionSequence = class extends chunkSIRVULFF_cjs.Sequence {
|
|
|
276
307
|
inner.addChild(layer.display);
|
|
277
308
|
this._layers3d.push(layer);
|
|
278
309
|
this._visual.push({ seq: child, layer });
|
|
310
|
+
applyBlendMode(child.spec, layer.display);
|
|
279
311
|
if (maskSpec) {
|
|
280
|
-
console.warn(`pixi-effects: ${
|
|
312
|
+
console.warn(`pixi-effects: ${chunk6BQ6IEW2_cjs.describeLayer(child.spec)}: mask is not supported on threeD layers yet; ignored`);
|
|
281
313
|
}
|
|
282
314
|
continue;
|
|
283
315
|
}
|
|
284
316
|
inner.addChild(child.target);
|
|
285
317
|
this._visual.push({ seq: child, layer: null });
|
|
318
|
+
applyBlendMode(child.spec, child.target);
|
|
286
319
|
if (maskSpec) {
|
|
287
|
-
const
|
|
320
|
+
const lifetime = maskSpec.at === void 0 ? { at: child.at, duration: maskSpec.duration ?? child.duration } : {};
|
|
321
|
+
const built = await chunk6BQ6IEW2_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
|
|
288
322
|
const maskSeq = built[0];
|
|
289
323
|
if (maskSeq?.target) {
|
|
290
324
|
inner.addChild(maskSeq.target);
|
|
@@ -329,6 +363,10 @@ var CompositionSequence = class extends chunkSIRVULFF_cjs.Sequence {
|
|
|
329
363
|
threeD: v.layer !== null
|
|
330
364
|
}));
|
|
331
365
|
}
|
|
366
|
+
syncFrame() {
|
|
367
|
+
super.syncFrame();
|
|
368
|
+
for (const child of this._children) child.syncFrame();
|
|
369
|
+
}
|
|
332
370
|
updateSpace(t, host) {
|
|
333
371
|
for (const child of this._children) child.updateSpace(t, host);
|
|
334
372
|
if (this._layers3d.length === 0 || !this._compositionShape) return;
|
|
@@ -339,7 +377,7 @@ var CompositionSequence = class extends chunkSIRVULFF_cjs.Sequence {
|
|
|
339
377
|
t,
|
|
340
378
|
compEnd
|
|
341
379
|
);
|
|
342
|
-
const basis =
|
|
380
|
+
const basis = chunk6BQ6IEW2_cjs.cameraBasis(active ? active.cam.state() : chunk6BQ6IEW2_cjs.homeCamera(width, height), width, height);
|
|
343
381
|
for (const layer of this._layers3d) layer.update(host, basis);
|
|
344
382
|
const order = assignDepthOrder(
|
|
345
383
|
this._visual.map((v, i) => ({ stackIndex: i, threeD: v.layer !== null, depth: v.layer?.depth ?? 0 }))
|
|
@@ -368,5 +406,5 @@ function frameOf(child) {
|
|
|
368
406
|
}
|
|
369
407
|
|
|
370
408
|
exports.CompositionSequence = CompositionSequence;
|
|
371
|
-
//# sourceMappingURL=chunk-
|
|
372
|
-
//# sourceMappingURL=chunk-
|
|
409
|
+
//# sourceMappingURL=chunk-QGBOC5YL.cjs.map
|
|
410
|
+
//# sourceMappingURL=chunk-QGBOC5YL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/space/camera.ts","../src/space/depth.ts","../src/space/Layer3D.ts","../src/space/lint.ts","../src/core/blend.ts","../src/sequences/Composition.ts"],"names":["i","DEG","frameOf","PerspectiveMesh","Texture","projectLayer","describeLayer","Matrix","RenderTexture","collectPropKeys","Sequence","Container","Rectangle","lintTiming","lintText","summarizeWarnings","buildSequenceTree","CameraSequence","cameraBasis","homeCamera"],"mappings":";;;;;;AA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-QGBOC5YL.cjs","sourcesContent":["/** A camera layer's lifespan on the global timeline, seconds. */\nexport interface CameraWindow { start: number; end: number }\n\n/**\n * The active camera at time `t`: the last-listed (top-most) camera whose\n * lifespan covers `t`. Windows are [start, end), except that a camera running\n * to the end of its composition also covers the final instant `t === compEnd`.\n */\nexport function pickActiveCamera<T extends CameraWindow>(\n cams: readonly T[],\n t: number,\n compEnd: number,\n): T | null {\n for (let i = cams.length - 1; i >= 0; i--) {\n const c = cams[i]!;\n const inside = t >= c.start && (t < c.end || (c.end >= compEnd && t <= compEnd));\n if (inside) return c;\n }\n return null;\n}\n\n/** First pair of camera indices whose lifespans strictly overlap, or null. */\nexport function findOverlap(cams: readonly CameraWindow[]): [number, number] | null {\n for (let i = 0; i < cams.length; i++) {\n for (let j = i + 1; j < cams.length; j++) {\n const a = cams[i]!;\n const b = cams[j]!;\n if (a.start < b.end && b.start < a.end) return [i, j];\n }\n }\n return null;\n}\n","export interface DepthItem {\n /** Position in the composition's stack (monotonic; gaps allowed). */\n stackIndex: number;\n threeD: boolean;\n /** Camera-space depth (larger = farther). Only read for threeD items. */\n depth: number;\n}\n\nconst finite = (n: number): number => (Number.isFinite(n) ? n : 0);\n\n/**\n * zIndex per item. Non-3D items keep their stack index. Each run of\n * consecutive threeD items is redistributed over the same index slots,\n * farthest first (drawn first), ties in stack order.\n */\nexport function assignDepthOrder(items: readonly DepthItem[]): number[] {\n const out = items.map(i => i.stackIndex);\n let i = 0;\n while (i < items.length) {\n if (!items[i]!.threeD) { i++; continue; }\n let j = i;\n while (j + 1 < items.length && items[j + 1]!.threeD) j++;\n const run = items.slice(i, j + 1).map((it, k) => ({ it, pos: i + k }));\n const slots = run.map(r => r.it.stackIndex);\n const farthestFirst = [...run].sort((a, b) => finite(b.it.depth) - finite(a.it.depth));\n farthestFirst.forEach((r, k) => { out[r.pos] = slots[k]!; });\n i = j + 1;\n }\n return out;\n}\n","import { Container, Matrix, PerspectiveMesh, RenderTexture, Texture } from 'pixi.js';\nimport type { Sequence } from '../sequences/Base';\nimport { describeLayer } from '../core/lint';\nimport { DEG, projectLayer, type CameraBasis, type LayerTransform, type Rect } from './math';\n\n/** Render textures are capped at this many pixels on the long side; larger layers are downscaled. */\nexport const MAX_TEXTURE_SIZE = 4096;\n/**\n * Render textures are drawn at this multiple of the layer size (until the caps),\n * so a layer enlarged by perspective (z > 0) stays sharp instead of showing\n * jagged edges and soft text.\n */\nexport const SUPERSAMPLE = 2;\n/** Total texture pixels per layer are capped here (≈ one 2048² target); resolution drops to fit. */\nexport const MAX_TEXTURE_PIXELS = 2048 * 2048;\n/** MSAA multiplies target memory ~4x, so only small textures get it (supersampling covers the rest). */\nexport const ANTIALIAS_MAX_PIXELS = 1024 * 1024;\n/** Mesh grid per side. 20 keeps steeply tilted planes free of visible affine warping. */\nexport const MESH_GRID = 20;\n\n/** The slice of a Pixi renderer Layer3D needs (also what tests fake). */\nexport interface SpaceHost {\n render(options: {\n container: Container;\n target: RenderTexture;\n transform: Matrix;\n clear: boolean;\n clearColor: number[];\n }): void;\n}\n\ntype Carrier = Container & { z?: number; rotationX?: number; rotationY?: number };\n\ninterface TextureSize { w: number; h: number; resolution: number; antialias: boolean }\n\n/** Sum of the target's filter paddings: the texture must be this much larger on every side or filter output is clipped. */\nfunction filterPadding(target: Container): number {\n const filters = (target as unknown as { filters?: ReadonlyArray<{ padding?: number }> | null }).filters;\n if (!Array.isArray(filters)) return 0;\n let pad = 0;\n for (const f of filters) pad += f?.padding ?? 0;\n return Number.isFinite(pad) && pad > 0 ? Math.ceil(pad) : 0;\n}\n\nexport function readLayerTransform(target: Container): LayerTransform {\n const c = target as Carrier;\n return {\n x: c.x, y: c.y, z: c.z ?? 0,\n rotationX: (c.rotationX ?? 0) * DEG,\n rotationY: (c.rotationY ?? 0) * DEG,\n rotationZ: c.rotation,\n scaleX: c.scale.x, scaleY: c.scale.y,\n pivotX: c.pivot.x, pivotY: c.pivot.y,\n };\n}\n\n/**\n * Draws one `threeD` sequence: its display object is rendered into a\n * RenderTexture (with its own 2D transform replaced, so layer-local content\n * lands at the texture origin) and shown on a PerspectiveMesh whose four\n * corners come from projecting the layer through the active camera.\n *\n * The sequence's `target` is never in the scene graph; the composition adds\n * `display` instead. `z`, `rotationX`, `rotationY` live on `target` as plain\n * numeric props so GSAP tweens them like any other prop.\n */\nexport class Layer3D {\n readonly display: PerspectiveMesh;\n /** Camera-space depth from the last update (larger = farther). */\n depth = 0;\n private rt: RenderTexture | null = null;\n /**\n * Textures replaced by a bigger / smaller one. Destroying one right away warns \"destroyed while still\n * bound\": the mesh's bind group still points at it until the next render. They go at the next update,\n * by which time a frame has been drawn with the new texture.\n */\n private retired: RenderTexture[] = [];\n private size: TextureSize | null = null;\n private warnedBehind = false;\n\n constructor(\n private readonly seq: Sequence,\n private readonly frameOf: () => Rect,\n ) {\n const target = seq.target as Carrier;\n target.z ??= 0;\n target.rotationX ??= 0;\n target.rotationY ??= 0;\n this.display = new PerspectiveMesh({ texture: Texture.WHITE, verticesX: MESH_GRID, verticesY: MESH_GRID });\n if (seq.spec.name) this.display.label = seq.spec.name;\n this.display.visible = false;\n }\n\n update(host: SpaceHost, basis: CameraBasis): void {\n this.flushRetired();\n const target = this.seq.target as Carrier | null;\n // Pixi skips rendering (and clearing) a container that is not `visible`\n // (e.g. PixiPlugin autoAlpha at alpha 0), which would leave a stale texture.\n if (!target || !target.renderable || !target.visible) return this.hide();\n\n const bounds = this.frameOf();\n const pad = filterPadding(target);\n const needW = Math.ceil(bounds.width + 2 * pad);\n const needH = Math.ceil(bounds.height + 2 * pad);\n if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();\n\n const size = this.sizeFor(needW, needH);\n // The quad covers exactly the texture's pixel rect in layer space.\n const frame: Rect = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };\n const projected = projectLayer(readLayerTransform(target), frame, basis);\n this.depth = projected.depth;\n if (!projected.visible) {\n if (!this.warnedBehind) {\n this.warnedBehind = true;\n console.warn(\n `pixi-effects: ${describeLayer(this.seq.spec)} is at or behind the camera plane (z = ${(target.z ?? 0).toFixed(0)}) and is hidden. ` +\n `If that is unintended, lower its z or move the camera back (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`,\n );\n }\n return this.hide();\n }\n\n this.ensureTexture(size);\n // `transform` replaces the container's own local transform for this render\n // (Pixi RenderGroupSystem), while `container.alpha` still applies — so the\n // texture carries the layer's alpha and the mesh alpha stays at 1.\n host.render({\n container: target,\n target: this.rt!,\n transform: new Matrix().translate(-frame.x, -frame.y),\n clear: true,\n clearColor: [0, 0, 0, 0],\n });\n this.display.geometry.setCorners(...projected.corners);\n this.display.visible = true;\n }\n\n destroy(): void {\n this.display.destroy();\n this.rt?.destroy(true);\n this.rt = null;\n this.flushRetired();\n }\n\n private flushRetired(): void {\n for (const t of this.retired) t.destroy(true);\n this.retired = [];\n }\n\n private hide(): void {\n this.display.visible = false;\n }\n\n /**\n * Texture size for content of w×h. An existing texture is kept while it is at\n * least that big and at most 2x too big, so content whose bounds change every\n * frame (typewriter text, growing shapes) does not reallocate each frame.\n */\n private sizeFor(w: number, h: number): TextureSize {\n const cur = this.size;\n if (cur && cur.w >= w && cur.h >= h && cur.w <= 2 * w && cur.h <= 2 * h) return cur;\n const resolution = Math.min(\n SUPERSAMPLE,\n MAX_TEXTURE_SIZE / Math.max(w, h),\n Math.sqrt(MAX_TEXTURE_PIXELS / (w * h)),\n );\n const antialias = w * h * resolution * resolution <= ANTIALIAS_MAX_PIXELS;\n return { w, h, resolution, antialias };\n }\n\n private ensureTexture(size: TextureSize): void {\n if (this.rt && this.size === size) return;\n // Same sampling: resize the texture where it is. Replacing it makes Pixi warn that the old one was\n // destroyed while still bound, because the mesh keeps pointing at it until the next render.\n if (this.rt && this.size && this.size.antialias === size.antialias) {\n this.rt.resize(size.w, size.h, size.resolution);\n this.size = size;\n return;\n }\n const next = RenderTexture.create({\n width: size.w, height: size.h, resolution: size.resolution, antialias: size.antialias,\n });\n this.display.texture = next;\n if (this.rt) this.retired.push(this.rt);\n this.rt = next;\n this.size = size;\n }\n}\n","import { collectPropKeys } from './specKeys';\nimport { describeLayer } from '../core/lint';\nimport type { SequenceSpec } from '../types';\n\ntype Warn = (message: string) => void;\nconst defaultWarn: Warn = m => console.warn(m);\n\nconst FOV_HINT = 'perspective is the camera\\'s \"fov\" — add a { type: \"camera\" } layer and set fov in its initial / keyframes';\n\n/** Keys that are never valid for any layer, with a hint at what the author probably meant. */\nconst LAYER_ALIASES: Record<string, string> = {\n rotateX: 'did you mean \"rotationX\"?',\n rotateY: 'did you mean \"rotationY\"?',\n rotateZ: 'did you mean \"rotation\"?',\n rotationZ: 'did you mean \"rotation\" (it is the Z rotation)?',\n translateZ: 'did you mean \"z\"?',\n depth: 'did you mean \"z\"?',\n posZ: 'did you mean \"z\"?',\n perspective: FOV_HINT,\n zoom: FOV_HINT,\n};\n\n/** Camera-only mistakes. */\nconst CAMERA_ALIASES: Record<string, string> = {\n pointOfInterest: 'did you mean \"lookAtX / lookAtY / lookAtZ\"?',\n lookAt: 'did you mean \"lookAtX / lookAtY / lookAtZ\"?',\n};\n\nconst CAMERA_PROPS = ['x', 'y', 'z', 'fov', 'lookAtX', 'lookAtY', 'lookAtZ'];\nconst NEEDS_THREE_D = ['z', 'rotationX', 'rotationY'];\nconst SKEW_KEYS = ['skew', 'skewX', 'skewY'];\n\n/**\n * Warn (never throw) about the inputs an AI author is most likely to get wrong,\n * with a message that says what to change. One call per layer, at build time.\n */\nexport function lintSequence(spec: SequenceSpec, warn: Warn = defaultWarn): void {\n const who = describeLayer(spec);\n const keys = collectPropKeys(spec);\n const explained = new Set<string>();\n\n for (const k of keys) {\n const hint = LAYER_ALIASES[k] ?? (spec.type === 'camera' ? CAMERA_ALIASES[k] : undefined);\n if (hint) {\n explained.add(k);\n warn(`pixi-effects: ${who}: \"${k}\" is not a property — ${hint}`);\n }\n }\n\n if (spec.type === 'camera') {\n const raw = spec as unknown as Record<string, unknown>;\n for (const p of CAMERA_PROPS) {\n if (p in raw) warn(`pixi-effects: ${who}: \"${p}\" must go inside initial / keyframes, not on the camera itself`);\n }\n for (const k of Object.keys(raw)) {\n const hint = CAMERA_ALIASES[k] ?? LAYER_ALIASES[k];\n if (hint) warn(`pixi-effects: ${who}: \"${k}\" is not a property — ${hint} (inside initial)`);\n }\n for (const k of keys) {\n if (!explained.has(k) && !CAMERA_PROPS.includes(k)) {\n warn(`pixi-effects: ${who}: \"${k}\" has no effect on a camera (use ${CAMERA_PROPS.join(', ')})`);\n }\n }\n return;\n }\n\n if (spec.type === 'audio') {\n if (spec.threeD) warn(`pixi-effects: ${who}: threeD has no effect on audio`);\n return;\n }\n\n if (!spec.threeD) {\n for (const k of NEEDS_THREE_D) {\n if (keys.has(k)) warn(`pixi-effects: ${who}: \"${k}\" needs threeD: true (it is ignored otherwise)`);\n }\n } else {\n for (const k of SKEW_KEYS) {\n if (keys.has(k)) warn(`pixi-effects: ${who}: \"${k}\" is ignored on threeD layers`);\n }\n }\n}\n","import { describeLayer } from './lint';\n\nconst MODES = ['normal', 'add', 'screen', 'multiply'];\n\n/** Apply a layer's `blendMode` to its display object; an unknown mode warns and is ignored. */\nexport function applyBlendMode(spec: { blendMode?: string; name?: string; type: string }, display: { blendMode?: unknown }): void {\n const mode = spec.blendMode;\n if (mode === undefined) return;\n if (!MODES.includes(mode)) {\n console.warn(`pixi-effects: ${describeLayer(spec)}: blendMode \"${mode}\" is not supported (use ${MODES.join(', ')})`);\n return;\n }\n display.blendMode = mode;\n}\n","import { Container, Rectangle } from 'pixi.js';\nimport { Sequence } from './Base';\nimport { buildSequenceTree } from '../core/Composition';\nimport { CameraSequence } from '../space/CameraSequence';\nimport { findOverlap, pickActiveCamera } from '../space/camera';\nimport { assignDepthOrder } from '../space/depth';\nimport { Layer3D, type SpaceHost } from '../space/Layer3D';\nimport { lintSequence } from '../space/lint';\nimport { describeLayer, lintText, lintTiming, summarizeWarnings } from '../core/lint';\nimport { applyBlendMode } from '../core/blend';\nimport { cameraBasis, homeCamera } from '../space/math';\nimport type { CompositionSequenceSpec, AudioDescriptor, CompositionShape, SequenceSpec } from '../types';\n\nimport type { gsap } from 'gsap';\ntype Timeline = ReturnType<typeof gsap.timeline>;\n\nexport class CompositionSequence extends Sequence {\n declare spec: CompositionSequenceSpec;\n private _innerContainer: Container | null = null;\n private _compositionShape: CompositionShape | null = null;\n _children: Sequence[] = [];\n private _cameras: CameraSequence[] = [];\n private _layers3d: Layer3D[] = [];\n /** Drawn children in stack order (cameras and target-less sequences excluded). */\n private _visual: Array<{ seq: Sequence; layer: Layer3D | null }> = [];\n\n async build(): Promise<void> {\n const width = this.spec.width ?? this.parent?.width ?? this.root.width;\n const height = this.spec.height ?? this.parent?.height ?? this.root.height;\n if (this.duration === undefined) {\n this.duration = this.spec.duration ?? this.parent?.duration ?? this.root.duration;\n }\n const wrapper = new Container();\n wrapper.cullable = true;\n wrapper.cullableChildren = true;\n wrapper.cullArea = new Rectangle(0, 0, width, height);\n\n const inner = new Container();\n inner.cullable = true;\n inner.cullableChildren = true;\n wrapper.addChild(inner);\n\n this.target = wrapper;\n this.intrinsicWidth = width;\n this.intrinsicHeight = height;\n this._innerContainer = inner;\n this._compositionShape = { width, height, duration: this.duration };\n\n const lateKeyframes: string[] = [];\n for (const s of this.spec.sequences ?? []) {\n lintSequence(s);\n lintTiming(s, this.duration, (message, kind) => (kind === 'late-keyframe' ? lateKeyframes.push(message) : console.warn(message)));\n lintText(s);\n }\n for (const message of summarizeWarnings(lateKeyframes)) console.warn(message);\n\n this._children = await buildSequenceTree(\n this.spec.sequences ?? [],\n this._compositionShape,\n this.root,\n );\n for (const child of this._children) {\n // Cameras are display-less: they only feed the projection pass.\n if (child instanceof CameraSequence) {\n this._cameras.push(child);\n continue;\n }\n if (!child.target) continue;\n\n const maskSpec = (child.spec as { mask?: SequenceSpec }).mask;\n\n // threeD layers never enter the scene graph themselves: their display\n // object is rendered into a texture and a perspective mesh stands in.\n if (child.spec.threeD) {\n const layer = new Layer3D(child, frameOf(child));\n inner.addChild(layer.display);\n this._layers3d.push(layer);\n this._visual.push({ seq: child, layer });\n applyBlendMode(child.spec, layer.display);\n if (maskSpec) {\n console.warn(`pixi-effects: ${describeLayer(child.spec)}: mask is not supported on threeD layers yet; ignored`);\n }\n continue;\n }\n\n inner.addChild(child.target);\n this._visual.push({ seq: child, layer: null });\n applyBlendMode(child.spec, child.target);\n // If this child has a `mask` spec, build the mask sequence in the same\n // composition shape, add its target to the same parent (so its\n // transforms resolve in the same coord space), and wire PIXI's\n // mask channel. PIXI v8 renders mask containers into the stencil /\n // alpha buffer; they don't render as normal children.\n if (maskSpec) {\n // The mask lives and animates with the layer it masks: with no `at` of its own its `at` and\n // `duration` are the layer's, so its keyframes are measured from the layer's start too. An\n // explicit `at` is composition time, exactly like a layer's.\n const lifetime = maskSpec.at === undefined\n ? { at: child.at, duration: maskSpec.duration ?? child.duration }\n : {};\n const built = await buildSequenceTree([{ ...maskSpec, ...lifetime } as SequenceSpec], this._compositionShape, this.root);\n const maskSeq = built[0];\n if (maskSeq?.target) {\n inner.addChild(maskSeq.target);\n // PIXI v8 `setMask` accepts an `inverse` flag — that's how we\n // expose `maskInverted` from the spec. Falls back to plain\n // `target.mask = …` for runtimes that don't have setMask\n // (older PIXI builds).\n const inverse = (child.spec as { maskInverted?: boolean }).maskInverted ?? false;\n const t = child.target as Container & {\n setMask?: (opts: { mask: Container | null; inverse?: boolean }) => void;\n mask: Container | null;\n };\n if (typeof t.setMask === 'function') {\n t.setMask({ mask: maskSeq.target, inverse });\n } else {\n t.mask = maskSeq.target;\n }\n child.maskSequence = maskSeq;\n }\n }\n }\n\n if (this._layers3d.length > 0) {\n // Stack order becomes explicit zIndex so threeD layers can be re-sorted\n // by depth each frame without reparenting.\n inner.sortableChildren = true;\n this._visual.forEach((v, i) => {\n (v.layer?.display ?? v.seq.target!).zIndex = i;\n });\n } else if (this._cameras.length > 0) {\n console.warn('pixi-effects: camera has no effect: this composition has no threeD layers');\n }\n\n this.buildFilters();\n }\n\n override bindTimeline(timeline: Timeline, offset = 0): void {\n super.bindTimeline(timeline, offset);\n // Children's `at` is relative to this composition's start, so push them\n // forward by our absolute start time on the global timeline.\n const childOffset = offset + this.at;\n for (const child of this._children) {\n child.bindTimeline(timeline, childOffset);\n // The mask shares the maskee's offset — its `at` is interpreted\n // relative to the composition's start, just like the child itself,\n // so a reveal-from-zero animation lines up naturally.\n child.maskSequence?.bindTimeline(timeline, childOffset);\n }\n const overlap = findOverlap(this._cameras.map(c => c.window()));\n if (overlap) {\n console.warn(`pixi-effects: cameras #${overlap[0] + 1} and #${overlap[1] + 1} overlap in time; the top-most one wins`);\n }\n }\n\n /** Drawn children in stack order, with the display object that stands in for each (the mesh for a threeD layer). */\n layers(): Array<{ seq: Sequence; display: Container; threeD: boolean }> {\n return this._visual.map(v => ({\n seq: v.seq,\n display: (v.layer?.display ?? v.seq.target!) as unknown as Container,\n threeD: v.layer !== null,\n }));\n }\n\n override syncFrame(): void {\n super.syncFrame();\n for (const child of this._children) child.syncFrame();\n }\n\n override updateSpace(t: number, host: SpaceHost): void {\n // Inner compositions first: a threeD composition is rendered into its own\n // texture by this level, so its content must already be projected.\n for (const child of this._children) child.updateSpace(t, host);\n if (this._layers3d.length === 0 || !this._compositionShape) return;\n\n const { width, height } = this._compositionShape;\n const compEnd = (this.absoluteStart ?? 0) + (this.duration ?? 0);\n const active = pickActiveCamera(\n this._cameras.map(cam => ({ cam, ...cam.window() })),\n t,\n compEnd,\n );\n const basis = cameraBasis(active ? active.cam.state() : homeCamera(width, height), width, height);\n\n for (const layer of this._layers3d) layer.update(host, basis);\n\n const order = assignDepthOrder(\n this._visual.map((v, i) => ({ stackIndex: i, threeD: v.layer !== null, depth: v.layer?.depth ?? 0 })),\n );\n this._visual.forEach((v, i) => {\n if (v.layer) v.layer.display.zIndex = order[i]!;\n });\n }\n\n override collectAudio(out: AudioDescriptor[], baseTime: number): void {\n super.collectAudio(out, baseTime);\n const childBase = baseTime + this.at;\n for (const child of this._children) child.collectAudio(out, childBase);\n }\n\n override destroy(): void {\n for (const l of this._layers3d) l.destroy();\n this._layers3d = [];\n for (const c of this._children) c.destroy();\n super.destroy();\n }\n}\n\n/** Layer-space rectangle a threeD child projects: a composition's frame, otherwise its content bounds. */\nfunction frameOf(child: Sequence): () => { x: number; y: number; width: number; height: number } {\n if (child instanceof CompositionSequence) {\n return () => ({ x: 0, y: 0, width: child.intrinsicWidth, height: child.intrinsicHeight });\n }\n return () => child.target!.getLocalBounds();\n}\n"]}
|
|
@@ -796,6 +796,14 @@ var Sequence = class {
|
|
|
796
796
|
*/
|
|
797
797
|
updateSpace(_t, _host) {
|
|
798
798
|
}
|
|
799
|
+
/**
|
|
800
|
+
* Runs once per rendered frame, after the timeline seek and before the cull. Layers whose drawn
|
|
801
|
+
* geometry follows tweened state (shapes) redraw here, so the culler measures where the layer is NOW
|
|
802
|
+
* and not where it was drawn at the previous render.
|
|
803
|
+
*/
|
|
804
|
+
syncFrame() {
|
|
805
|
+
this.maskSequence?.syncFrame();
|
|
806
|
+
}
|
|
799
807
|
destroy() {
|
|
800
808
|
this.maskSequence?.destroy();
|
|
801
809
|
this.maskSequence = null;
|
|
@@ -832,11 +840,16 @@ function lintTiming(spec, parentDuration, warn = defaultWarn) {
|
|
|
832
840
|
const kat = kf.at ?? 0;
|
|
833
841
|
if (kat >= duration) {
|
|
834
842
|
warn(
|
|
835
|
-
`pixi-effects: ${who}: keyframes[${i}] starts at ${kat}s, after the layer ends (duration ${duration}s), so it never plays. Keyframe \`at\` is measured from the start of this layer, not from the start of the composition
|
|
843
|
+
`pixi-effects: ${who}: keyframes[${i}] starts at ${kat}s, after the layer ends (duration ${duration}s), so it never plays. Keyframe \`at\` is measured from the start of this layer, not from the start of the composition.`,
|
|
844
|
+
"late-keyframe"
|
|
836
845
|
);
|
|
837
846
|
}
|
|
838
847
|
});
|
|
839
848
|
}
|
|
849
|
+
function summarizeWarnings(messages, shown = 3) {
|
|
850
|
+
if (messages.length <= shown) return messages;
|
|
851
|
+
return [...messages.slice(0, shown), `pixi-effects: ${messages.length - shown} more layers with the same problem (the same loop or helper is probably building them): fix the ones above and these go away.`];
|
|
852
|
+
}
|
|
840
853
|
function lintText(spec, warn = defaultWarn) {
|
|
841
854
|
if (spec.type !== "text") return;
|
|
842
855
|
if (collectPropKeys(spec).has("value") && !(spec.text ?? "").includes("{value}")) {
|
|
@@ -1011,6 +1024,27 @@ var CameraSequence = class extends Sequence {
|
|
|
1011
1024
|
}
|
|
1012
1025
|
};
|
|
1013
1026
|
|
|
1027
|
+
// src/core/revertibleSet.ts
|
|
1028
|
+
function revertibleSet(timeline, at, read, write, value) {
|
|
1029
|
+
let p = 0;
|
|
1030
|
+
let before;
|
|
1031
|
+
const proxy = {
|
|
1032
|
+
get p() {
|
|
1033
|
+
return p;
|
|
1034
|
+
},
|
|
1035
|
+
set p(next) {
|
|
1036
|
+
if (next >= 1 && p < 1) {
|
|
1037
|
+
before = read();
|
|
1038
|
+
write(value);
|
|
1039
|
+
} else if (next < 1 && p >= 1) {
|
|
1040
|
+
write(before);
|
|
1041
|
+
}
|
|
1042
|
+
p = next;
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
timeline.set(proxy, { p: 1 }, at);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1014
1048
|
// src/expr/colorInterp.ts
|
|
1015
1049
|
function buildColorInterp(from, to, space) {
|
|
1016
1050
|
const fromRGBA = parseToRGBA(from);
|
|
@@ -1201,9 +1235,10 @@ var ImageSequence = class extends Sequence {
|
|
|
1201
1235
|
const toTint = kf.to?.tint;
|
|
1202
1236
|
const setTint = kf.set?.tint;
|
|
1203
1237
|
if (setTint !== void 0) {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1238
|
+
const sprite = this.target;
|
|
1239
|
+
revertibleSet(timeline, at, () => sprite.tint, (c) => {
|
|
1240
|
+
sprite.tint = c;
|
|
1241
|
+
}, setTint);
|
|
1207
1242
|
}
|
|
1208
1243
|
if (toTint !== void 0) {
|
|
1209
1244
|
tweenColor(
|
|
@@ -1250,7 +1285,21 @@ function stripKeysInKeyframe(kf, keys) {
|
|
|
1250
1285
|
from: stripKeys(kf.from, keys)
|
|
1251
1286
|
};
|
|
1252
1287
|
}
|
|
1253
|
-
var STYLE_OPAQUE_KEYS = [
|
|
1288
|
+
var STYLE_OPAQUE_KEYS = [
|
|
1289
|
+
"fontFamily",
|
|
1290
|
+
"fill",
|
|
1291
|
+
"align",
|
|
1292
|
+
"fontStyle",
|
|
1293
|
+
"fontWeight",
|
|
1294
|
+
"fontVariant",
|
|
1295
|
+
"textBaseline",
|
|
1296
|
+
"whiteSpace",
|
|
1297
|
+
"lineJoin",
|
|
1298
|
+
"join",
|
|
1299
|
+
"cap",
|
|
1300
|
+
"color",
|
|
1301
|
+
"stroke"
|
|
1302
|
+
];
|
|
1254
1303
|
function formatValue(v, f) {
|
|
1255
1304
|
const fixed = v.toFixed(Math.max(0, Math.floor(f?.decimals ?? 0)));
|
|
1256
1305
|
if (!f?.grouping) return fixed;
|
|
@@ -1365,10 +1414,10 @@ function bindValueKeyframes(timeline, state, refresh, keyframes, parentDuration,
|
|
|
1365
1414
|
const loop = loopVars(kf);
|
|
1366
1415
|
if (setV !== void 0) {
|
|
1367
1416
|
const v = resolveNumber(setV, scope);
|
|
1368
|
-
timeline.
|
|
1369
|
-
state.value =
|
|
1417
|
+
revertibleSet(timeline, at, () => state.value, (n) => {
|
|
1418
|
+
state.value = n;
|
|
1370
1419
|
refresh();
|
|
1371
|
-
},
|
|
1420
|
+
}, v);
|
|
1372
1421
|
}
|
|
1373
1422
|
if (toV !== void 0 && fromV !== void 0) {
|
|
1374
1423
|
timeline.fromTo(
|
|
@@ -1397,10 +1446,10 @@ function bindFillKeyframes(timeline, text, keyframes, parentDuration, offset, co
|
|
|
1397
1446
|
const fromFill = pickFill(kf.from);
|
|
1398
1447
|
const toFill = pickFill(kf.to);
|
|
1399
1448
|
if (setFill !== void 0) {
|
|
1400
|
-
timeline.
|
|
1401
|
-
state.fill =
|
|
1449
|
+
revertibleSet(timeline, at, () => state.fill, (c) => {
|
|
1450
|
+
state.fill = c;
|
|
1402
1451
|
writeFill();
|
|
1403
|
-
},
|
|
1452
|
+
}, setFill);
|
|
1404
1453
|
}
|
|
1405
1454
|
if (toFill !== void 0) {
|
|
1406
1455
|
tweenColor(
|
|
@@ -1431,7 +1480,8 @@ var AudioSequence = class extends Sequence {
|
|
|
1431
1480
|
const data = await Assets.get(this.spec.asset);
|
|
1432
1481
|
this._audioBuffer = data.audioBuffer;
|
|
1433
1482
|
if (this.duration === void 0) {
|
|
1434
|
-
|
|
1483
|
+
const rest = Math.max(0, (this.parent?.duration ?? this.root.duration) - this.at);
|
|
1484
|
+
this.duration = this.spec.duration ?? (this.spec.loop ? rest : data.duration) ?? this.root.duration;
|
|
1435
1485
|
}
|
|
1436
1486
|
if (!this.spec.loop && data.duration !== void 0 && this.duration > data.duration + 0.05) {
|
|
1437
1487
|
console.warn(
|
|
@@ -1447,21 +1497,32 @@ var AudioSequence = class extends Sequence {
|
|
|
1447
1497
|
const initialVolume = this.spec.volume ?? 1;
|
|
1448
1498
|
const volumeKeyframes = [];
|
|
1449
1499
|
const dur = this.duration;
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1500
|
+
const t0 = baseTime + this.at;
|
|
1501
|
+
const keyframes = (this.spec.keyframes ?? []).map((raw) => normalizeKeyframe(raw, dur)).filter((kf) => [kf.set, kf.to, kf.from].some((p) => p && "volume" in p)).sort((x, y) => x.at - y.at);
|
|
1502
|
+
let current = initialVolume;
|
|
1503
|
+
const point = (time, value) => {
|
|
1504
|
+
volumeKeyframes.push({ time, value });
|
|
1505
|
+
};
|
|
1506
|
+
for (const kf of keyframes) {
|
|
1507
|
+
const start = t0 + kf.at;
|
|
1508
|
+
const end = start + kf.duration;
|
|
1509
|
+
const set = kf.set?.volume;
|
|
1510
|
+
const to = kf.to?.volume;
|
|
1511
|
+
const from = kf.from?.volume;
|
|
1512
|
+
point(start, current);
|
|
1513
|
+
if (kf.kind === "set" && set !== void 0) {
|
|
1514
|
+
point(start, set);
|
|
1515
|
+
current = set;
|
|
1516
|
+
} else if (kf.kind === "to" && to !== void 0) {
|
|
1517
|
+
point(end, to);
|
|
1518
|
+
current = to;
|
|
1519
|
+
} else if (kf.kind === "fromTo" && to !== void 0) {
|
|
1520
|
+
point(start, from ?? current);
|
|
1521
|
+
point(end, to);
|
|
1522
|
+
current = to;
|
|
1523
|
+
} else if (kf.kind === "from" && from !== void 0) {
|
|
1524
|
+
point(start, from);
|
|
1525
|
+
point(end, current);
|
|
1465
1526
|
}
|
|
1466
1527
|
}
|
|
1467
1528
|
out.push({
|
|
@@ -1759,12 +1820,32 @@ var ShapeSequence = class extends Sequence {
|
|
|
1759
1820
|
if (init.y === void 0) graphics.y = cy;
|
|
1760
1821
|
}
|
|
1761
1822
|
graphics.onRender = () => {
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1823
|
+
if (this._fresh) {
|
|
1824
|
+
this._fresh = false;
|
|
1825
|
+
return;
|
|
1826
|
+
}
|
|
1827
|
+
this._redraw();
|
|
1765
1828
|
};
|
|
1766
1829
|
this.buildFilters();
|
|
1767
1830
|
}
|
|
1831
|
+
_fresh = false;
|
|
1832
|
+
_redraw() {
|
|
1833
|
+
const graphics = this.target;
|
|
1834
|
+
graphics.clear();
|
|
1835
|
+
this._drawGeometry(graphics);
|
|
1836
|
+
applyState(graphics, this._state);
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* Draw from the tweened `_state` before the culler runs. The culler measures the geometry as last
|
|
1840
|
+
* drawn; a layer drawn only inside `onRender` is culled on stale bounds (a rect growing from
|
|
1841
|
+
* `width: 0` at the left edge was skipped after a jump seek, and one frame late in playback).
|
|
1842
|
+
*/
|
|
1843
|
+
syncFrame() {
|
|
1844
|
+
super.syncFrame();
|
|
1845
|
+
if (!this.target?.renderable) return;
|
|
1846
|
+
this._redraw();
|
|
1847
|
+
this._fresh = true;
|
|
1848
|
+
}
|
|
1768
1849
|
bindTimeline(timeline, offset = 0) {
|
|
1769
1850
|
if (!this.target) return;
|
|
1770
1851
|
const scope = this.scope();
|
|
@@ -1928,9 +2009,10 @@ function bindLiveKeyframes(timeline, state, liveKeys, keyframes, parentDuration,
|
|
|
1928
2009
|
if (live) {
|
|
1929
2010
|
for (const [k, v] of Object.entries(live)) {
|
|
1930
2011
|
const resolved = resolveLiveValue(k, v, scope);
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
2012
|
+
const live2 = state;
|
|
2013
|
+
revertibleSet(timeline, at, () => live2[k], (v2) => {
|
|
2014
|
+
live2[k] = v2;
|
|
2015
|
+
}, resolved);
|
|
1934
2016
|
}
|
|
1935
2017
|
}
|
|
1936
2018
|
}
|
|
@@ -1989,7 +2071,7 @@ function numOrZero(v, scope) {
|
|
|
1989
2071
|
var _CompositionSequence = null;
|
|
1990
2072
|
async function getCompositionSequence() {
|
|
1991
2073
|
if (!_CompositionSequence) {
|
|
1992
|
-
_CompositionSequence = (await import('./Composition-
|
|
2074
|
+
_CompositionSequence = (await import('./Composition-RGTRZ2JX.js')).CompositionSequence;
|
|
1993
2075
|
}
|
|
1994
2076
|
return _CompositionSequence;
|
|
1995
2077
|
}
|
|
@@ -2026,6 +2108,6 @@ async function buildSequenceTree(specs, parent, root) {
|
|
|
2026
2108
|
return out;
|
|
2027
2109
|
}
|
|
2028
2110
|
|
|
2029
|
-
export { CameraSequence, DEFAULT_FOV, DEG, Sequence, buildScope, buildSequenceTree, cameraBasis, collectPropKeys, describeLayer, evaluateExpr, homeCamera, homeDistance, lintText, lintTiming, projectLayer, registerSequenceType, resolveAt };
|
|
2030
|
-
//# sourceMappingURL=chunk-
|
|
2031
|
-
//# sourceMappingURL=chunk-
|
|
2111
|
+
export { CameraSequence, DEFAULT_FOV, DEG, Sequence, buildScope, buildSequenceTree, cameraBasis, collectPropKeys, describeLayer, evaluateExpr, homeCamera, homeDistance, lintText, lintTiming, projectLayer, registerSequenceType, resolveAt, summarizeWarnings };
|
|
2112
|
+
//# sourceMappingURL=chunk-ZQX7WIYL.js.map
|
|
2113
|
+
//# sourceMappingURL=chunk-ZQX7WIYL.js.map
|