Example project export script improvements.

This commit is contained in:
Nathan Sweet 2020-10-09 22:48:48 -07:00
parent 8c799b51f9
commit 2b0e6babb2

View File

@ -1,7 +1,10 @@
#!/bin/sh #!/bin/sh
# Usage: export.sh <version> <one or more parameters to pass to Spine, eg: -f --trace>
set -e set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $SCRIPT_DIR cd "$SCRIPT_DIR"
SPINE_EXE="C:/Program Files/Spine/Spine.com" SPINE_EXE="C:/Program Files/Spine/Spine.com"
if [ ! -f "$SPINE_EXE" ]; then if [ ! -f "$SPINE_EXE" ]; then
@ -12,11 +15,11 @@ if [ ! -f "$SPINE_EXE" ]; then
fi fi
echo "Spine exe: $SPINE_EXE" echo "Spine exe: $SPINE_EXE"
if [ "$#" -eq 1 ]; then if [ "$#" -eq 0 ]; then
version=${1%/}
else
echo "Enter the Spine editor version to use for the export (eg 3.8.99):" echo "Enter the Spine editor version to use for the export (eg 3.8.99):"
read version read version
else
version=${1%/}
fi fi
echo "Cleaning export directories..." echo "Cleaning export directories..."
@ -39,7 +42,7 @@ rm -rf ../mix-and-match/export/*
echo "" echo ""
echo "Exporting assets..." echo "Exporting assets..."
"$SPINE_EXE" \ "$SPINE_EXE" \
-u $version -f \ -u $version ${@:2} --clean-examples \
-i ../alien/alien-ess.spine -o ../alien/export -e json.json \ -i ../alien/alien-ess.spine -o ../alien/export -e json.json \
-i ../alien/alien-ess.spine -o ../alien/export -e binary.json \ -i ../alien/alien-ess.spine -o ../alien/export -e binary.json \
-i ../alien/alien-pro.spine -o ../alien/export -e json.json \ -i ../alien/alien-pro.spine -o ../alien/export -e json.json \
@ -190,4 +193,10 @@ if [ -d "$UNITY_BASE_DIR" ]; then
-i $UNITY_BASE_DIR/whirlyblendmodes/whirlyblendmodes.spine -o $UNITY_BASE_DIR/whirlyblendmodes/export -e binary.json \ -i $UNITY_BASE_DIR/whirlyblendmodes/whirlyblendmodes.spine -o $UNITY_BASE_DIR/whirlyblendmodes/export -e binary.json \
-i $UNITY_BASE_DIR/whirlyblendmodes/images -o $UNITY_BASE_DIR/whirlyblendmodes/export -n whirlyblendmodes -p atlas-1.0.json \ -i $UNITY_BASE_DIR/whirlyblendmodes/images -o $UNITY_BASE_DIR/whirlyblendmodes/export -n whirlyblendmodes -p atlas-1.0.json \
-i $UNITY_BASE_DIR/whirlyblendmodes/images -o $UNITY_BASE_DIR/whirlyblendmodes/export -n whirlyblendmodes-pma -p atlas-1.0-pma.json -i $UNITY_BASE_DIR/whirlyblendmodes/images -o $UNITY_BASE_DIR/whirlyblendmodes/export -n whirlyblendmodes-pma -p atlas-1.0-pma.json
fi fi
echo "Optimizing PNGs..."
cd ..
find -type f -iname '*.png' -exec oxipng -q --nx -i 0 -o 4 --strip all {} +
echo "Done!"