From 96935c5be2f450ebd4269b9f7e86449017c79976 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 3 Sep 2010 12:37:35 +0200 Subject: [PATCH] Added: #929 Generators for ecosystem projects, all four ecosystem projects, generators for max exporter scripts, rbank cmb export. Changed: #929 Improved skipping of exported max files, corrected search paths for some tools configurations. --- .../build_gamedata/configuration/scripts.py | 25 ++ .../ecosystem_project_template/directories.py | 196 ++++++++++ .../ecosystem_project_template/process.py | 120 ++++++ .../build_gamedata/generators/generate_all.py | 65 ++++ .../generators/generate_ecosystem_projects.py | 278 ++++++++++++++ .../generate_simple_max_exporters.py | 104 +++++ .../generate_tagged_max_exporters.py | 114 ++++++ .../generators/max_exporter_scripts/anim.ms | 69 ++++ .../generators/max_exporter_scripts/anim.py | 0 .../generators/max_exporter_scripts/clod.ms | 123 ++++++ .../generators/max_exporter_scripts/clod.py | 0 .../generators/max_exporter_scripts/cmb.ms | 59 +++ .../generators/max_exporter_scripts/cmb.py | 0 .../generators/max_exporter_scripts/ig.ms | 172 +++++++++ .../max_exporter_scripts/pacs_prim.ms | 47 +++ .../max_exporter_scripts/pacs_prim.py | 16 + .../generators/max_exporter_scripts/skel.ms | 53 +++ .../generators/max_exporter_scripts/skel.py | 8 + .../generators/max_exporter_scripts/swt.ms | 28 ++ .../generators/max_exporter_scripts/swt.py | 0 .../generators/max_exporter_scripts/veget.ms | 113 ++++++ .../generators/max_exporter_scripts/veget.py | 0 .../generators/max_exporter_scripts/zone.ms | 86 +++++ .../generators/max_exporter_scripts/zone.py | 8 + .../simple_max_exporter_template/0_setup.py | 65 ++++ .../1_export_footer.py | 7 + .../1_export_header.py | 92 +++++ .../simple_max_exporter_template/2_build.py | 49 +++ .../simple_max_exporter_template/3_install.py | 57 +++ .../export_footer.ms | 74 ++++ .../export_header.ms | 63 +++ .../tagged_max_exporter_template/0_setup.py | 66 ++++ .../1_export_footer.py | 7 + .../1_export_header.py | 96 +++++ .../tagged_max_exporter_template/2_build.py | 49 +++ .../tagged_max_exporter_template/3_install.py | 57 +++ .../export_footer.ms | 89 +++++ .../export_header.ms | 63 +++ .../build_gamedata/processes/anim/1_export.py | 83 ++-- .../processes/anim/maxscript/anim_export.ms | 177 +++++---- .../processes/clodbank/1_export.py | 90 +++-- .../clodbank/maxscript/clod_export.ms | 302 ++++++++------- .../build_gamedata/processes/ig/1_export.py | 28 +- .../processes/ig/maxscript/ig_export.ms | 360 +++++++++--------- .../build_gamedata/processes/ligo/0_setup.py | 2 +- .../build_gamedata/processes/ligo/1_export.py | 6 +- .../processes/pacs_prim/1_export.py | 85 +++-- .../pacs_prim/maxscript/pacs_prim_export.ms | 133 ++++--- .../build_gamedata/processes/rbank/0_setup.py | 4 + .../processes/rbank/1_export.py | 59 ++- .../processes/rbank/maxscript/cmb_export.ms | 211 ++++++++++ .../processes/shape/1_export.py | 20 +- .../build_gamedata/processes/skel/1_export.py | 84 ++-- .../processes/skel/maxscript/skel_export.ms | 170 +++++---- .../build_gamedata/processes/swt/1_export.py | 84 ++-- .../processes/swt/maxscript/swt_export.ms | 122 +++--- .../build_gamedata/processes/veget/0_setup.py | 2 +- .../processes/veget/1_export.py | 65 ++-- .../build_gamedata/processes/veget/2_build.py | 2 +- .../processes/veget/3_install.py | 10 +- .../processes/veget/maxscript/veget_export.ms | 242 ++++++------ .../build_gamedata/processes/zone/0_setup.py | 2 +- .../build_gamedata/processes/zone/1_export.py | 64 +++- .../processes/zone/maxscript/zone_export.ms | 223 +++++++++++ .../processes/zone_light/0_setup.py | 1 + .../processes/zone_light/2_build.py | 8 +- .../continents/newbieland/directories.py | 10 +- .../continents/newbieland/process.py | 11 +- .../ecosystems/desert/directories.py | 245 ++++++++++++ .../workspace/ecosystems/desert/process.py | 128 +++++++ .../ecosystems/jungle/directories.py | 104 +++-- .../workspace/ecosystems/jungle/process.py | 49 ++- .../ecosystems/lacustre/directories.py | 257 +++++++++++++ .../workspace/ecosystems/lacustre/process.py | 128 +++++++ .../ecosystems/primes_racines/directories.py | 242 ++++++++++++ .../ecosystems/primes_racines/process.py | 128 +++++++ .../build_gamedata/workspace/projects.py | 7 +- 77 files changed, 5430 insertions(+), 1036 deletions(-) create mode 100644 code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py create mode 100644 code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_all.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py create mode 100644 code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms create mode 100644 code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms create mode 100644 code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms create mode 100644 code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms create mode 100644 code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py index a919b89a6..128238494 100644 --- a/code/nel/tools/build_gamedata/configuration/scripts.py +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -215,6 +215,31 @@ def findFile(log, dir_where, file_name): printLog(log, "findFile: file not dir or file?! " + filePath) return "" +def needUpdateDirByTagLog(log, dir_source, ext_source, dir_dest, ext_dest): + updateCount = 0 + skipCount = 0 + lenSrcExt = len(ext_source) + sourceFiles = findFilesNoSubdir(log, dir_source, ext_source) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + sourceFile = dir_source + "/" + file + tagFile = dir_dest + "/" + file[0:-lenSrcExt] + ext_dest + if os.path.isfile(tagFile): + sourceTime = os.stat(sourceFile).st_mtime + tagTime = os.stat(tagFile).st_mtime + if (sourceTime > tagTime): + updateCount = updateCount + 1 + else: + skipCount = skipCount + 1 + else: + updateCount = updateCount + 1 + if updateCount > 0: + printLog(log, "UPDATE " + str(updateCount) + " / " + str(len(sourceFiles)) + "; SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 1 + else: + printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 0 + def needUpdateDirNoSubdirLogExt(log, dir_source, ext_source, dir_dest, ext_dest): latestSourceFile = 0 latestDestFile = 0 diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py new file mode 100644 index 000000000..50157963e --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py @@ -0,0 +1,196 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for '%PreGenEcosystemName%' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "%PreGenEcosystemName%" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "%PreGenDatabaseRootName%" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +%PreGenMapSubdirectories%MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +%PreGenTileSourceDirectories% +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" 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 new file mode 100644 index 000000000..7a7478b99 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py @@ -0,0 +1,120 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for '%PreGenEcosystemName%' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "%PreGenEcosystemName%" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "%PreGenShapeExportOptExportLighting%" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "%PreGenShapeExportOptShadow%" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = %PreGenShapeExportOptLightingLimit% + +# Lightmap lumel size +ShapeExportOptLumelSize = "%PreGenShapeExportOptLumelSize%" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = %PreGenShapeExportOptOversampling% + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "%PreGenShapeExportOpt8BitsLightmap%" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "%PreGenShapeExportOptLightmapLog%" + +# Coarse mesh texture mul size +TextureMulSizeValue = "%PreGenTextureMulSizeValue%" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +%PreGenCoarseMeshTextureNames% +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +%PreGenMultipleTilesPostfix% +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/nel/tools/build_gamedata/generators/generate_all.py b/code/nel/tools/build_gamedata/generators/generate_all.py new file mode 100644 index 000000000..f6af77bc2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_all.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_all.log"): + os.remove("generate_all.log") +log = open("generate_all.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate all") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_simple_max_exporters.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_tagged_max_exporters.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_ecosystem_projects.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py new file mode 100644 index 000000000..7802b16f6 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py @@ -0,0 +1,278 @@ +#!/usr/bin/python +# +# \file generate_ecosystem_projects.py +# \brief Run all setup processes +# \date 2010-09-02 10:36GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Generate ecosystem projects +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_ecosystem_projects.log"): + os.remove("generate_ecosystem_projects.log") +log = open("generate_ecosystem_projects.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate ecosystem projects") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +templateDir = os.getcwd().replace("\\", "/") + "/ecosystem_project_template" +mkPath(log, templateDir) + +os.chdir("..") + + +# Scroll down to add an ecosystem. + + + +DefaultShapeExportOptExportLighting = "true" +DefaultShapeExportOptShadow = "true" +DefaultShapeExportOptLightingLimit = "1" +DefaultShapeExportOptLumelSize = "0.25" +DefaultShapeExportOptOversampling = "1" +DefaultShapeExportOpt8BitsLightmap = "true" +DefaultShapeExportOptLightmapLog = "true" +DefaultTextureMulSizeValue = "1.5" +DefaultSeasonSuffixes = [ "sp" ] + [ "su" ] + [ "au" ] + [ "wi" ] +DefaultMapSubdirectories = [ ] +DefaultTileDirectories = [ ] + + +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = DefaultShapeExportOpt8BitsLightmap +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = DefaultMapSubdirectories +TileDirectories = DefaultTileDirectories + + +PreGenDateTimeStamp = None +PreGenEcosystemName = None +PreGenDatabaseRootName = None +PreGenCoarseMeshTextureNames = None +PreGenMultipleTilesPostfix = None +PreGenMapSubdirectories = None +PreGenTileSourceDirectories = None + + +def transformLine(line): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", PreGenDateTimeStamp) + + newline = newline.replace("%PreGenEcosystemName%", PreGenEcosystemName) + newline = newline.replace("%PreGenDatabaseRootName%", PreGenDatabaseRootName) + + newline = newline.replace("%PreGenCoarseMeshTextureNames%", PreGenCoarseMeshTextureNames) + newline = newline.replace("%PreGenMultipleTilesPostfix%", PreGenMultipleTilesPostfix) + newline = newline.replace("%PreGenMapSubdirectories%", PreGenMapSubdirectories) + newline = newline.replace("%PreGenTileSourceDirectories%", PreGenTileSourceDirectories) + + newline = newline.replace("%PreGenShapeExportOptExportLighting%", ShapeExportOptExportLighting) + newline = newline.replace("%PreGenShapeExportOptShadow%", ShapeExportOptShadow) + newline = newline.replace("%PreGenShapeExportOptLightingLimit%", ShapeExportOptLightingLimit) + newline = newline.replace("%PreGenShapeExportOptLumelSize%", ShapeExportOptLumelSize) + newline = newline.replace("%PreGenShapeExportOptOversampling%", ShapeExportOptOversampling) + newline = newline.replace("%PreGenShapeExportOpt8BitsLightmap%", ShapeExportOpt8BitsLightmap) + newline = newline.replace("%PreGenShapeExportOptLightmapLog%", ShapeExportOptLightmapLog) + newline = newline.replace("%PreGenTextureMulSizeValue%", TextureMulSizeValue) + newline = newline.replace("%PreGenTileSourceDirectories%", PreGenTileSourceDirectories) + + return newline + +def generateFile(sourceFile, destFile): + srcf = open(sourceFile, "r") + dstf = open(destFile, "w") + printLog(log, "WRITE " + destFile) + for line in srcf: + dstf.write(transformLine(line)) + dstf.close() + srcf.close() + +def generateEcosystem(ecosystemName, databaseRootName): + global PreGenEcosystemName + PreGenEcosystemName = ecosystemName + global PreGenDatabaseRootName + PreGenDatabaseRootName = databaseRootName + global PreGenDateTimeStamp + PreGenDateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + + global PreGenMultipleTilesPostfix + PreGenMultipleTilesPostfix = "" + global PreGenCoarseMeshTextureNames + PreGenCoarseMeshTextureNames = "" + global PreGenTileSourceDirectories + PreGenTileSourceDirectories = "" + for suffix in SeasonSuffixes: + PreGenMultipleTilesPostfix += "MultipleTilesPostfix += [ \"_" + suffix + "\" ]\n" + PreGenCoarseMeshTextureNames += "CoarseMeshTextureNames += [ \"nel_coarse_mesh_\" + EcosystemName + \"_" + suffix + "\" ]\n" + for tiledir in TileDirectories: + PreGenTileSourceDirectories += "TilesSourceDirectories += [ \"landscape/_texture_tiles/\" + EcosystemName + \"_" + suffix + "/" + tiledir + "\" ]\n" + global PreGenMapSubdirectories + PreGenMapSubdirectories = "" + for subdir in MapSubdirectories: + PreGenMapSubdirectories += "MapSourceDirectories += [ DatabaseRootPath + \"/decors/_textures/" + subdir + "\" ]\n" + + destDir = WorkspaceDirectory + "/ecosystems/" + ecosystemName + mkPath(log, destDir) + + generateFile(templateDir + "/process.py", destDir + "/process.py") + generateFile(templateDir + "/directories.py", destDir + "/directories.py") + + return + + + +# Add new ecosystems below this line. + + + +# DESERT +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = DefaultShapeExportOpt8BitsLightmap +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "1.5-marecage_profond" ] +TileDirectories += [ "1-marecages" ] +TileDirectories += [ "2-citees" ] +TileDirectories += [ "3-fond_canyon" ] +TileDirectories += [ "4.2-boisbandeclair" ] +TileDirectories += [ "4.5-desert2boisbande" ] +TileDirectories += [ "4-falaise_bois_bande" ] +TileDirectories += [ "5-falaise_normales" ] +TileDirectories += [ "6.5-desertalternatif" ] +TileDirectories += [ "6-desert" ] +TileDirectories += [ "7-routes" ] +TileDirectories += [ "8-foretbrule" ] +generateEcosystem("desert", "fyros") + + +# JUNGLE +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "10-crevassejungle" ] +TileDirectories += [ "11-paroisjungle" ] +TileDirectories += [ "12-vasejungle" ] +TileDirectories += [ "1-junglemousse" ] +TileDirectories += [ "2-junglefeuilles" ] +TileDirectories += [ "3-jungleherbesseche" ] +TileDirectories += [ "4-jungleherbevieille" ] +TileDirectories += [ "5-jungleterreaux" ] +TileDirectories += [ "6-junglegoo" ] +TileDirectories += [ "7-sciurejungle" ] +TileDirectories += [ "8-terrejungle" ] +TileDirectories += [ "9-falaisejungle" ] +TileDirectories += [ "Transitions" ] +generateEcosystem("jungle", "jungle") + + +# PRIMES RACINES +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +MapSubdirectories += [ "batiments" ] +TileDirectories = [ ] +TileDirectories += [ "PR-creux" ] +TileDirectories += [ "PR-dome-moussu" ] +TileDirectories += [ "PR-kitiniere" ] +TileDirectories += [ "PR-mousse-licken" ] +TileDirectories += [ "PR-mousse-spongieus" ] +TileDirectories += [ "PR-parois" ] +TileDirectories += [ "PR-sol-mousse" ] +TileDirectories += [ "PR-souche" ] +TileDirectories += [ "PR-stalagmite" ] +TileDirectories += [ "PR-terre" ] +TileDirectories += [ "aditif" ] +generateEcosystem("primes_racines", "primes_racines") + + +# LACUSTRE +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = "0" +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = "8" +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "1a-sable-marin" ] +TileDirectories += [ "1-plages" ] +TileDirectories += [ "2-iles" ] +TileDirectories += [ "2-ilesa" ] +TileDirectories += [ "2-iles-marines" ] +TileDirectories += [ "3-fondmarin2plage" ] +TileDirectories += [ "4-marecages" ] +TileDirectories += [ "5-marecages" ] +TileDirectories += [ "5-parois-marine" ] +TileDirectories += [ "6-fond_marin" ] +TileDirectories += [ "7-bassesiles" ] +TileDirectories += [ "7-mousseter" ] +TileDirectories += [ "7-racines" ] +TileDirectories += [ "8-mousse_marine" ] +TileDirectories += [ "constructible" ] +generateEcosystem("lacustre", "tryker") + + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py new file mode 100644 index 000000000..d6d65d689 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_simple_max_exporters.log"): + os.remove("generate_simple_max_exporters.log") +log = open("generate_simple_max_exporters.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate simple max exporters") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +def processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", dateTimeStamp) + newline = newline.replace("%PreGenProcessName%", processName) + newline = newline.replace("%PreGenFileExtension%", fileExtension) + newline = newline.replace("%PreGenSourceDirectoriesVariable%", sourceDirectoriesVariable) + newline = newline.replace("%PreGenExportDirectoryVariable%", exportDirectoryVariable) + newline = newline.replace("%PreGenClientDirectoryVariable%", clientDirectoryVariable) + return newline + +def generateSimpleMaxExporterFile(sourceFile, destFile, writeMode, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + srcf = open(sourceFile, "r") + dstf = open(destFile, writeMode) + printLog(log, "WRITE " + destFile + " " + writeMode) + for line in srcf: + dstf.write(processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp)) + dstf.close() + srcf.close() + +def generateSimpleMaxExporter(processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + maxscriptDir = processDir + "/maxscript" + mkPath(log, maxscriptDir) + templateDir = os.getcwd().replace("\\", "/") + "/simple_max_exporter_template" + mkPath(log, templateDir) + scriptDir = os.getcwd().replace("\\", "/") + "/max_exporter_scripts" + mkPath(log, scriptDir) + + if not os.path.isfile(processDir + "/0_setup.py"): + generateSimpleMaxExporterFile(templateDir + "/0_setup.py", processDir + "/0_setup.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateSimpleMaxExporterFile(templateDir + "/1_export_header.py", processDir + "/1_export.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(scriptDir + "/" + fileExtension + ".py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(templateDir + "/1_export_footer.py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + if not os.path.isfile(processDir + "/2_build.py"): + generateSimpleMaxExporterFile(templateDir + "/2_build.py", processDir + "/2_build.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + if not os.path.isfile(processDir + "/3_install.py"): + generateSimpleMaxExporterFile(templateDir + "/3_install.py", processDir + "/3_install.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateSimpleMaxExporterFile(templateDir + "/export_header.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(scriptDir + "/" + fileExtension + ".ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(templateDir + "/export_footer.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + + +generateSimpleMaxExporter("pacs_prim", "pacs_prim", "PacsPrimSourceDirectories", "PacsPrimExportDirectory", "PacsPrimClientDirectory") + +generateSimpleMaxExporter("anim", "anim", "AnimSourceDirectories", "AnimExportDirectory", "AnimClientDirectory") + +generateSimpleMaxExporter("skel", "skel", "SkelSourceDirectories", "SkelExportDirectory", "SkelClientDirectory") + +generateSimpleMaxExporter("swt", "swt", "SwtSourceDirectories", "SwtExportDirectory", "SwtClientDirectory") + +generateSimpleMaxExporter("zone", "zone", "ZoneSourceDirectory", "ZoneExportDirectory", "ZoneClientDirectory") + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py new file mode 100644 index 000000000..d7a62a478 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py @@ -0,0 +1,114 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_tagged_max_exporters.log"): + os.remove("generate_tagged_max_exporters.log") +log = open("generate_tagged_max_exporters.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate tagged max exporters") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +templateDir = os.getcwd().replace("\\", "/") + "/tagged_max_exporter_template" +mkPath(log, templateDir) +scriptDir = os.getcwd().replace("\\", "/") + "/max_exporter_scripts" +mkPath(log, scriptDir) + +def processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", dateTimeStamp) + newline = newline.replace("%PreGenProcessName%", processName) + newline = newline.replace("%PreGenFileExtension%", fileExtension) + newline = newline.replace("%PreGenSourceDirectoriesVariable%", sourceDirectoriesVariable) + newline = newline.replace("%PreGenExportDirectoryVariable%", exportDirectoryVariable) + newline = newline.replace("%PreGenTagExportDirectoryVariable%", tagExportDirectoryVariable) + newline = newline.replace("%PreGenClientDirectoryVariable%", clientDirectoryVariable) + return newline + +def generateTaggedMaxExporterFile(sourceFile, destFile, writeMode, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + srcf = open(sourceFile, "r") + dstf = open(destFile, writeMode) + printLog(log, "WRITE " + destFile + " " + writeMode) + for line in srcf: + dstf.write(processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp)) + dstf.close() + srcf.close() + +def generateTaggedMaxScriptFile(processDir, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + maxscriptDir = processDir + "/maxscript" + mkPath(log, maxscriptDir) + generateTaggedMaxExporterFile(templateDir + "/export_header.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(scriptDir + "/" + fileExtension + ".ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(templateDir + "/export_footer.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + +def generateTaggedMaxScript(processName, fileExtension): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + + generateTaggedMaxScriptFile(processDir, processName, fileExtension, "_invalid", "_invalid", "_invalid", "_invalid", dateTimeStamp) + +def generateTaggedMaxExporter(processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + + if not os.path.isfile(processDir + "/0_setup.py"): + generateTaggedMaxExporterFile(templateDir + "/0_setup.py", processDir + "/0_setup.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateTaggedMaxExporterFile(templateDir + "/1_export_header.py", processDir + "/1_export.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(scriptDir + "/" + fileExtension + ".py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(templateDir + "/1_export_footer.py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + if not os.path.isfile(processDir + "/2_build.py"): + generateTaggedMaxExporterFile(templateDir + "/2_build.py", processDir + "/2_build.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + if not os.path.isfile(processDir + "/3_install.py"): + generateTaggedMaxExporterFile(templateDir + "/3_install.py", processDir + "/3_install.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateTaggedMaxScriptFile(processDir, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + + +generateTaggedMaxExporter("clodbank", "clod", "ClodSourceDirectories", "ClodExportDirectory", "ClodTagExportDirectory", "ClodClientDirectory") + +generateTaggedMaxScript("ig", "ig") + +generateTaggedMaxExporter("rbank", "cmb", "RBankCmbSourceDirectories", "RBankCmbExportDirectory", "RBankCmbTagExportDirectory", "PacsClientDirectory") + +generateTaggedMaxExporter("veget", "veget", "VegetSourceDirectories", "VegetExportDirectory", "VegetTagExportDirectory", "VegetClientDirectory") + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms new file mode 100644 index 000000000..c189e71f8 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms @@ -0,0 +1,69 @@ + + +NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + select $Bip01 + + -- Always uncheck triangle pelvis + if (classof $Bip01) == Biped_Object then + ( + $Bip01.controller.figureMode = true + $Bip01.controller.trianglepelvis = false + $Bip01.controller.figureMode = false + ) + ) + + -- For each node + for node in objects do + ( + exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION + if (exportNodeAnmation != undefined) then + ( + if (exportNodeAnmation == "1") then + ( + selectmore node + + -- Is it a biped ? + if (classof node.controller) == Vertical_Horizontal_Turn then + ( + -- Always uncheck triangle pelvis + node.controller.trianglepelvis = false + ) + ) + ) + ) + + if ((selection as array).count != 0) then + ( + -- Export the animation + if (NelExportAnimation (selection as array) outputNelFile false) == false then + ( + nlerror("ERROR exporting animation " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting animation: no node animated to export in file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms new file mode 100644 index 000000000..29744c7d1 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms @@ -0,0 +1,123 @@ + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me +NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + + +-- Must export this node ? +fn isToBeExported node = +( + if ((classof node) == RklPatch) then + return false + + if ((classof node) == nel_ps) then + return false + + if ((classof node) == nel_pacs_cylinder) then + return false + + if ((classof node) == nel_pacs_box) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + return true +) + + +-- is this node flagged as a LodCharacter ?? +fn isLodCharacter node = +( + isCLod = getappdata node NEL3D_APPDATA_CHARACTER_LOD + if (isCLod == undefined) then + return false + if (isCLod == "1") then + return true + return false +) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Is a Lod character? + if ((isLodCharacter node) == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".clod") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the shape + if (NelExportLodCharacter node outputNelFile false) == true then + ( + nlerror("OK " + outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if (exported == 0) then + ( + -- Error + nlerror ("WARNING no .clod exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms new file mode 100644 index 000000000..2a7492c29 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms @@ -0,0 +1,59 @@ + + +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 + + +-- Must export this node ? +fn isToBeExported node = +( + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + return false +) + +fn runNelMaxExport inputMaxFile = +( + outputNelDir = "%OutputDirectory%" + + -- Tag this file ? + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Select all collision mesh + max select none + for m in geometry do + ( + if (isToBeExported m) == true then + selectmore m + ) + + -- Export the collision + if (NelExportCollision ($selection as array) outputNelDir) == false then + ( + nlerror("ERROR exporting collision " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK collision in folder " + outputNelDir) + ) + + return tagThisFile +) + + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms new file mode 100644 index 000000000..7c9563088 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms @@ -0,0 +1,172 @@ + + +-- Some globals + +NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized + -- "0" = is not an accelerator and IS NOT clusterized (always visible) + -- "1" = is an accelerator type PORTAL + -- "2" = is an accelerator type CLUSTER + -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE + -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER + -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER + -- "17" = is an accelerator type PORTAL DYNAMIC + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 +NEL3D_APPDATA_LOD = 1423062537 +NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD +NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 +NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX +NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 +NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 + +NEL_OBJECT_NAME_DATA = 1970 + + +-- This node is n accelerator ? +fn isAccelerator node = +( + accel = getappdata node NEL3D_APPDATA_ACCEL + if (accel != undefined) then + ( + if (accel == "0") or (accel == "32") then + return false + else + return true + ) + return false +) + +-- Get the ig name of this object +fn getIg node = +( + return (getappdata node NEL3D_APPDATA_IGNAME) +) + + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Ig array + ig_array = #() + + -- Scan all the ig in this project + for node in objects do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") ) then + ( + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + exit + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + -- Have some ig ? + if (ig_array.count != 0) then + ( + -- For each ig + for ig = 1 to ig_array.count do + ( + -- Output filename + outputNelFile = ("%OutputDirectory%/" + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Select none + max select none + + -- Select all node in this ig + for node in geometry do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in lights do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in helpers do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + + -- Check export + try + ( + -- Export the ig + instancegroup2export = $selection as array + if (NelExportInstanceGroup instancegroup2export outputNelFile) == true then + ( + nlerror("OK " + outputNelFile) + ) + else + ( + -- Error + nlerror("ERROR exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + nlerror("SKIPPED " + outputNelFile) + ) + ) + ) + else + ( + -- Error + nlerror("WARNING nothing exported from ig max file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms new file mode 100644 index 000000000..93e94de19 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms @@ -0,0 +1,47 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Select all PACS primitives + for i in geometry do + ( + if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then + selectmore i + ) + + -- Array of node + arrayNode = selection as array + + -- Something to export ? + if (arrayNode.count != 0) then + ( + -- Export the collision + if (NelExportPACSPrimitives arrayNode outputNelFile) == false then + ( + nlerror("ERROR exporting PACS primitives in file " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + ) + else + ( + nlerror("WARNING no PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py new file mode 100644 index 000000000..b1c3e5966 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py @@ -0,0 +1,16 @@ + + +printLog(log, ">>> List %PreGenFileExtension% <<<") +outDirPacsPrim = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, outDirPacsPrim) +listPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + "/landscape_col_prim_pacs_list.txt" +if os.path.isfile(listPath): + os.remove(listPath) +if WantLandscapeColPrimPacsList: + exportedPacsPrims = findFiles(log, outDirPacsPrim, "", ".%PreGenFileExtension%") + printLog(log, "WRITE " + listPath) + listFile = open(listPath, "w") + for exported in exportedPacsPrims: + listFile.write(exported + "\n") + listFile.close() + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms new file mode 100644 index 000000000..b86e10c75 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms @@ -0,0 +1,53 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + -- Select Bip01 + select $Bip01 + + if ($ != undefined) then + ( + -- Set figure mode on + if ((classof $) == Biped_Object) then + ( + $.controller.figureMode = true + ) + + -- Export the skeleton template + if (NelExportSkeleton $ outputNelFile) == false then + ( + nlerror("ERROR exporting skeleton " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py new file mode 100644 index 000000000..884e11db3 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py @@ -0,0 +1,8 @@ + + +printLog(log, ">>> Export skel directly <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + SkelExportDirectory, ".skel") + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms new file mode 100644 index 000000000..d6330b611 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms @@ -0,0 +1,28 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select all the nodes + max select all + + -- Export the skeleton template + if NelExportSkeletonWeight ($selection as array) outputNelFile == false then + ( + nlerror("ERROR exporting skeleton weight " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms new file mode 100644 index 000000000..f0d5cd584 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms @@ -0,0 +1,113 @@ + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable + -- "0" = not vegetable + -- "1" = vegetable + + +-- Must export this node ? +fn isToBeExported node = +( + if (classof node == nel_ps) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + vegetable = getappdata node NEL3D_APPDATA_VEGETABLE + if (vegetable != undefined) then + if (vegetable == "1") then + return true + + -- Do not export + return false +) + + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".veget") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the veget + if (NelExportVegetable node outputNelFile false) == true then + ( + nlerror("OK "+outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fata error exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror("WARNING no veget exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms new file mode 100644 index 000000000..d4ecbe275 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms @@ -0,0 +1,86 @@ + + +-- Find id +Fn findID node = +( + local + + -- Const + alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + NameTab = filterString node.name "_" + Z_ID = -1 + alpha_letter1 = NameTab[2][1] + alpha_letter2 = NameTab[2][2] + alpha_letter1_value = findstring alphabet alpha_letter1 + alpha_letter2_value = findstring alphabet alpha_letter2 + + -- Decompose theh name in an array array[1]=numeric string value array[2]=alpha string value + -- The index of the engine start at 0 but the script one at 1 so we sub 1 each time + alpha_sub_id = (((alpha_letter1_value as integer - 1) * 26 + (alpha_letter2_value as integer)))-1 + num_sub_id = (NameTab[1] as integer)-1 + + -- Array of 256 per 256 + --------------------------- + -- 0 1 2 3 ... 255 + -- 256 257 258 259 ... 511 + -- 512 513 514 515 ... 767 + -- ... + + Z_ID = num_sub_id*256 + alpha_sub_id + return Z_ID +) + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Found it ? + find = false + + -- For each object in the priject + for i in geometry do + ( + -- Look for a NeL patch mesh + if (classof i) == RklPatch then + ( + -- Error catching + try + ( + if (ExportRykolZone i outputNelFile (findID i)) == false then + ( + nlerror("ERROR exporting zone " + i.name + " in file " + inputMaxFile) + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + find = true + exit + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting zone " + i.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + ) + + -- Not found ? + if (find == false) then + ( + -- Error + nlerror("WARNING no zone found in project " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py new file mode 100644 index 000000000..d6e821879 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py @@ -0,0 +1,8 @@ + + +printLog(log, ">>> Try to copy ligo zone if any <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +printLog(log, "") + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py new file mode 100644 index 000000000..a2c6ef2b2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + %PreGenClientDirectoryVariable%) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py new file mode 100644 index 000000000..f4d6f4950 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py @@ -0,0 +1,7 @@ + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py new file mode 100644 index 000000000..5b79ed18e --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file 1_export.py +# \brief Export %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +# ... + +# Export %PreGenProcessName% 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export %PreGenProcessName% 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%, ".%PreGenFileExtension%")): + scriptSrc = "maxscript/%PreGenFileExtension%_export.ms" + scriptDst = MaxUserDirectory + "/scripts/%PreGenFileExtension%_export.ms" + outputLogfile = ScriptDirectory + "/processes/%PreGenProcessName%/log.log" + outputDirectory = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".%PreGenFileExtension%") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "%PreGenFileExtension%_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".%PreGenFileExtension%") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .%PreGenFileExtension% files!") + os.remove(scriptDst) + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py new file mode 100644 index 000000000..6278c85cd --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py new file mode 100644 index 000000000..c9486b77f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install %PreGenProcessName% <<<") +exportPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, exportPath) +clientPath = ClientDataDirectory + "/" + %PreGenClientDirectoryVariable% +mkPath(log, clientPath) +copyFilesExtNoSubdirIfNeeded(log, exportPath, clientPath, ".%PreGenFileExtension%") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms new file mode 100644 index 000000000..2c6e99bd3 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms @@ -0,0 +1,74 @@ + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting '%PreGenFileExtension%' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms new file mode 100644 index 000000000..2d5e5434f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms @@ -0,0 +1,63 @@ + + +-- ################################################################# +-- ## %PreGenWarning% +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py new file mode 100644 index 000000000..d572c1f43 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) +mkPath(log, ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + %PreGenClientDirectoryVariable%) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py new file mode 100644 index 000000000..f4d6f4950 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py @@ -0,0 +1,7 @@ + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py new file mode 100644 index 000000000..e48b44648 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file 1_export.py +# \brief Export %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +# Find tools +# ... + +# Export %PreGenProcessName% 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export %PreGenProcessName% 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + mkPath(log, ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%) + for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%, ".max.tag")): + scriptSrc = "maxscript/%PreGenFileExtension%_export.ms" + scriptDst = MaxUserDirectory + "/scripts/%PreGenFileExtension%_export.ms" + outputLogfile = ScriptDirectory + "/processes/%PreGenProcessName%/log.log" + outputDirectory = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + tagDirectory = ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable% + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "%PreGenFileExtension%_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py new file mode 100644 index 000000000..6278c85cd --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py new file mode 100644 index 000000000..f3dde5aa2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install %PreGenProcessName% <<<") +exportPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, exportPath) +clientPath = ClientDataDirectory + "/" + %PreGenClientDirectoryVariable% +mkPath(log, clientPath) +copyFilesNoTreeIfNeeded(log, exportPath, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms new file mode 100644 index 000000000..42f9a51fa --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms @@ -0,0 +1,89 @@ + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting '%PreGenFileExtension%' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms new file mode 100644 index 000000000..2d5e5434f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms @@ -0,0 +1,63 @@ + + +-- ################################################################# +-- ## %PreGenWarning% +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py index 5ab68c730..0958d9643 100644 --- a/code/nel/tools/build_gamedata/processes/anim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export anim -# \date 2009-03-10 13:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export anim @@ -44,46 +48,51 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each anim directory -printLog(log, ">>> Export anim 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) -for dir in AnimSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, AnimSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + AnimExportDirectory, ".anim")): - scriptSrc = "maxscript/anim_export.ms" - scriptDst = MaxUserDirectory + "/scripts/anim_export.ms" - logFile = ScriptDirectory + "/processes/anim/log.log" - outDirAnim = ExportBuildDirectory + "/" + AnimExportDirectory - animSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirAnim, "", ".anim") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export anim 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export anim 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) + for dir in AnimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + AnimExportDirectory, ".anim")): + scriptSrc = "maxscript/anim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/anim_export.ms" + outputLogfile = ScriptDirectory + "/processes/anim/log.log" + outputDirectory = ExportBuildDirectory + "/" + AnimExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".anim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "anim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".anim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .anim files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("anim_source_directory", animSourceDir) - newline = newline.replace("output_directory", outDirAnim) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "anim_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirAnim, "", ".anim") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .anim files!") - os.remove(scriptDst) + + printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms index ce7c83405..05878c1cd 100644 --- a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms +++ b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms @@ -1,10 +1,14 @@ -NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -57,129 +61,146 @@ fn nlerror message = print message ) + + +NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".anim") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + select $Bip01 + + -- Always uncheck triangle pelvis + if (classof $Bip01) == Biped_Object then + ( + $Bip01.controller.figureMode = true + $Bip01.controller.trianglepelvis = false + $Bip01.controller.figureMode = false + ) + ) + + -- For each node + for node in objects do + ( + exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION + if (exportNodeAnmation != undefined) then + ( + if (exportNodeAnmation == "1") then + ( + selectmore node + + -- Is it a biped ? + if (classof node.controller) == Vertical_Horizontal_Turn then + ( + -- Always uncheck triangle pelvis + node.controller.trianglepelvis = false + ) + ) + ) + ) + + if ((selection as array).count != 0) then + ( + -- Export the animation + if (NelExportAnimation (selection as array) outputNelFile false) == false then + ( + nlerror("ERROR exporting animation " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting animation: no node animated to export in file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the anim_source_directory - files = getFiles "anim_source_directory/*.max" - gc () - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - gc () - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( - nlerror ("Scanning file "+files[i]+" ...") - + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".anim") + try ( - -- Output file - output = ("output_directory/"+(getFilenameFile files[i])+".anim") - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () + gc() heapfree - + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select Bip01, not very smart - if $Bip01 != undefined then - ( - select $Bip01 - - -- Always uncheck triangle pelvis - if (classof $Bip01) == Biped_Object then - ( - $Bip01.controller.figureMode = true - $Bip01.controller.trianglepelvis = false - $Bip01.controller.figureMode = false - ) - ) - - -- For each node - for node in objects do - ( - exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION - if (exportNodeAnmation != undefined) then - ( - if (exportNodeAnmation == "1") then - ( - selectmore node - - -- Is it a biped ? - if (classof node.controller) == Vertical_Horizontal_Turn then - ( - -- Always uncheck triangle pelvis - node.controller.trianglepelvis = false - ) - ) - ) - ) - - if ((selection as array).count != 0) then - ( - -- Export the animation - if (NelExportAnimation (selection as array) output false) == false then - ( - nlerror ("ERROR exporting animation "+files[i]) - ) - else - ( - nlerror ("OK "+output) - ) - ) - else - ( - -- Error - nlerror ("ERROR exporting animation: no node animated to export in file "+files[i]) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting animation: can't open the file "+files[i]) + nlerror("ERROR exporting 'anim': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting animation in files " + files[i]) + nlerror("ERROR error exporting 'anim' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no animation file in folder anim_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting animation in folder anim_source_directory") + nlerror("ERROR fatal error exporting 'anim' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py index d4da536fb..92ba0a1b9 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export clodbank -# \date 2009-03-10 13:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export clodbank @@ -43,50 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each clodbank directory -printLog(log, ">>> Export clodbank 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) -mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) -for dir in ClodSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, ClodSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ClodTagExportDirectory, ".tag")): - scriptSrc = "maxscript/clod_export.ms" - scriptDst = MaxUserDirectory + "/scripts/clod_export.ms" - logFile = ScriptDirectory + "/processes/clodbank/log.log" - outDirClod = ExportBuildDirectory + "/" + ClodExportDirectory - outDirTag = ExportBuildDirectory + "/" + ClodTagExportDirectory - maxSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirTag, "", ".tag") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export clodbank 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export clodbank 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) + for dir in ClodSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ClodTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/clod_export.ms" + scriptDst = MaxUserDirectory + "/scripts/clod_export.ms" + outputLogfile = ScriptDirectory + "/processes/clodbank/log.log" + outputDirectory = ExportBuildDirectory + "/" + ClodExportDirectory + tagDirectory = ExportBuildDirectory + "/" + ClodTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "clod_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("shape_source_directory", maxSourceDir) - newline = newline.replace("output_directory_clod", outDirClod) - newline = newline.replace("output_directory_tag", outDirTag) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "clod_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirTag, "", ".tag") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .max files!") - os.remove(scriptDst) + + printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms index 17c7aeb9c..0c0d78fe0 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -1,15 +1,14 @@ --- Some globals -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -62,21 +61,31 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me +NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + + -- Must export this node ? -fn isToBeExported node = +fn isToBeExported node = ( if ((classof node) == RklPatch) then return false - + if ((classof node) == nel_ps) then return false - + if ((classof node) == nel_pacs_cylinder) then return false - + if ((classof node) == nel_pacs_box) then return false - + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT if (doNotExport != undefined) then ( @@ -86,8 +95,9 @@ fn isToBeExported node = return true ) + -- is this node flagged as a LodCharacter ?? -fn isLodCharacter node = +fn isLodCharacter node = ( isCLod = getappdata node NEL3D_APPDATA_CHARACTER_LOD if (isCLod == undefined) then @@ -97,173 +107,169 @@ fn isLodCharacter node = return false ) -fn goClodExport = +fn runNelMaxExport inputMaxFile = ( - try + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do ( - -- Get files in the shape_source_directory - files = getFiles "shape_source_directory/*.max" - - -- Sort files - sort files - - -- No file ? - if files.count != 0 then + -- It is root ? + if (node.parent == undefined) then ( - -- For each files - for i = 1 to files.count do + -- Can be exported ? + if (isToBeExported node == true) then ( - try + -- Is a Lod character? + if ((isLodCharacter node) == true) then ( - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".clod") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( - -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + try ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- For each node - for node in geometry do + -- Export the shape + if (NelExportLodCharacter node outputNelFile false) == true then ( - -- It is root ? - if (node.parent == undefined) then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Is a Lod character? - if ((isLodCharacter node) == true) then - ( - -- Output directory - output = ("output_directory_clod/"+(node.name)+".clod") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the shape - if (NelExportLodCharacter node output false) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting .clod "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting .clod "+node.name+" in file "+files[i]) - tagThisFile = false - return 0 - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) + nlerror("OK " + outputNelFile) + exported = exported+1 ) - - -- Something exported - if (exported == 0) then + else ( -- Error - nlerror ("WARNING no .clod exported from the file "+files[i]) - ) - - -- Write a tag file - if tagThisFile == true then - ( - tagFile = createFile tag - if tagFile == undefined then - ( - nlerror ("WARNING can't create tag file "+tag) - ) - else - ( - print "toto" to: tagFile - close tagFile - ) + nlerror("ERROR exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) - else + catch ( -- Error - nlerror ("ERROR exporting .clod: can't open the file "+files[i]) + nlerror("ERROR fatal error exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) else ( -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 ) - - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting .clod in file " + files[i]) - -- break ) ) ) - else - ( - nlerror ("WARNING no max file in folder shape_source_directory") - ) ) - catch + + -- Something exported + if (exported == 0) then ( -- Error - nlerror ("ERROR fatal error exporting .clod in folder shape_source_directory") - return 0 + nlerror ("WARNING no .clod exported from the file " + inputMaxFile) ) + + return tagThisFile ) -goClodExport() -nlerror ("BYE") +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting 'clod': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'clod' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'clod' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/ig/1_export.py b/code/nel/tools/build_gamedata/processes/ig/1_export.py index c8eb2d363..06fe7050d 100644 --- a/code/nel/tools/build_gamedata/processes/ig/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ig/1_export.py @@ -46,15 +46,15 @@ printLog(log, "") Max = "" #find later -def igExport(all_source_base, all_source_dir, sourceDir, targetDir): +def igExport(sourceDir, targetDir): scriptSrc = "maxscript/ig_export.ms" scriptDst = MaxUserDirectory + "/scripts/ig_export.ms" - logFile = ScriptDirectory + "/processes/ig/log.log" - outDirTag = ExportBuildDirectory + "/" + IgStaticTagExportDirectory - outDirIg = ExportBuildDirectory + "/" + targetDir - igSourceDir = DatabaseDirectory + "/" + sourceDir - if (needUpdateDirNoSubdirLogExtMultidir(log, all_source_base, all_source_dir, igSourceDir, ".max", outDirTag, ".max.tag")): - tagList = findFiles(log, outDirTag, "", ".tag") + outputLogfile = ScriptDirectory + "/processes/ig/log.log" + tagDirectory = ExportBuildDirectory + "/" + IgStaticTagExportDirectory + outputDirectory = ExportBuildDirectory + "/" + targetDir + maxSourceDir = DatabaseDirectory + "/" + sourceDir + if (needUpdateDirByTagLog(log, maxSourceDir, ".max", tagDirectory, ".max.tag")): + tagList = findFiles(log, tagDirectory, "", ".tag") tagLen = len(tagList) if os.path.isfile(scriptDst): os.remove(scriptDst) @@ -62,17 +62,17 @@ def igExport(all_source_base, all_source_dir, sourceDir, targetDir): sSrc = open(scriptSrc, "r") sDst = open(scriptDst, "w") for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("ig_source_directory", igSourceDir) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("output_directory_ig", outDirIg) + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) sDst.write(newline) sSrc.close() sDst.close() while tagDiff > 0: printLog(log, "MAXSCRIPT " + scriptDst) subprocess.call([ Max, "-U", "MAXScript", "ig_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirTag, "", ".tag") + tagList = findFiles(log, tagDirectory, "", ".tag") newTagLen = len(tagList) tagDiff = newTagLen - tagLen tagLen = newTagLen @@ -94,14 +94,14 @@ if MaxAvailable: mkPath(log, ExportBuildDirectory + "/" + IgStaticLandExportDirectory) for dir in IgLandSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) - igExport(DatabaseDirectory, IgLandSourceDirectories, dir, IgStaticLandExportDirectory) + igExport(dir, IgStaticLandExportDirectory) # Export ig other 3dsmax printLog(log, ">>> Export ig other 3dsmax <<<") mkPath(log, ExportBuildDirectory + "/" + IgStaticOtherExportDirectory) for dir in IgOtherSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) - igExport(DatabaseDirectory, IgOtherSourceDirectories, dir, IgStaticOtherExportDirectory) + igExport(dir, IgStaticOtherExportDirectory) printLog(log, "") diff --git a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms index de1853994..d7be706a8 100644 --- a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms +++ b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms @@ -1,34 +1,14 @@ --- Some globals -NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized - -- "0" = is not an accelerator and IS NOT clusterized (always visible) - -- "1" = is an accelerator type PORTAL - -- "2" = is an accelerator type CLUSTER - -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE - -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER - -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER - -- "17" = is an accelerator type PORTAL DYNAMIC - -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 -NEL3D_APPDATA_LOD = 1423062537 -NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD -NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 -NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX -NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 -NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 - -NEL_OBJECT_NAME_DATA = 1970 -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -81,6 +61,36 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized + -- "0" = is not an accelerator and IS NOT clusterized (always visible) + -- "1" = is an accelerator type PORTAL + -- "2" = is an accelerator type CLUSTER + -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE + -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER + -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER + -- "17" = is an accelerator type PORTAL DYNAMIC + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 +NEL3D_APPDATA_LOD = 1423062537 +NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD +NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 +NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX +NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 +NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 + +NEL_OBJECT_NAME_DATA = 1970 + + -- This node is n accelerator ? fn isAccelerator node = ( @@ -101,204 +111,214 @@ fn getIg node = return (getappdata node NEL3D_APPDATA_IGNAME) ) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Ig array + ig_array = #() + + -- Scan all the ig in this project + for node in objects do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") ) then + ( + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + exit + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + -- Have some ig ? + if (ig_array.count != 0) then + ( + -- For each ig + for ig = 1 to ig_array.count do + ( + -- Output filename + outputNelFile = ("%OutputDirectory%/" + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Select none + max select none + + -- Select all node in this ig + for node in geometry do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in lights do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in helpers do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + + -- Check export + try + ( + -- Export the ig + instancegroup2export = $selection as array + if (NelExportInstanceGroup instancegroup2export outputNelFile) == true then + ( + nlerror("OK " + outputNelFile) + ) + else + ( + -- Error + nlerror("ERROR exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + nlerror("SKIPPED " + outputNelFile) + ) + ) + ) + else + ( + -- Error + nlerror("WARNING nothing exported from ig max file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the ig_source_directory - files = getFiles "ig_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + try ( - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (mergeMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- Ig array - ig_array = #() - - -- Scan all the ig in this project - for node in objects do - ( - ig = getIg node - if ( (ig != undefined) and (ig != "") ) then - ( - -- Found ? - found = false - - -- Already found ? - for j = 1 to ig_array.count do - ( - if (ig_array[j]==ig) then - ( - found = true - exit - ) - ) - - -- Found ? - if (found == false) then - ( - append ig_array ig - ) - ) - ) - - -- Have some ig ? - if (ig_array.count != 0) then - ( - -- For each ig - for ig = 1 to ig_array.count do - ( - -- Output filename - output = ("output_directory_ig/"+ig_array[ig]+".ig") - - -- Check date - if (NeLTestFileDate output files[i]) == true then - ( - -- Select none - max select none - - -- Select all node in this ig - for node in geometry do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - -- Select all lights in this ig - for node in lights do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - -- Select all lights in this ig - for node in helpers do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - - -- Check export - try - ( - -- Export the ig - instancegroup2export = $selection as array - if (NelExportInstanceGroup instancegroup2export output) == true then - ( - nlerror ("OK "+output) - ) - else - ( - -- Error - nlerror ("ERROR exporting ig "+ig_array[ig]+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting ig "+ig_array[ig]+" in file "+files[i]) - tagThisFile = false - ) - ) - else - ( - nlerror ("SKIPPED "+output) - ) - ) - ) - else - ( - -- Error - nlerror ("WARNING nothing exported from ig max file "+files[i]) - ) - + tagThisFile = runNelMaxExport(inputMaxFile) + -- Write a tag file if tagThisFile == true then ( - tagFile = createFile tag + tagFile = createFile outputTagFile if tagFile == undefined then ( - nlerror ("WARNING can't create tag file "+tag) + nlerror("WARNING can't create tag file " + outputTagFile) ) else ( - print "toto" to: tagFile + print "mukyu" to: tagFile close tagFile ) ) - - resetMAXFile #noprompt ) else ( -- Error - nlerror ("ERROR exporting ig: can't open the file "+files[i]) + nlerror("ERROR exporting 'ig': can't open the file " + inputMaxFile) ) ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) - ) + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) ) catch ( -- Error - nlerror ("ERROR error exporting ig in files " + files[i]) + nlerror("ERROR error exporting 'ig' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no max file in folder ig_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting ig in folder ig_source_directory") + nlerror("ERROR fatal error exporting 'ig' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py index 344f88422..269effd25 100644 --- a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py @@ -47,7 +47,7 @@ printLog(log, "") printLog(log, ">>> Setup source directories <<<") mkPath(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory) mkPath(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory) -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) # Setup export directories printLog(log, ">>> Setup export directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index ea111fa2a..dbf28109d 100644 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -60,15 +60,15 @@ if LigoExportLand == "" or LigoExportOnePass == 1: mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory) mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory) mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) - mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) - if (needUpdateDirNoSubdirLogExt(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoTagExportDirectory, ".max.tag")): + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoTagExportDirectory, ".max.tag")): printLog(log, "WRITE " + ligoIniPath) ligoIni = open(ligoIniPath, "w") ligoIni.write("[LigoConfig]\n") ligoIni.write("LigoPath=" + DatabaseDirectory + "/" + LigoMaxSourceDirectory + "/\n") ligoIni.write("LigoExportPath=" + DatabaseDirectory + "/" + LigoDatabaseExportDirectory + "/\n") - ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory + "/\n") + ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory[0] + "/\n") ligoIni.close() outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py index 819f6700d..d28e30670 100644 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export pacs_prim -# \date 2010-08-31 16:50GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export pacs_prim @@ -44,43 +48,49 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each pacs_prim directory -printLog(log, ">>> Export pacs_prim 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) -for dir in PacsPrimSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, PacsPrimSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimExportDirectory, ".pacs_prim")): - scriptSrc = "maxscript/pacs_prim_export.ms" - scriptDst = MaxUserDirectory + "/scripts/pacs_prim_export.ms" - logFile = ScriptDirectory + "/processes/pacs_prim/log.log" - outDirPacsPrim = ExportBuildDirectory + "/" + PacsPrimExportDirectory - pacs_primSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirPacsPrim, "", ".pacs_prim") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export pacs_prim 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export pacs_prim 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) + for dir in PacsPrimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimExportDirectory, ".pacs_prim")): + scriptSrc = "maxscript/pacs_prim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/pacs_prim_export.ms" + outputLogfile = ScriptDirectory + "/processes/pacs_prim/log.log" + outputDirectory = ExportBuildDirectory + "/" + PacsPrimExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".pacs_prim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "pacs_prim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".pacs_prim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .pacs_prim files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("pacs_prim_source_directory", pacs_primSourceDir) - newline = newline.replace("output_directory", outDirPacsPrim) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "pacs_prim_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirPacsPrim, "", ".pacs_prim") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .pacs_prim files!") - os.remove(scriptDst) + + printLog(log, ">>> List pacs_prim <<<") outDirPacsPrim = ExportBuildDirectory + "/" + PacsPrimExportDirectory @@ -96,8 +106,9 @@ if WantLandscapeColPrimPacsList: listFile.write(exported + "\n") listFile.close() -printLog(log, "") + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms index 0c8e5b8e0..21bdcdd4c 100644 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms @@ -1,8 +1,14 @@ + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -55,107 +61,124 @@ fn nlerror message = print message ) + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".pacs_prim") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Select all PACS primitives + for i in geometry do + ( + if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then + selectmore i + ) + + -- Array of node + arrayNode = selection as array + + -- Something to export ? + if (arrayNode.count != 0) then + ( + -- Export the collision + if (NelExportPACSPrimitives arrayNode outputNelFile) == false then + ( + nlerror("ERROR exporting PACS primitives in file " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + ) + else + ( + nlerror("WARNING no PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + + + try ( - -- Get files in the "pacs_prim_source_directory" directory - files = getFiles "pacs_prim_source_directory/*.max" - gc () - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - gc () - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".pacs_prim") + try ( - -- Output file - output = "output_directory/" + (getFilenameFile files[i]) + ".pacs_prim" - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () + gc() heapfree - + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select none - max select none - - -- Select all PACS primitives - for i in geometry do - ( - if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then - selectmore i - ) - - -- Array of node - arrayNode = selection as array - - -- Something to export ? - if (arrayNode.count != 0) then - ( - -- Export the collision - if (NelExportPACSPrimitives arrayNode output) == false then - ( - nlerror ("ERROR exporting PACS primitives in file "+files[i]) - ) - else - ( - nlerror ("OK PACS primitives in file "+files[i]) - ) - ) - else - ( - nlerror ("WARNING no PACS primitives in file "+files[i]) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting collision: can't open the file "+files[i]) + nlerror("ERROR exporting 'pacs_prim': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting collision in files " + files[i]) + nlerror("ERROR error exporting 'pacs_prim' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no collision file in folder pacs_prim_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting collision in folder pacs_prim_source_directory") + nlerror("ERROR fatal error exporting 'pacs_prim' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py index e2accccf3..555f921f3 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py @@ -45,10 +45,14 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") +for dir in RBankCmbSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) mkPath(log, LeveldesignWorldDirectory) # Setup export directories printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + RBankCmbTagExportDirectory) mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) # Setup build directories diff --git a/code/nel/tools/build_gamedata/processes/rbank/1_export.py b/code/nel/tools/build_gamedata/processes/rbank/1_export.py index 89b38beac..90922c0c3 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/rbank/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export rbank -# \date 2009-03-10-22-43-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export rbank @@ -43,17 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + # Find tools -printLog(log, "") +# ... + +# Export rbank 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export rbank 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + RBankCmbTagExportDirectory) + for dir in RBankCmbSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + RBankCmbTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/cmb_export.ms" + scriptDst = MaxUserDirectory + "/scripts/cmb_export.ms" + outputLogfile = ScriptDirectory + "/processes/rbank/log.log" + outputDirectory = ExportBuildDirectory + "/" + RBankCmbExportDirectory + tagDirectory = ExportBuildDirectory + "/" + RBankCmbTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "cmb_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + -# For each rbank directory -printLog(log, ">>> Export rbank 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms new file mode 100644 index 000000000..73f1605f9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms @@ -0,0 +1,211 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 + + +-- Must export this node ? +fn isToBeExported node = +( + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + return false +) + +fn runNelMaxExport inputMaxFile = +( + outputNelDir = "%OutputDirectory%" + + -- Tag this file ? + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Select all collision mesh + max select none + for m in geometry do + ( + if (isToBeExported m) == true then + selectmore m + ) + + -- Export the collision + if (NelExportCollision ($selection as array) outputNelDir) == false then + ( + nlerror("ERROR exporting collision " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK collision in folder " + outputNelDir) + ) + + return tagThisFile +) + + + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting 'cmb': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'cmb' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'cmb' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py index be3fb93e7..9d3cb67e5 100644 --- a/code/nel/tools/build_gamedata/processes/shape/1_export.py +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -121,13 +121,19 @@ if MaxAvailable: while retriesLeft > 0: printLog(log, "MAXSCRIPT " + scriptDst + "; " + maxFilePath) subprocess.call([ ExecTimeout, str(MaxShapeExportTimeout), Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) - lSrc = open(logFile, "r") - for line in lSrc: - lineStrip = line.strip() - if (len(lineStrip) > 0): - printLog(log, lineStrip) - lSrc.close() - os.remove(logFile) + if os.path.exists(logFile): + try: + lSrc = open(logFile, "r") + for line in lSrc: + lineStrip = line.strip() + if (len(lineStrip) > 0): + printLog(log, lineStrip) + lSrc.close() + os.remove(logFile) + except Exception: + printLog(log, "ERROR Failed to read 3dsmax log") + else: + printLog(log, "WARNING No 3dsmax log") if (os.path.exists(tagFilePath)): printLog(log, "OK " + maxFilePath) retriesLeft = 0 diff --git a/code/nel/tools/build_gamedata/processes/skel/1_export.py b/code/nel/tools/build_gamedata/processes/skel/1_export.py index aad402658..340a0957e 100644 --- a/code/nel/tools/build_gamedata/processes/skel/1_export.py +++ b/code/nel/tools/build_gamedata/processes/skel/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export skel -# \date 2009-03-10-20-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export skel @@ -44,43 +48,49 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each skel directory -printLog(log, ">>> Export skel 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) -for dir in SkelSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, SkelSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SkelExportDirectory, ".skel")): - scriptSrc = "maxscript/skel_export.ms" - scriptDst = MaxUserDirectory + "/scripts/skel_export.ms" - logFile = ScriptDirectory + "/processes/skel/log.log" - outDirSkel = ExportBuildDirectory + "/" + SkelExportDirectory - skelSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirSkel, "", ".skel") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export skel 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export skel 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) + for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SkelExportDirectory, ".skel")): + scriptSrc = "maxscript/skel_export.ms" + scriptDst = MaxUserDirectory + "/scripts/skel_export.ms" + outputLogfile = ScriptDirectory + "/processes/skel/log.log" + outputDirectory = ExportBuildDirectory + "/" + SkelExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".skel") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "skel_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".skel") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .skel files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("skel_source_directory", skelSourceDir) - newline = newline.replace("output_directory", outDirSkel) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "skel_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirSkel, "", ".skel") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .skel files!") - os.remove(scriptDst) + + printLog(log, ">>> Export skel directly <<<") mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) @@ -88,6 +98,8 @@ for dir in SkelSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + SkelExportDirectory, ".skel") + + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms index 02cdcac38..7fd2af0fb 100644 --- a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms +++ b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms @@ -1,24 +1,18 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename --- Log a message -fn nlerror message = -( - if nlErrorStream != undefined then - ( - format "%\n" message to:nlErrorStream - flush nlErrorStream - ) - - -- To the console - print message -) - -- Unhide category fn unhidecategory = ( @@ -54,109 +48,143 @@ fn unhidecategory = ) ) +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".skel") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + -- Select Bip01 + select $Bip01 + + if ($ != undefined) then + ( + -- Set figure mode on + if ((classof $) == Biped_Object) then + ( + $.controller.figureMode = true + ) + + -- Export the skeleton template + if (NelExportSkeleton $ outputNelFile) == false then + ( + nlerror("ERROR exporting skeleton " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + + return tagThisFile +) + + + try ( - -- Get files in the skel_source_directory - files = getFiles "skel_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".skel") + try ( - -- Output file - output = ("output_directory/"+(getFilenameFile files[i])+".skel") - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () - + gc() + heapfree + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select Bip01, not very smart - if $Bip01 != undefined then - ( - -- Select Bip01 - select $Bip01 - - if ($ != undefined) then - ( - -- Set figure mode on - if ((classof $) == Biped_Object) then - ( - $.controller.figureMode = true - ) - - -- Export the skeleton template - if (NelExportSkeleton $ output) == false then - ( - nlerror ("ERROR exporting skeleton "+files[i]) - ) - else - ( - nlerror ("OK "+output) - ) - ) - else - ( - -- Error - nlerror ("ERROR exporting skeleton: no Bip01 node in file "+files[i]) - ) - ) - else - ( - -- Error - nlerror ("ERROR exporting skeleton: no Bip01 node in file "+files[i]) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting skeleton: can't open the file "+files[i]) + nlerror("ERROR exporting 'skel': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton in files " + files[i]) + nlerror("ERROR error exporting 'skel' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no skeleton file in folder skel_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting skeleton in folder skel_source_directory") + nlerror("ERROR fatal error exporting 'skel' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/swt/1_export.py b/code/nel/tools/build_gamedata/processes/swt/1_export.py index c65e6f793..a50f6e5a7 100644 --- a/code/nel/tools/build_gamedata/processes/swt/1_export.py +++ b/code/nel/tools/build_gamedata/processes/swt/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export swt -# \date 2009-03-10-20-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export swt @@ -38,49 +42,55 @@ from directories import * printLog(log, "") printLog(log, "-------") -printLog(log, "--- Export skeleton weigths") +printLog(log, "--- Export swt") printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each swt directory -printLog(log, ">>> Export skeleton weigths 3dsmax <<<") -mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) -for dir in SwtSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, SwtSourceDirectories, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SwtExportDirectory, ".swt")): - scriptSrc = "maxscript/swt_export.ms" - scriptDst = MaxUserDirectory + "/scripts/swt_export.ms" - logFile = ScriptDirectory + "/processes/swt/log.log" - outDirSwt = ExportBuildDirectory + "/" + SwtExportDirectory - swtSourceDir = DatabaseDirectory + "/" + dir - tagList = findFiles(log, outDirSwt, "", ".swt") - tagLen = len(tagList) - if os.path.isfile(scriptDst): +# Export swt 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export swt 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) + for dir in SwtSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SwtExportDirectory, ".swt")): + scriptSrc = "maxscript/swt_export.ms" + scriptDst = MaxUserDirectory + "/scripts/swt_export.ms" + outputLogfile = ScriptDirectory + "/processes/swt/log.log" + outputDirectory = ExportBuildDirectory + "/" + SwtExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".swt") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "swt_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".swt") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .swt files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("swt_source_directory", swtSourceDir) - newline = newline.replace("output_directory", outDirSwt) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "swt_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirSwt, "", ".swt") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .swt files!") - os.remove(scriptDst) + + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms index 87517c831..ea6ff95c3 100644 --- a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms +++ b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms @@ -1,24 +1,18 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename --- Log a message -fn nlerror message = -( - if nlErrorStream != undefined then - ( - format "%\n" message to:nlErrorStream - flush nlErrorStream - ) - - -- To the console - print message -) - -- Unhide category fn unhidecategory = ( @@ -54,86 +48,118 @@ fn unhidecategory = ) ) +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".swt") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select all the nodes + max select all + + -- Export the skeleton template + if NelExportSkeletonWeight ($selection as array) outputNelFile == false then + ( + nlerror("ERROR exporting skeleton weight " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + + return tagThisFile +) + + + try ( - -- Get files in the swt_source_directory - files = getFiles "swt_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".swt") + try ( - -- Output file - output = ("output_directory/"+(getFilenameFile files[i])+".swt") - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () - + gc() + heapfree + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (loadMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select all the nodes - max select all - - -- Export the skeleton template - if NelExportSkeletonWeight ($selection as array) output == false then - ( - nlerror ("ERROR exporting skeleton weight "+files[i]) - ) - else - ( - nlerror ("OK "+output) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting skeleton weight: can't open the file "+files[i]) + nlerror("ERROR exporting 'swt': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton weight in files " + files[i]) + nlerror("ERROR error exporting 'swt' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no skeleton weight file in folder swt_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton weight in folder swt_source_directory") + nlerror("ERROR fatal error exporting 'swt' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/veget/0_setup.py b/code/nel/tools/build_gamedata/processes/veget/0_setup.py index 84ae97c7d..5c41088e8 100644 --- a/code/nel/tools/build_gamedata/processes/veget/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/veget/0_setup.py @@ -2,7 +2,7 @@ # # \file 0_setup.py # \brief setup veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Setup veget diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py index ce9179dd5..d73362d45 100644 --- a/code/nel/tools/build_gamedata/processes/veget/1_export.py +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export veget @@ -43,49 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + +# Find tools +# ... + +# Export veget 3dsmax if MaxAvailable: # Find tools Max = findMax(log, MaxDirectory, MaxExecutable) - ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) printLog(log, "") - # Export veget 3dsmax printLog(log, ">>> Export veget 3dsmax <<<") - - # Build paths - scriptSrc = "maxscript/veget_export.ms" - # scriptDst = MaxDirectory + "/scripts/veget_export.ms" - scriptDst = MaxUserDirectory + "/scripts/veget_export.ms" - logFile = ScriptDirectory + "/processes/veget/log.log" - outputDirVeget = ExportBuildDirectory + "/" + VegetExportDirectory - mkPath(log, outputDirVeget) - outputDirTag = ExportBuildDirectory + "/" + VegetTagExportDirectory - mkPath(log, outputDirTag) - - # For each directoy mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) - if os.path.isfile(scriptDst): - os.remove(scriptDst) + mkPath(log, ExportBuildDirectory + "/" + VegetTagExportDirectory) for dir in VegetSourceDirectories: - vegetSourceDir = DatabaseDirectory + "/" + dir - mkPath(log, vegetSourceDir) - if (needUpdateDirNoSubdirLogExtMultidir(log, DatabaseDirectory, VegetSourceDirectories, vegetSourceDir, ".max", outputDirTag, ".max.tag")): + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + VegetTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/veget_export.ms" + scriptDst = MaxUserDirectory + "/scripts/veget_export.ms" + outputLogfile = ScriptDirectory + "/processes/veget/log.log" + outputDirectory = ExportBuildDirectory + "/" + VegetExportDirectory + tagDirectory = ExportBuildDirectory + "/" + VegetTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 sSrc = open(scriptSrc, "r") sDst = open(scriptDst, "w") for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("veget_source_directory", vegetSourceDir) - newline = newline.replace("output_directory_veget", outputDirVeget) - newline = newline.replace("output_directory_tag", outputDirTag) + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) sDst.write(newline) sSrc.close() sDst.close() - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") os.remove(scriptDst) -printLog(log, "") + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/veget/2_build.py b/code/nel/tools/build_gamedata/processes/veget/2_build.py index c08502eaa..856e87082 100644 --- a/code/nel/tools/build_gamedata/processes/veget/2_build.py +++ b/code/nel/tools/build_gamedata/processes/veget/2_build.py @@ -2,7 +2,7 @@ # # \file 2_build.py # \brief Build veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Build veget diff --git a/code/nel/tools/build_gamedata/processes/veget/3_install.py b/code/nel/tools/build_gamedata/processes/veget/3_install.py index 4be5ffc18..69a2ec539 100644 --- a/code/nel/tools/build_gamedata/processes/veget/3_install.py +++ b/code/nel/tools/build_gamedata/processes/veget/3_install.py @@ -2,7 +2,7 @@ # # \file 3_install.py # \brief Install veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Install veget @@ -43,12 +43,12 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +printLog(log, ">>> Install veget <<<") +exportPath = ExportBuildDirectory + "/" + VegetExportDirectory +mkPath(log, exportPath) clientPath = ClientDataDirectory + "/" + VegetClientDirectory mkPath(log, clientPath) - -printLog(log, ">>> Install veget <<<") -mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + VegetExportDirectory, clientPath, ".veget") +copyFilesNoTreeIfNeeded(log, exportPath, clientPath) printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms index 404f6e2ed..097a37609 100644 --- a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms +++ b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms @@ -1,17 +1,14 @@ --- Some globals -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable - -- "0" = not vegetable - -- "1" = vegetable +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -64,6 +61,19 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable + -- "0" = not vegetable + -- "1" = vegetable + + -- Must export this node ? fn isToBeExported node = ( @@ -86,127 +96,134 @@ fn isToBeExported node = return false ) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".veget") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the veget + if (NelExportVegetable node outputNelFile false) == true then + ( + nlerror("OK "+outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fata error exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror("WARNING no veget exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the veget_source_directory - files = getFiles "veget_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + try ( - -- Delete lod files - lod_array = #() - - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] quiet:true == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- For each node - for node in geometry do - ( - -- It is root ? - if (node.parent == undefined) then - ( - -- Is not a skeleton ? - if (node.name != "Bip01") then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Output directory - output = ("output_directory_veget/"+(node.name)+".veget") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the veget - if (NelExportVegetable node output false) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting veget "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fata error exporting veget "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) - ) - - -- Something exported - if exported == 0 then - ( - -- Error - nlerror ("WARNING no veget exported from the file "+files[i]) - ) - + tagThisFile = runNelMaxExport(inputMaxFile) + -- Write a tag file if tagThisFile == true then ( - tagFile = createFile tag + tagFile = createFile outputTagFile if tagFile == undefined then ( - nlerror ("WARNING can't create tag file "+tag) + nlerror("WARNING can't create tag file " + outputTagFile) ) else ( - print "toto" to: tagFile + print "mukyu" to: tagFile close tagFile ) ) @@ -214,36 +231,35 @@ try else ( -- Error - nlerror ("ERROR exporting veget: can't open the file "+files[i]) + nlerror("ERROR exporting 'veget': can't open the file " + inputMaxFile) ) ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + nlerror("SKIPPED BY TAG " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting veget in files " + files[i]) + nlerror("ERROR error exporting 'veget' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no max file in folder veget_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting veget in folder veget_source_directory") + nlerror("ERROR fatal error exporting 'veget' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/zone/0_setup.py b/code/nel/tools/build_gamedata/processes/zone/0_setup.py index 8f1acdab9..e6dc014d9 100644 --- a/code/nel/tools/build_gamedata/processes/zone/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone/0_setup.py @@ -45,7 +45,7 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) # Setup export directories printLog(log, ">>> Setup export directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/zone/1_export.py b/code/nel/tools/build_gamedata/processes/zone/1_export.py index 19308e1d1..10e085024 100644 --- a/code/nel/tools/build_gamedata/processes/zone/1_export.py +++ b/code/nel/tools/build_gamedata/processes/zone/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export zone -# \date 2009-03-10-22-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export zone @@ -44,25 +48,59 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) -printLog(log, "") +# ... -# For each zone directory -printLog(log, ">>> Export zone 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") -mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) -printLog(log, "") +# Export zone 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export zone 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + for dir in ZoneSourceDirectory: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ZoneExportDirectory, ".zone")): + scriptSrc = "maxscript/zone_export.ms" + scriptDst = MaxUserDirectory + "/scripts/zone_export.ms" + outputLogfile = ScriptDirectory + "/processes/zone/log.log" + outputDirectory = ExportBuildDirectory + "/" + ZoneExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".zone") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "zone_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".zone") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .zone files!") + os.remove(scriptDst) -printLog(log, ">>> Export zone ligo <<<") + + +printLog(log, ">>> Try to copy ligo zone if any <<<") printLog(log, "********************************") printLog(log, "******** TODO ********") printLog(log, "********************************") printLog(log, "") + + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms new file mode 100644 index 000000000..71f63e45b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms @@ -0,0 +1,223 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +-- Find id +Fn findID node = +( + local + + -- Const + alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + NameTab = filterString node.name "_" + Z_ID = -1 + alpha_letter1 = NameTab[2][1] + alpha_letter2 = NameTab[2][2] + alpha_letter1_value = findstring alphabet alpha_letter1 + alpha_letter2_value = findstring alphabet alpha_letter2 + + -- Decompose theh name in an array array[1]=numeric string value array[2]=alpha string value + -- The index of the engine start at 0 but the script one at 1 so we sub 1 each time + alpha_sub_id = (((alpha_letter1_value as integer - 1) * 26 + (alpha_letter2_value as integer)))-1 + num_sub_id = (NameTab[1] as integer)-1 + + -- Array of 256 per 256 + --------------------------- + -- 0 1 2 3 ... 255 + -- 256 257 258 259 ... 511 + -- 512 513 514 515 ... 767 + -- ... + + Z_ID = num_sub_id*256 + alpha_sub_id + return Z_ID +) + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".zone") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Found it ? + find = false + + -- For each object in the priject + for i in geometry do + ( + -- Look for a NeL patch mesh + if (classof i) == RklPatch then + ( + -- Error catching + try + ( + if (ExportRykolZone i outputNelFile (findID i)) == false then + ( + nlerror("ERROR exporting zone " + i.name + " in file " + inputMaxFile) + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + find = true + exit + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting zone " + i.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + ) + + -- Not found ? + if (find == false) then + ( + -- Error + nlerror("WARNING no zone found in project " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".zone") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting 'zone': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'zone' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'zone' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py index 112a3c9c7..7ce53d05c 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py @@ -55,6 +55,7 @@ mkPath(log, ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirect # Setup build directories printLog(log, ">>> Setup build directories <<<") mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneDependBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory) diff --git a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py index a96f4e94e..f06e7f72c 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py @@ -60,14 +60,14 @@ else: mkPath(log, srcDir) destDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory mkPath(log, destDir) - dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + dependDir = ExportBuildDirectory + "/" + ZoneDependBuildDirectory mkPath(log, dependDir) files = findFiles(log, srcDir, "", ".zonew") for file in files: srcFile = srcDir + "/" + file destFile = destDir + "/" + file[0:-len(".zonew")] + ".zonel" if (needUpdateLogRemoveDest(log, srcFile, destFile)): - dependFile = destDir + "/" + file[0:-len(".zonew")] + ".depend" + dependFile = dependDir + "/" + file[0:-len(".zonew")] + ".depend" subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") @@ -84,7 +84,7 @@ else: mkPath(log, igsrcDir) destDir = ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory mkPath(log, destDir) - dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + dependDir = ExportBuildDirectory + "/" + ZoneDependBuildDirectory mkPath(log, dependDir) files = findFiles(log, srcDir, "", ".zonel") for file in files: @@ -93,7 +93,7 @@ else: if (os.path.isfile(igsrcFile)): if (needUpdateLogRemoveDest(log, igsrcFile, destFile)): srcFile = srcDir + "/" + file - dependFile = destDir + "/" + file[0:-len(".zonel")] + ".depend" + dependFile = dependDir + "/" + file[0:-len(".zonel")] + ".depend" subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py index 381f6be4b..3c0e4663a 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py @@ -36,6 +36,7 @@ ContinentPath = "continents/" + ContinentName CommonName = ContinentName CommonPath = ContinentPath + # *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** ContinentLeveldesignWorldDirectory = ContinentName @@ -57,7 +58,10 @@ LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" # Zone directories -ZoneSourceDirectory = "landscape/zones/" + EcosystemName +ZoneSourceDirectory = [ "landscape/zones/" + ContinentName ] # For old snowballs style landscape when not using ligo + +# RBank directories +RBankCmbSourceDirectories = [ ] # Ig directories IgLandSourceDirectories = [ ] @@ -99,6 +103,10 @@ LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" ZoneExportDirectory = ContinentPath + "/zone" WaterMapSourceDirectories = [ ] +# RBank directories +RBankCmbExportDirectory = CommonPath + "/rbank_cmb_export" +RBankCmbTagExportDirectory = CommonPath + "/rbank_cmb_tag_export" + # Smallbank directories SmallbankExportDirectory = EcosystemPath + "/smallbank" diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py index b13dcfc78..356670e32 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py @@ -32,18 +32,23 @@ ProcessToComplete = [ ] ProcessToComplete += [ "properties" ] ProcessToComplete += [ "map" ] ProcessToComplete += [ "shape" ] -ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process (not yet), but does not export max files -ProcessToComplete += [ "zone" ] # works, need to check completeness +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "zone" ] ProcessToComplete += [ "ig" ] # fully implemented ProcessToComplete += [ "zone_light" ] # works, need to check completeness -ProcessToComplete += [ "rbank" ] # works, need to check completeness +ProcessToComplete += [ "rbank" ] ProcessToComplete += [ "ig_light" ] # fully implemented ProcessToComplete += [ "ps" ] # *** ECOSYSTEM AND CONTINENT NAMES *** + EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName ContinentName = "newbieland" +ContinentPath = "continents/" + ContinentName +CommonName = ContinentName +CommonPath = ContinentPath # *** LANDSCAPE NAME *** diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py new file mode 100644 index 000000000..9cc03f2b9 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py @@ -0,0 +1,245 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'desert' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "desert" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "fyros" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-foretbrule" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py new file mode 100644 index 000000000..12104fead --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'desert' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "desert" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 1 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "true" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py index c6fbe35cf..1916e5013 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py @@ -1,13 +1,17 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file directories.py # \brief Directories configuration -# \date 2010-05-24 06:34GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # \date 2001-2005 # \author Nevrax # Python port of game data build pipeline. -# Directories configuration. +# Directories configuration for 'jungle' ecosystem. # # NeL - MMORPG Framework # Copyright (C) 2010 Winch Gate Property Limited @@ -27,22 +31,28 @@ # -# *** ECOSYSTEM NAME *** +# *** ECOSYSTEM AND CONTINENT NAMES *** + EcosystemName = "jungle" EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName CommonPath = EcosystemPath +DatabaseRootName = "jungle" +DatabaseRootPath = "stuff/" + DatabaseRootName + # *** SOURCE DIRECTORIES IN THE DATABASE *** # Shape directories ShapeSourceDirectories = [ ] -ShapeSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] # Maps directories MapSourceDirectories = [ ] -MapSourceDirectories += [ "stuff/" + EcosystemName + "/decors/_textures/Vegetations" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] @@ -50,7 +60,9 @@ MapUncompressedSourceDirectories = [ ] # Tiles directories TilesSourceDirectories = [ ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-jungleherbesseche" ] @@ -60,11 +72,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-jungleherbesseche" ] @@ -74,11 +85,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-jungleherbesseche" ] @@ -88,11 +98,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-jungleherbesseche" ] @@ -102,9 +111,6 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/Transitions" ] # Tiles root directory @@ -133,7 +139,7 @@ LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" # Zone directories -ZoneSourceDirectory = "landscape/zones/" + EcosystemName +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo # Ig landscape directories IgLandSourceDirectory = "_invalid" @@ -143,7 +149,7 @@ IgOtherSourceDirectory = "_invalid" # PACS primitives directories PacsPrimSourceDirectories = [ ] -PacsPrimSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] # *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** @@ -156,20 +162,20 @@ ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_opt ShapeAnimExportDirectory = CommonPath + "/shape_anim" # Smallbank directories -SmallbankExportDirectory = "ecosystems/" + EcosystemName + "/smallbank" +SmallbankExportDirectory = CommonPath + "/smallbank" # Tiles directories -TilesExportDirectory = "ecosystems/" + EcosystemName + "/tiles" +TilesExportDirectory = CommonPath + "/tiles" # Tiles directories -DisplaceExportDirectory = "ecosystems/" + EcosystemName + "/diplace" +DisplaceExportDirectory = CommonPath + "/diplace" # Veget directories -VegetExportDirectory = "ecosystems/" + EcosystemName + "/veget" -VegetTagExportDirectory = "ecosystems/" + EcosystemName + "/veget_tag" +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" # Veget Set directories -VegetSetExportDirectory = "ecosystems/" + EcosystemName + "/veget_set" +VegetSetExportDirectory = CommonPath + "/veget_set" # Ligo directories LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName @@ -177,13 +183,13 @@ LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" -LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" +LigoTagExportDirectory = CommonPath + "/ligo_tag" # Zone directories -ZoneExportDirectory = "ecosystems/" + EcosystemName + "/zone" +ZoneExportDirectory = CommonPath + "/zone" # PACS primitives directories -PacsPrimExportDirectory = "ecosystems/" + EcosystemName + "/pacs_prim" +PacsPrimExportDirectory = CommonPath + "/pacs_prim" # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** @@ -199,7 +205,7 @@ ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" # Farbank directories -FarbankBuildDirectory = "ecosystems/" + EcosystemName + "/farbank" +FarbankBuildDirectory = CommonPath + "/farbank" # Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** IgLandBuildDirectory = "_invalid" @@ -214,44 +220,30 @@ RbankMeshBuildDirectory = "_invalid" # *** INSTALL DIRECTORIES IN THE CLIENT DATA *** -# Client directories -ClientSetupDirectories = [ ] -ClientSetupDirectories += [ "jungle_shapes" ] -ClientSetupDirectories += [ "jungle_maps" ] -ClientSetupDirectories += [ "jungle_tiles" ] -ClientSetupDirectories += [ "jungle_displaces" ] -ClientSetupDirectories += [ "jungle_bank" ] -ClientSetupDirectories += [ "jungle_vegetables" ] -ClientSetupDirectories += [ "jungle_vegetable_sets" ] -ClientSetupDirectories += [ "jungle_pacs_prim" ] -ClientSetupDirectories += [ "jungle_lightmaps" ] - -# Map directory -MapClientDirectory = "jungle_maps" - # Map directory +MapClientDirectory = CommonName + "_maps" BitmapClientDirectory = MapClientDirectory # Shape directory -ShapeClientDirectory = "jungle_shapes" +ShapeClientDirectory = CommonName + "_shapes" # Lightmap directory -LightmapClientDirectory = "jungle_lightmaps" +LightmapClientDirectory = CommonName + "_lightmaps" # Tile directory -TilesClientDirectory = "jungle_tiles" +TilesClientDirectory = CommonName + "_tiles" # Displace directory -DisplaceClientDirectory = "jungle_displaces" +DisplaceClientDirectory = CommonName + "_displaces" # Bank directory -BankClientDirectory = "jungle_bank" +BankClientDirectory = CommonName + "_bank" # Vegetable set directory -VegetSetClientDirectory = "jungle_vegetable_sets" +VegetSetClientDirectory = CommonName + "_vegetable_sets" # Vegetable shape directory -VegetClientDirectory = "jungle_vegetables" +VegetClientDirectory = CommonName + "_vegetables" # PACS primitives directories -PacsPrimClientDirectory = "jungle_pacs_prim" +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py index babdec16f..ca70a8a59 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py @@ -1,11 +1,15 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file config.py # \brief Process configuration -# \date 2010-05-24 06:30GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. -# Process configuration. +# Process configuration for 'jungle' ecosystem. # # NeL - MMORPG Framework # Copyright (C) 2010 Winch Gate Property Limited @@ -28,17 +32,26 @@ # *** PROCESS CONFIG *** ProcessToComplete = [ ] -ProcessToComplete += [ "shape" ] # not fully implemented, but works for this process -ProcessToComplete += [ "map" ] # not fully implemented, but works for this process -ProcessToComplete += [ "smallbank" ] # OK -ProcessToComplete += [ "farbank" ] # OK -ProcessToComplete += [ "tiles" ] # OK -ProcessToComplete += [ "displace" ] # OK -ProcessToComplete += [ "veget" ] # OK -ProcessToComplete += [ "vegetset" ] # OK -ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process, but does not export max files +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] ProcessToComplete += [ "pacs_prim" ] + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + # *** MAP EXPORT OPTIONS *** PanoplyFileList = [ ] HlsBankFileName = "" @@ -52,7 +65,7 @@ ShapeExportOptExportLighting = "true" ShapeExportOptShadow = "true" # Lighting limits. 0 : normal, 1 : soft shadows -ShapeExportOptLightingLimit = 0 +ShapeExportOptLightingLimit = 1 # Lightmap lumel size ShapeExportOptLumelSize = "0.25" @@ -64,7 +77,7 @@ ShapeExportOptOversampling = 1 ShapeExportOpt8BitsLightmap = "false" # Does the lightmaps export must generate logs ? -ShapeExportOptLightmapLog = "false" +ShapeExportOptLightmapLog = "true" # Coarse mesh texture mul size TextureMulSizeValue = "1.5" @@ -75,10 +88,10 @@ ClodConfigFile = "" # *** COARSE MESH TEXTURE NAME *** CoarseMeshTextureNames = [ ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_sp" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_su" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_au" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_wi" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] # *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** MultipleTilesPostfix = [ ] @@ -90,7 +103,7 @@ MultipleTilesPostfix += [ "_wi" ] # *** BANK EXPORT OPTIONS *** # Name of the tilebank to use -BankTileBankName = "jungle" +BankTileBankName = EcosystemName # *** RBANK EXPORT OPTIONS *** diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py new file mode 100644 index 000000000..e48979a8c --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py @@ -0,0 +1,257 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'lacustre' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "lacustre" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "tryker" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/constructible" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py new file mode 100644 index 000000000..93817c333 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'lacustre' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "lacustre" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 8 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py new file mode 100644 index 000000000..cebc4857a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py @@ -0,0 +1,242 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'primes_racines' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "primes_racines" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "primes_racines" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/batiments" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/aditif" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py new file mode 100644 index 000000000..b49eec027 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'primes_racines' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "primes_racines" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 1 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py index e04f683f6..a83f27f3b 100644 --- a/code/ryzom/tools/build_gamedata/workspace/projects.py +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -35,7 +35,10 @@ ProjectsToProcess += [ "common/sfx" ] ProjectsToProcess += [ "common/fauna" ] # Ecosystem projects +ProjectsToProcess += [ "ecosystems/desert" ] ProjectsToProcess += [ "ecosystems/jungle" ] +ProjectsToProcess += [ "ecosystems/primes_racines" ] +ProjectsToProcess += [ "ecosystems/lacustre" ] # Continent projects ProjectsToProcess += [ "continents/newbieland" ] @@ -49,9 +52,7 @@ ProjectsToProcess += [ "common/sky" ] # Depends on jungle/newbieland due to ig_l #ProjectsToProcess += [ "common/characters" ] # TODO #ProjectsToProcess += [ "common/characters_maps_hr" ] # TODO #ProjectsToProcess += [ "common/characters_maps_lr" ] # TODO -#ProjectsToProcess += [ "ecosystems/desert" ] # TODO -#ProjectsToProcess += [ "ecosystems/lacustre" ] # TODO -#ProjectsToProcess += [ "ecosystems/primes_racines" ] # TODO +#ProjectsToProcess += [ "continents/indoors" ] # TODO # end of file