#!/usr/bin/env bash # Usage: bash restore.sh [TARGET_DIR] # Run from inside the downloaded repo directory. Default target: ./restored set -euo pipefail TARGET="${1:-$PWD/restored}" RIG="$TARGET/filtered_lowpoly_rig" mkdir -p "$RIG/meshes" "$RIG/meshes_norm" echo "== Extracting meshes shards ==" for t in meshes/meshes-*.tar; do echo " $t" tar -xf "$t" -C "$RIG/meshes" done echo "== Extracting meshes_norm ==" tar -xf meshes_norm.tar -C "$RIG/meshes_norm" echo "== Copying metadata / scripts ==" find . -maxdepth 1 -type f ! -name '*.tar' ! -name restore.sh \ -exec cp {} "$RIG/" \; echo "Done. Restored into: $RIG" echo " $(find "$RIG/meshes" -type f | wc -l) files in meshes/" echo " $(find "$RIG/meshes_norm" -type f | wc -l) files in meshes_norm/"