Skip to content

Instantly share code, notes, and snippets.

@xDShot
Created January 20, 2018 06:46
Show Gist options
  • Save xDShot/7686f1c41243fcd3da78e8d73de07a5e to your computer and use it in GitHub Desktop.
Save xDShot/7686f1c41243fcd3da78e8d73de07a5e to your computer and use it in GitHub Desktop.
Re-convert vtf textures into older format to support older Source Engine versions
#!/usr/bin/bash
for D in ./*; do
if [ -d "$D" ]; then
echo "I go into $D folder"
cd "$D"
for i in *; do
if [ ${i: -4} == ".vmt" ]
then
echo "Remove $i text file"
rm $i
fi
if [ ${i: -4} == ".vtf" ]
then
echo "Generating tga from $i"
vtf2tga $i >/dev/null
echo "Get basename from $i"
export _basei=$(basename $i .vtf)
echo "It's $_basei"
#rm $i
vtex_hl2 ${_basei}.tga
fi
done
cd ..
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment