Skip to content

Instantly share code, notes, and snippets.

@Iljo
Created November 8, 2023 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Iljo/d2cd1270ada2f098985fa0b271a96e7d to your computer and use it in GitHub Desktop.
Save Iljo/d2cd1270ada2f098985fa0b271a96e7d to your computer and use it in GitHub Desktop.
#!/bin/env bash
unzip $1 -d $(basename $1 .zip)
cd $(basename $1 .zip)
# Found out that there might be multiple sxyboxes in the same subdirectory, and the file names
# accross the whole tree stucture are unique. So group them manually.
# for z in *.7z; do 7z e -o$(basename $z .7z) $z; done
7z e .
find . -type d -empty -delete
for f in *ft.vtf; do mkdir $(echo $f | awk -F 'ft.vtf' '{print $1}'); done
for f in *.vtf; do mv $f $(echo $f | awk -F 'ft.vtf|bk.vtf|up.vtf|dn.vtf|rt.vtf|lf.vtf' '{print $1}'); done
vtex2 extract -f jpg -r .
rm $(find . -type f ! -name "*.jpg")
for d in *
do
echo "Renaming files in $d"
cd $d
mv *ft.jpg right.jpg
mv *bk.jpg left.jpg
mv *up.jpg top.jpg
mv *dn.jpg bottom.jpg
mv *rt.jpg front.jpg
mv *lf.jpg back.jpg
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment