Branchwell

PulseCanvas / app · pulsecanvas.ai / scripts / native-reel.sh

Raw 1.3 KB on 0e4fe45e403a1b6b5a57aa68addd681995d37722
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
4set -euo pipefail
5cd "$(dirname "$0")/.."
6mkdir -p .build/validation
7binary=.build/validation/native-reel
8sources=(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)
12needs_build=0
13[ -x "$binary" ] || needs_build=1
14for source in "${sources[@]}"; do [ "$source" -nt "$binary" ] && needs_build=1; done
15if [ "$needs_build" = 1 ]; then
16 xcrun swiftc -O -suppress-warnings -swift-version 6 -D STORE_BUILD -parse-as-library "${sources[@]}" -o "$binary"
17fi
18"$binary" "$@"
19output=$(printf '%s\n' "$@" | awk 'previous == "--out" { print } { previous = $0 }')
20output=${output:-.build/reels/reel.mp4}
21python3 scripts/label-reel.py "$output"