TexturePacker生成动画脚本

#!/bin/bash

TP="/usr/local/bin/TexturePacker"
sourceDir=../../Arts/*
dstAniDir=ani_1
rm -rf "$dstAniDir"
rm ani_1/sd/aniList.txt
mkdir "$dstAniDir"
mkdir "$dstAniDir"/hd
mkdir "$dstAniDir"/sd

echo "正在生成高清动画 hd..."
for aniDirName in $sourceDir
do
    if [ -d "$aniDirName" ] 
    then
            var="$aniDirName"
            aniName=${var##*Arts/}
            aniName=${aniName//\//_}
            echo "Animation Name: " $aniName
            ${TP}   --smart-update \
            --format cocos2d \
            --data "$dstAniDir"/hd/"$aniName"-hd.plist \
            --sheet "$dstAniDir"/hd/"$aniName"-hd.png \
            --replace .*\/=\
            --max-height 1024\
            --max-width 1024\
            --dither-fs\
            "$aniDirName"
    fi
done

echo "正在生成标清动画 sd..."
for aniDirName in $sourceDir
    do
        if [ -d "$aniDirName" ] 
        then
                var="$aniDirName"
                aniName=${var##*Arts/}
                aniName=${aniName//\//_}
                ${TP}   --smart-update \
                --format cocos2d \
                --data "$dstAniDir"/sd/"$aniName".plist \
                --sheet "$dstAniDir"/sd/"$aniName".png \
                --replace .*\/=\
                --max-height 1024\
                --max-width 1024\
                --scale 0.5\
                --dither-fs\
                "$aniDirName"

                echo "$aniName".plist >> ani_1/sd/aniList.txt
        fi
    done
exit 0

posted on 2012-05-11 11:09  几百人有爱  阅读(359)  评论(0编辑  收藏  举报