码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2015-06-01 16:21:03      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:

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

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

标签:

原文地址:http://www.cnblogs.com/zhangfeitao/p/4544010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!