mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-05 21:02:25 +02:00
add baking of skyboxes
This commit is contained in:
parent
67ec766af2
commit
5fdcd12375
2 changed files with 9 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue