saving work.

This commit is contained in:
Dante Ruiz 2018-04-11 10:24:01 -07:00
parent d8f0cfa89a
commit 67ec766af2
3 changed files with 22 additions and 5 deletions

View file

@ -37,7 +37,7 @@ bool DEV_DECIMATE_TEXTURES = false;
std::atomic<size_t> DECIMATED_TEXTURE_COUNT{ 0 }; std::atomic<size_t> DECIMATED_TEXTURE_COUNT{ 0 };
std::atomic<size_t> RECTIFIED_TEXTURE_COUNT{ 0 }; std::atomic<size_t> RECTIFIED_TEXTURE_COUNT{ 0 };
static const auto HDR_FORMAT = gpu::Element::COLOR_R11G11B10; static const auto& HDR_FORMAT = gpu::Element::COLOR_R11G11B10;
static std::atomic<bool> compressColorTextures { false }; static std::atomic<bool> compressColorTextures { false };
static std::atomic<bool> compressNormalTextures { false }; static std::atomic<bool> compressNormalTextures { false };

View file

@ -44,26 +44,34 @@ def groupKTXFiles(directory, filePath):
originalFilePath.strip() originalFilePath.strip()
shutil.move(originalFilePath, newFilePath) shutil.move(originalFilePath, newFilePath)
def bakeFile(filePath, outputDirectory): def bakeFile(filePath, outputDirectory, fileType):
createDirectory(outputDirectory) createDirectory(outputDirectory)
cmd = EXE + ' -i ' + filePath + ' -o ' + outputDirectory + ' -t fbx' cmd = EXE + ' -i ' + filePath + ' -o ' + outputDirectory + ' -t ' + fileType
args = shlex.split(cmd) args = shlex.split(cmd)
process = subprocess.Popen(cmd, stdout=False, stderr=False) process = subprocess.Popen(cmd, stdout=False, stderr=False)
process.wait() process.wait()
bakedFile = os.path.splitext(filePath)[0] bakedFile = os.path.splitext(filePath)[0]
groupKTXFiles(outputDirectory, bakedFile) if fileType == 'fbx':
groupKTXFiles(outputDirectory, bakedFile)
def bakeFilesInDirectory(directory, outputDirectory): def bakeFilesInDirectory(directory, outputDirectory):
rootDirectory = os.path.basename(os.path.normpath(directory)) rootDirectory = os.path.basename(os.path.normpath(directory))
for root, subFolders, filenames in os.walk(directory): for root, subFolders, filenames in os.walk(directory):
for filename in filenames: for filename in filenames:
appendPath = getRelativePath(directory, root, rootDirectory); appendPath = getRelativePath(directory, root, rootDirectory);
name, ext = os.path.splitext('file.txt')
if filename.endswith('.fbx'): if filename.endswith('.fbx'):
filePath = os.sep.join([root, filename]) filePath = os.sep.join([root, filename])
absFilePath = os.path.abspath(filePath) absFilePath = os.path.abspath(filePath)
outputFolder = os.path.join(outputDirectory, appendPath) outputFolder = os.path.join(outputDirectory, appendPath)
print "Baking file: " + filename print "Baking file: " + filename
bakeFile(absFilePath, outputFolder) bakeFile(absFilePath, outputFolder, 'fbx')
elif os.path.basename(root) == 'skyboxes':
filePath = os.sep.join([root, filename])
absFilePath = os.path.abspath(filePath)
outputFolder = os.path.join(outputDirectory, appendPath)
print "Baking file: " + filename
bakeFile(absFilePath, outputFolder, 'png')
else: else:
filePath = os.sep.join([root, filename]) filePath = os.sep.join([root, filename])
absFilePath = os.path.abspath(filePath) absFilePath = os.path.abspath(filePath)

View file

@ -65,6 +65,15 @@ def main():
except: except:
value = handleURL(value) value = handleURL(value)
if prop == "ambientLight":
for index in value:
value[index] = handleURL(value[index])
if prop == "skybox":
for index in value:
value[index] = handleURL(value[index])
if prop == "serverScripts": if prop == "serverScripts":
value = handleURL(value) value = handleURL(value)