Created
March 24, 2017 03:18
-
-
Save JamesKim2998/a02ddfb0ead61f1a36d172bbaa6511a5 to your computer and use it in GitHub Desktop.
Convert pvr file to png using TexturePacker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import sys | |
import os | |
from glob import glob | |
from subprocess import call | |
def log(msg): | |
print('[PVR2PNG] ' + msg) | |
root = sys.argv[1] | |
log('Start: ' + root) | |
files = glob(root + '/**/*.pvr', recursive=True) | |
files.extend(glob(root + '/**/*.pvr.ccz', recursive=True)) | |
files.extend(glob(root + '/**/*.pvr.gz', recursive=True)) | |
for file in files: | |
log('Convert ' + file + '...') | |
filebase = file[:str.rfind(file, '.pvr')] | |
call(['TexturePacker', file, | |
'--sheet', filebase + '.png', | |
'--data', filebase + '.plist', | |
'--algorithm', 'Basic', | |
'--allow-free-size', | |
'--no-trim']) | |
log('Done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problems and Fixes for TexturePacker Lite Version
Problem/ Warnings
Those warnings result in PNG files with the Logo of TexturePacker.
Solution
Using following python code for the call.