#!/bin/bash # Rebuild every OSM level. Area JSONs are cached in $OSM_CACHE; refetch via the # README curl + osm_xml_to_json.py if absent. set -e cd "$(dirname "$0")/.." B=/Applications/Blender.app/Contents/MacOS/Blender C="${OSM_CACHE:-$HOME/.cache/burnout_osm}" [ -d "$C" ] || { echo "no OSM cache at $C -- set OSM_CACHE or refetch (see README)"; exit 1; } while IFS='|' read -r id json lat lon sway loop bridge canopy terrain; do ARGS=$(python3 tools/osm_level_args.py "$C/$json" "$sway" "$loop") || { echo "ARGS FAILED $id"; continue; } SPAWN=$(echo "$ARGS" | head -1) RP=$(echo "$ARGS" | tail -1) # level_*.jpg are Godot's extraction of the GLB's embedded textures, not # Blender's output. Clear them so renamed/dropped materials don't leave # orphans -- but the .glb.import MUST go too, or Godot's cache decides # nothing changed and never re-extracts, leaving a level with no textures # at all (loads, renders untextured, spams "Resource file not found"). rm -f "levels/$id"/level_*.jpg "levels/$id"/level_*.jpg.import "levels/$id"/level.glb.import "$B" -b -P tools/build_level_osm.py -- "$C/$json" "$id" "$lat" "$lon" "$SPAWN" "$RP" "$bridge" "$canopy" "${terrain:--}" 2>&1 \ | grep -E '^(level built|bridge truss|canopies built|forest fill)' done <<'EOF' queen_st_mall|brisbane_cbd.json|-27.4699|153.0251|Queen Street Mall|Adelaide Street,Edward Street,Elizabeth Street,George Street|-|Queen Street southbank|southbank.json|-27.4775|153.0215|Little Stanley Street|trace:Grey Street|-|- albert_parklands|albert_parklands.json|-27.4740|153.0280|Albert Street|Alice Street,George Street,Margaret Street,Edward Street|-|- story_bridge|story_bridge.json|-27.4635|153.0355|Bradfield Highway|trace:Bradfield Highway|Bradfield Highway|- kangaroo_point|kangaroo_point.json|-27.4780|153.0345|River Terrace|trace:River Terrace|-|- mt_cootha|mt_cootha.json|-27.4735|152.9530|Sir Samuel Griffith Drive|trace:Sir Samuel Griffith Drive|-|-|grass mt_gravatt|mt_gravatt.json|-27.5520|153.0755|Mount Gravatt Outlook Drive|trace:Mount Gravatt Outlook Drive|-|-|grass EOF