From 98fadea8bf2d30785935efb1007446f62cd8dbdc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 17 Aug 2014 19:40:43 +0200 Subject: [PATCH] Fix shape lightmap optimize --- code/nel/tools/build_gamedata/processes/shape/0_setup.py | 1 + code/nel/tools/build_gamedata/processes/shape/2_build.py | 7 +++++-- code/nel/tools/build_gamedata/processes/shape/3_install.py | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/nel/tools/build_gamedata/processes/shape/0_setup.py b/code/nel/tools/build_gamedata/processes/shape/0_setup.py index 71dfd097e..941d07531 100755 --- a/code/nel/tools/build_gamedata/processes/shape/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -69,6 +69,7 @@ if BuildShadowSkinEnabled: printLog(log, ">>> Setup build directories <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) diff --git a/code/nel/tools/build_gamedata/processes/shape/2_build.py b/code/nel/tools/build_gamedata/processes/shape/2_build.py index 48a658378..1a9f668f8 100755 --- a/code/nel/tools/build_gamedata/processes/shape/2_build.py +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -77,16 +77,19 @@ else: # copy lightmap_not_optimized to lightmap printLog(log, ">>> Optimize lightmaps <<<") loPathLightmapsOriginal = ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory +loPathShapesOriginal = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory mkPath(log, loPathLightmapsOriginal) loPathLightmaps = ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory -loPathShapes = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory +loPathShapes = ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory loPathTags = ExportBuildDirectory + "/" + ShapeTagExportDirectory mkPath(log, loPathLightmaps) mkPath(log, loPathShapes) 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) 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 # lightmap_optimizer [path_tags] [path_flag8bit] subprocess.call([ LightmapOptimizer, loPathLightmaps, loPathShapes, loPathTags, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ]) diff --git a/code/nel/tools/build_gamedata/processes/shape/3_install.py b/code/nel/tools/build_gamedata/processes/shape/3_install.py index cb93a443b..f6265a1a6 100755 --- a/code/nel/tools/build_gamedata/processes/shape/3_install.py +++ b/code/nel/tools/build_gamedata/processes/shape/3_install.py @@ -46,8 +46,8 @@ printLog(log, "") printLog(log, ">>> Install shape <<<") installPath = InstallDirectory + "/" + ShapeInstallDirectory mkPath(log, installPath) -mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, installPath, ".shape") +mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory, installPath, ".shape") mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".shape") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".dds")