PulseCanvas / app · pulsecanvas.ai / scripts / native-reel.sh
| 1 | #!/bin/bash |
| 2 | # Export a motion reel through the Studio exporter, then burn in effect names. |
| 3 | # scripts/native-reel.sh --scenes 31-99 --seconds 3 --start 20 --aspect wide --resolution 720 --fps 30 --out .build/reels/new.mp4 |
| 4 | set -euo pipefail |
| 5 | cd "$(dirname "$0")/.." |
| 6 | mkdir -p .build/validation |
| 7 | binary=.build/validation/native-reel |
| 8 | sources=(Sources/PulseCanvas/SecurityScopedAccess.swift Sources/PulseCanvas/VisualPalette.swift Sources/PulseCanvas/*Geometry.swift |
| 9 | Sources/PulseCanvas/StrobeDetector.swift Sources/PulseCanvas/VisualPreset.swift Sources/PulseCanvas/ProjectMPresets.swift Sources/PulseCanvas/VisualizerRenderer.swift |
| 10 | Sources/PulseCanvas/NativeEffects.swift Sources/PulseCanvas/AudioAnalysis.swift Sources/PulseCanvas/SocialExportController.swift |
| 11 | Sources/PulseCanvas/StudioTimeline.swift Sources/PulseCanvas/StudioStore.swift scripts/RendererBundle.swift scripts/NativeReel.swift) |
| 12 | needs_build=0 |
| 13 | [ -x "$binary" ] || needs_build=1 |
| 14 | for source in "${sources[@]}"; do [ "$source" -nt "$binary" ] && needs_build=1; done |
| 15 | if [ "$needs_build" = 1 ]; then |
| 16 | xcrun swiftc -O -suppress-warnings -swift-version 6 -D STORE_BUILD -parse-as-library "${sources[@]}" -o "$binary" |
| 17 | fi |
| 18 | "$binary" "$@" |
| 19 | output=$(printf '%s\n' "$@" | awk 'previous == "--out" { print } { previous = $0 }') |
| 20 | output=${output:-.build/reels/reel.mp4} |
| 21 | python3 scripts/label-reel.py "$output" |