#!/usr/bin/env bash # Render the demo-map screenshots used for visual review into /Screenshots/demo/. # # Usage: Tools/render_screenshots.sh [--verify] # # Only the **demo map** is captured: the review staging map exists to hold the # hero/camera list, not to produce review screenshots. Everything here is what a # player actually sees when the demo runs. # # --verify run Tools/visual_loop.py --verify afterwards and fail if a shot # does not show the content its expectation describes # # The PNGs are committed (see Screenshots/README.md): a reviewer must see exactly # what the build rendered. set -euo pipefail REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ENGINE="${UE_ENGINE_DIR:-/run/media/system/DATA/Engines/UE_5.8.4}" PROJ="$REPO/Game/GigLine/GigLine.uproject" VERIFY="no" [ "${1:-}" = "--verify" ] && VERIFY="yes" echo "== 1/3 stage the demo shot cameras ==" cd "$ENGINE" ./Engine/Binaries/Linux/UnrealEditor-Cmd "$PROJ" \ -run=pythonscript -script="$REPO/Tools/ue_build_review_map.py" \ -nullrhi -unattended -nopause -stdout tail -3 /tmp/ue-review-map-result.txt 2>/dev/null || true echo "== 2/3 capture the demo map ==" ./Engine/Binaries/Linux/UnrealEditor-Cmd "$PROJ" /Game/Hollywood/DemoMap \ -game -windowed -ResX=1920 -ResY=1080 -nopause -nosplash -stdout echo "== 3/3 collect the demo screenshots ==" mkdir -p "$REPO/Screenshots/demo" rm -f "$REPO"/Screenshots/demo/review-*.png found=0 for src in \ "$REPO/Game/GigLine/Saved/Screenshots"/*/review-*.png \ "$REPO/Game/GigLine/Saved/Screenshots"/*/*/review-*.png \ "$HOME/.config/Epic/GigLine/Saved/Screenshots"/*/review-*.png; do [ -e "$src" ] || continue case "$(basename "$src")" in *demo-*) cp -f "$src" "$REPO/Screenshots/demo/"; found=1 ;; esac done [ "$found" = "1" ] || { echo "ERROR: no demo screenshots found"; exit 1; } ls -1 "$REPO/Screenshots/demo" if [ "$VERIFY" = "yes" ]; then echo "== verify: does each shot show what it should? ==" cd "$REPO" python3 Tools/visual_loop.py --verify fi