From 343f7e8c3924683a0040edc51544142e6df6accb Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 7 Feb 2014 17:16:40 +0100 Subject: [PATCH] Add build shadow skin to shape process --- .../ecosystem_project_template/process.py | 4 +--- .../build_gamedata/processes/shape/0_setup.py | 2 ++ .../build_gamedata/processes/shape/2_build.py | 21 ++++++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py index 3bacb5310..2e3d9643a 100644 --- a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py @@ -82,8 +82,6 @@ ShapeExportOptLightmapLog = "%PreGenShapeExportOptLightmapLog%" # Coarse mesh texture mul size TextureMulSizeValue = "%PreGenTextureMulSizeValue%" -DoBuildShadowSkin = 0 - ClodConfigFile = "" # *** COARSE MESH TEXTURE NAME *** @@ -117,7 +115,7 @@ MapHlsBankFileName = None # *** SHAPE BUILD OPTIONS * -DoBuildShadowSkin = False +BuildShadowSkinEnabled = False ClodConfigFile = "" # *** PACS_PRIM OPTIONS *** 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 6dbcd5978..71dfd097e 100644 --- a/code/nel/tools/build_gamedata/processes/shape/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -62,6 +62,8 @@ mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirector mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) if ClodConfigFile != "": mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) +if BuildShadowSkinEnabled: + mkPath(log, ExportBuildDirectory + "/" + ShapeShadowSkinBuildDirectory) # Setup build directories printLog(log, ">>> Setup build directories <<<") 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 65462af83..1d8113ff9 100644 --- a/code/nel/tools/build_gamedata/processes/shape/2_build.py +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -51,21 +51,28 @@ LightmapOptimizer = findTool(log, ToolDirectories, LightmapOptimizerTool, ToolSu TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) BuildCoarseMesh = findTool(log, ToolDirectories, BuildCoarseMeshTool, ToolSuffix) -if DoBuildShadowSkin: +shapeDirectory = ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory +if BuildShadowSkinEnabled: + mkPath(log, shapeDirectory) + shadowSkinBuildDirectory = ExportBuildDirectory + "/" + ShapeShadowSkinBuildDirectory printLog(log, ">>> BuildShadowSkin <<<") - printLog(log, "********************************") - printLog(log, "******** TODO ********") - printLog(log, "********************************") + shadowSkinShapes = findFilesNoSubdir(log, shapeDirectory, ".shape") + for shadowSkinShape in shadowSkinShapes: + srcShape = shapeDirectory + "/" + shadowSkinShape + dstShape = shadowSkinBuildDirectory + "/" + shadowSkinShape + if needUpdateLogRemoveDest(log, srcShape, dstShape): + subprocess.call([ BuildShadowSkin, srcShape, dstShape, str(BuildShadowSkinRatio), str(BuildShadowSkinMaxface) ]) + shapeDirectory = shadowSkinBuildDirectory -mkPath(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory) +mkPath(log, shapeDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) if ClodConfigFile != "": mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) printLog(log, ">>> Build CLodTex <<<") - subprocess.call([ BuildClodtex, "-d", DatabaseDirectory + "/" + ClodConfigFile, ExportBuildDirectory + "/" + ClodExportDirectory, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory ]) + subprocess.call([ BuildClodtex, "-d", DatabaseDirectory + "/" + ClodConfigFile, ExportBuildDirectory + "/" + ClodExportDirectory, shapeDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory ]) else: printLog(log, ">>> Copy Shape <<<") - copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, ".shape") + copyFilesExtNoTreeIfNeeded(log, shapeDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, ".shape") # copy lightmap_not_optimized to lightmap printLog(log, ">>> Optimize lightmaps <<<")