Fix shape lightmap optimize

This commit is contained in:
kaetemi 2014-08-17 19:40:43 +02:00
parent 083db51ce2
commit 53e2dd439b
3 changed files with 8 additions and 4 deletions

View file

@ -69,6 +69,7 @@ if BuildShadowSkinEnabled:
printLog(log, ">>> Setup build directories <<<") printLog(log, ">>> Setup build directories <<<")
mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory)

View file

@ -77,16 +77,19 @@ else:
# copy lightmap_not_optimized to lightmap # copy lightmap_not_optimized to lightmap
printLog(log, ">>> Optimize lightmaps <<<") printLog(log, ">>> Optimize lightmaps <<<")
loPathLightmapsOriginal = ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory loPathLightmapsOriginal = ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory
loPathShapesOriginal = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory
mkPath(log, loPathLightmapsOriginal) mkPath(log, loPathLightmapsOriginal)
loPathLightmaps = ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory loPathLightmaps = ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory
loPathShapes = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory loPathShapes = ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory
loPathTags = ExportBuildDirectory + "/" + ShapeTagExportDirectory loPathTags = ExportBuildDirectory + "/" + ShapeTagExportDirectory
mkPath(log, loPathLightmaps) mkPath(log, loPathLightmaps)
mkPath(log, loPathShapes) mkPath(log, loPathShapes)
mkPath(log, loPathTags) mkPath(log, loPathTags)
if needUpdateDirByTagLog(log, loPathLightmapsOriginal, ".txt", loPathLightmaps, ".txt") or needUpdateDirNoSubdir(log, loPathLightmapsOriginal, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathShapes, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathTags, loPathLightmaps): if needUpdateDirByTagLog(log, loPathLightmapsOriginal, ".txt", loPathLightmaps, ".txt") or needUpdateDirNoSubdir(log, loPathLightmapsOriginal, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathShapesOriginal, loPathShapes) or needUpdateDirNoSubdir(log, loPathShapes, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathTags, loPathLightmaps):
removeFilesRecursive(log, loPathLightmaps) removeFilesRecursive(log, loPathLightmaps)
copyFiles(log, loPathLightmapsOriginal, loPathLightmaps) copyFiles(log, loPathLightmapsOriginal, loPathLightmaps)
removeFilesRecursive(log, loPathShapes)
copyFiles(log, loPathShapesOriginal, loPathShapes)
# Optimize lightmaps if any. Additionnaly, output a file indicating which lightmaps are 8 bits # Optimize lightmaps if any. Additionnaly, output a file indicating which lightmaps are 8 bits
# lightmap_optimizer <path_lightmaps> <path_shapes> [path_tags] [path_flag8bit] # lightmap_optimizer <path_lightmaps> <path_shapes> [path_tags] [path_flag8bit]
subprocess.call([ LightmapOptimizer, loPathLightmaps, loPathShapes, loPathTags, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ]) subprocess.call([ LightmapOptimizer, loPathLightmaps, loPathShapes, loPathTags, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ])

View file

@ -46,8 +46,8 @@ printLog(log, "")
printLog(log, ">>> Install shape <<<") printLog(log, ">>> Install shape <<<")
installPath = InstallDirectory + "/" + ShapeInstallDirectory installPath = InstallDirectory + "/" + ShapeInstallDirectory
mkPath(log, installPath) mkPath(log, installPath)
mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory)
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, installPath, ".shape") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory, installPath, ".shape")
mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory)
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".shape") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".shape")
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".dds") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".dds")