Render the 3D onion-skin screenshot for every animated element. Returns true * when the command should early-return (a guard failed).
(
comps: SurfacedComposition[],
allComps: SurfacedComposition[],
projectDir: string | undefined,
args: ShotArgs & { selector?: string },
)
| 707 | /** Render the 3D onion-skin screenshot for every animated element. Returns true |
| 708 | * when the command should early-return (a guard failed). */ |
| 709 | async function runOnionShot( |
| 710 | comps: SurfacedComposition[], |
| 711 | allComps: SurfacedComposition[], |
| 712 | projectDir: string | undefined, |
| 713 | args: ShotArgs & { selector?: string }, |
| 714 | ): Promise<boolean> { |
| 715 | const { captureMotionPathShot } = await import("./motionShot.js"); |
| 716 | // With --selector, sample from the FULL animated set and let the browser scope |
| 717 | // to the selector (or its animated descendants when the selector is a static |
| 718 | // wrapper like `.clip`). Without it, only the (already-filtered) comps qualify. |
| 719 | const requests = collectShotSelectors(args.selector ? allComps : comps); |
| 720 | const guardError = onionShotGuardError(projectDir, requests, args.ghost ?? false); |
| 721 | if (guardError) { |
| 722 | console.log(c.dim(guardError)); |
| 723 | return true; |
| 724 | } |
| 725 | const saved = await captureMotionPathShot( |
| 726 | projectDir!, |
| 727 | requests, |
| 728 | resolve(args.shot!), |
| 729 | onionShotOptions(args), |
| 730 | ); |
| 731 | printOnionShotSaved(saved, requests.length); |
| 732 | return false; |
| 733 | } |
| 734 | |
| 735 | // Resolve the command target (a project dir or a single .html) into surfaced |
| 736 | // compositions, applying the optional --selector filter. |
no test coverage detected