diff --git a/tools/bake-tools/bake.py b/tools/bake-tools/bake.py index 4051b7a7ca..edbfdf9e9f 100644 --- a/tools/bake-tools/bake.py +++ b/tools/bake-tools/bake.py @@ -71,7 +71,8 @@ def bakeFilesInDirectory(directory, outputDirectory): absFilePath = os.path.abspath(filePath) outputFolder = os.path.join(outputDirectory, appendPath) print "Baking file: " + filename - bakeFile(absFilePath, outputFolder, 'png') + bakeType = os.path.splitext(filename)[1][1:] + bakeFile(absFilePath, outputFolder, bakeType) else: filePath = os.sep.join([root, filename]) absFilePath = os.path.abspath(filePath) diff --git a/tools/bake-tools/convertToRelativePaths.py b/tools/bake-tools/convertToRelativePaths.py index 2798e2849f..70a6a30cfb 100644 --- a/tools/bake-tools/convertToRelativePaths.py +++ b/tools/bake-tools/convertToRelativePaths.py @@ -6,7 +6,7 @@ def createAssetMapping(assetDirectory): baseDirectory = os.path.basename(os.path.normpath(assetDirectory)) for root, subfolder, filenames in os.walk(assetDirectory): for filename in filenames: - if not filename.endswith('.ktx'): + if not filename.endswith('.ktx') or os.path.basename(root) == 'skyboxes': substring = os.path.commonprefix([assetDirectory, root]) newPath = root.replace(substring, ''); filePath = os.sep.join([newPath, filename]) @@ -30,7 +30,7 @@ def handleURL(url): baseFilename = os.path.basename(url) filename = os.path.splitext(baseFilename)[0] newUrl = MAP[filename] - print newUrl + print url + ' -> ' + newUrl return newUrl def handleOptions(): @@ -43,8 +43,12 @@ def main(): argsLength = len(sys.argv) if argsLength == 3: jsonFile = sys.argv[1] - gzipFile = jsonFile + '.gz' assetDirectory = sys.argv[2] + inputFilename = os.path.basename(jsonFile); + absPath = os.path.abspath(assetDirectory) + finalPath = absPath.replace('\\', '/'); + gzipFile = finalPath + '/' + inputFilename + '.gz' + print gzipFile createAssetMapping(assetDirectory) f = open(jsonFile) data = json.load(f)