mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-19 05:36:13 +00:00
Implement skip for ig elevation
This commit is contained in:
parent
1b6f0c6133
commit
b78130b058
1 changed files with 49 additions and 28 deletions
|
@ -54,34 +54,56 @@ mkPath(log, configDir)
|
||||||
|
|
||||||
def igElevation(inputIgDir, outputIgDir):
|
def igElevation(inputIgDir, outputIgDir):
|
||||||
printLog(log, ">>> IG Elevation <<<")
|
printLog(log, ">>> IG Elevation <<<")
|
||||||
|
needUpdateIg = needUpdateDirByTagLog(log, inputIgDir, ".ig", outputIgDir, ".ig")
|
||||||
mkPath(log, inputIgDir)
|
if needUpdateIg:
|
||||||
mkPath(log, outputIgDir)
|
printLog(log, "DETECT UPDATE IG->Elevated")
|
||||||
mkPath(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory)
|
else:
|
||||||
|
printLog(log, "DETECT SKIP IG->Elevated")
|
||||||
configFile = configDir + "/ig_elevation.cfg"
|
needUpdateHeightMap = needUpdateFileDirNoSubdir(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1, outputIgDir) or needUpdateFileDirNoSubdir(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2, outputIgDir)
|
||||||
if os.path.isfile(configFile):
|
if needUpdateHeightMap:
|
||||||
|
printLog(log, "DETECT UPDATE HeightMap->Elevated")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP HeightMap->Elevated")
|
||||||
|
needUpdateLand = needUpdateFileDirNoSubdir(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand, outputIgDir)
|
||||||
|
if needUpdateLand:
|
||||||
|
printLog(log, "DETECT UPDATE Land->Elevated")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP Land->Elevated")
|
||||||
|
if needUpdateIg or needUpdateHeightMap or needUpdateLand:
|
||||||
|
printLog(log, "DETECT DECIDE UPDATE")
|
||||||
|
mkPath(log, inputIgDir)
|
||||||
|
mkPath(log, outputIgDir)
|
||||||
|
mkPath(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory)
|
||||||
|
|
||||||
|
configFile = configDir + "/ig_elevation.cfg"
|
||||||
|
if os.path.isfile(configFile):
|
||||||
|
os.remove(configFile)
|
||||||
|
|
||||||
|
printLog(log, "CONFIG " + configFile)
|
||||||
|
cf = open(configFile, "w")
|
||||||
|
cf.write("// ig_elevation.cfg\n")
|
||||||
|
cf.write("\n")
|
||||||
|
cf.write("InputIGDir = \"" + inputIgDir + "\";\n")
|
||||||
|
cf.write("OutputIGDir = \"" + outputIgDir + "\";\n")
|
||||||
|
cf.write("\n")
|
||||||
|
cf.write("CellSize = 160.0;")
|
||||||
|
cf.write("\n")
|
||||||
|
cf.write("HeightMapFile1 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1 + "\";\n")
|
||||||
|
cf.write("ZFactor1 = " + LigoExportZFactor1 + ";\n")
|
||||||
|
cf.write("HeightMapFile2 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2 + "\";\n")
|
||||||
|
cf.write("ZFactor2 = " + LigoExportZFactor2 + ";\n")
|
||||||
|
cf.write("\n")
|
||||||
|
cf.write("LandFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand + "\";\n")
|
||||||
|
cf.write("\n")
|
||||||
|
cf.close()
|
||||||
|
subprocess.call([ IgElevation, configFile ])
|
||||||
os.remove(configFile)
|
os.remove(configFile)
|
||||||
|
|
||||||
printLog(log, "CONFIG " + configFile)
|
# Copy remaining IG files
|
||||||
cf = open(configFile, "w")
|
copyFilesLogless(log, inputIgDir, outputIgDir)
|
||||||
cf.write("// ig_elevation.cfg\n")
|
else:
|
||||||
cf.write("\n")
|
printLog(log, "DETECT DECIDE SKIP")
|
||||||
cf.write("InputIGDir = \"" + inputIgDir + "\";\n")
|
printLog(log, "SKIP *")
|
||||||
cf.write("OutputIGDir = \"" + outputIgDir + "\";\n")
|
|
||||||
cf.write("\n")
|
|
||||||
cf.write("CellSize = 160.0;")
|
|
||||||
cf.write("\n")
|
|
||||||
cf.write("HeightMapFile1 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1 + "\";\n")
|
|
||||||
cf.write("ZFactor1 = " + LigoExportZFactor1 + ";\n")
|
|
||||||
cf.write("HeightMapFile2 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2 + "\";\n")
|
|
||||||
cf.write("ZFactor2 = " + LigoExportZFactor2 + ";\n")
|
|
||||||
cf.write("\n")
|
|
||||||
cf.write("LandFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand + "\";\n")
|
|
||||||
cf.write("\n")
|
|
||||||
cf.close()
|
|
||||||
subprocess.call([ IgElevation, configFile ])
|
|
||||||
os.remove(configFile)
|
|
||||||
|
|
||||||
# Build process
|
# Build process
|
||||||
if (ContinentLeveldesignWorldDirectory != "") or (len(IgOtherSourceDirectories) > 0):
|
if (ContinentLeveldesignWorldDirectory != "") or (len(IgOtherSourceDirectories) > 0):
|
||||||
|
@ -134,7 +156,6 @@ if (ContinentLeveldesignWorldDirectory != "") or (len(IgOtherSourceDirectories)
|
||||||
igElevation(ExportBuildDirectory + "/" + LigoIgLandBuildDirectory, ExportBuildDirectory + "/" + IgElevLandLigoBuildDirectory)
|
igElevation(ExportBuildDirectory + "/" + LigoIgLandBuildDirectory, ExportBuildDirectory + "/" + IgElevLandLigoBuildDirectory)
|
||||||
|
|
||||||
igElevation(ExportBuildDirectory + "/" + IgStaticLandExportDirectory, ExportBuildDirectory + "/" + IgElevLandStaticBuildDirectory)
|
igElevation(ExportBuildDirectory + "/" + IgStaticLandExportDirectory, ExportBuildDirectory + "/" + IgElevLandStaticBuildDirectory)
|
||||||
|
|
||||||
|
|
||||||
printLog(log, ">>> Merge land IGs <<<")
|
printLog(log, ">>> Merge land IGs <<<")
|
||||||
mkPath(log, ExportBuildDirectory + "/" + IgTempLandMergeBuildDirectory)
|
mkPath(log, ExportBuildDirectory + "/" + IgTempLandMergeBuildDirectory)
|
||||||
|
|
Loading…
Reference in a new issue