python操作TexturePacker批量打包资源plist png

import os,sys
imagedir = 'D:\\PackerImg\\imgDir'  
outplistdir = 'D:\\PackerImg\\outDir'
comend = 'TexturePacker'
print "imagedir = %s \n outdir = "%imagedir,outplistdir
herolist = os.listdir(imagedir)
print "heave %d hero convert"%len(herolist)
for n in range(len(herolist)):
  herodirtmp = imagedir + os.sep + herolist[n]
  print "herodirtmp %s"%herodirtmp
  herotmplist = os.listdir(herodirtmp)
  cmdtmp = comend
  print "hero %s heave image = %d"%(str(herolist[n]),len(herotmplist))
  allImage = ""
  for im in range(len(herotmplist)):
    allImage = allImage + " " + herodirtmp + os.sep + herotmplist[im]
  cmdtmp = cmdtmp + " " + allImage +\
           " --data " + outplistdir + os.sep + herolist[n] + ".plist"\
           " --sheet " + outplistdir + os.sep + herolist[n] + ".png"\
           " --format " + "cocos2d"
  os.system(cmdtmp) 

 http://blog.csdn.net/linjf520/article/details/42420471

posted @ 2015-06-01 15:13  骑着驴的王子  阅读(1339)  评论(0编辑  收藏  举报