Created
November 8, 2023 11:17
-
-
Save Iljo/d2cd1270ada2f098985fa0b271a96e7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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