From 040ee18dfacad45c25c2425e7f724b692535058e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 5 Jun 2010 01:09:49 +0200 Subject: [PATCH] Added: #929 Work in progress of new build pipeline scripts. --- code/nel/tools/build_gamedata/0_setup.py | 169 ++++ code/nel/tools/build_gamedata/1_export.py | 73 ++ code/nel/tools/build_gamedata/2_build.py | 73 ++ code/nel/tools/build_gamedata/3_install.py | 72 ++ .../build_gamedata/configuration/buildsite.py | 65 ++ .../build_gamedata/configuration/scripts.py | 232 +++++ .../build_gamedata/configuration/tools.py | 81 ++ .../tools/build_gamedata/processes/0_setup.py | 80 ++ .../build_gamedata/processes/1_export.py | 64 ++ .../tools/build_gamedata/processes/2_build.py | 64 ++ .../build_gamedata/processes/3_install.py | 63 ++ .../build_gamedata/processes/anim/0_setup.py | 66 ++ .../build_gamedata/processes/anim/1_export.py | 63 ++ .../build_gamedata/processes/anim/2_build.py | 65 ++ .../processes/anim/3_install.py | 57 ++ .../processes/anim/todo_export_maxscript | 0 .../build_gamedata/processes/cegui/0_setup.py | 65 ++ .../processes/cegui/1_export.py | 67 ++ .../build_gamedata/processes/cegui/2_build.py | 67 ++ .../processes/cegui/3_install.py | 56 + .../clodbank/maxscript/clod_export.ms | 269 +++++ .../processes/displace/0_setup.py | 65 ++ .../processes/displace/1_export.py | 55 + .../processes/displace/2_build.py | 49 + .../processes/displace/3_install.py | 57 ++ .../processes/farbank/0_setup.py | 66 ++ .../processes/farbank/1_export.py | 49 + .../processes/farbank/2_build.py | 74 ++ .../processes/farbank/3_install.py | 55 + .../build_gamedata/processes/font/0_setup.py | 64 ++ .../build_gamedata/processes/font/1_export.py | 51 + .../build_gamedata/processes/font/2_build.py | 51 + .../processes/font/3_install.py | 61 ++ .../processes/ig_light/0_setup.py | 67 ++ .../processes/ig_light/1_export.py | 49 + .../processes/ig_light/2_build.py | 65 ++ .../processes/ig_light/3_install.py | 57 ++ .../processes/interface/0_setup.py | 76 ++ .../processes/interface/1_export.py | 96 ++ .../processes/interface/2_build.py | 73 ++ .../processes/interface/3_install.py | 69 ++ .../build_gamedata/processes/ligo/0_setup.py | 119 +++ .../build_gamedata/processes/ligo/1_export.py | 104 ++ .../build_gamedata/processes/ligo/2_build.py | 69 ++ .../processes/ligo/3_install.py | 50 + .../ligo/maxscript/nel_ligo_export.ms | 957 ++++++++++++++++++ .../build_gamedata/processes/map/0_setup.py | 68 ++ .../build_gamedata/processes/map/1_export.py | 49 + .../build_gamedata/processes/map/2_build.py | 108 ++ .../build_gamedata/processes/map/3_install.py | 69 ++ .../build_gamedata/processes/rbank/0_setup.py | 90 ++ .../processes/rbank/1_export.py | 98 ++ .../build_gamedata/processes/rbank/2_build.py | 248 +++++ .../processes/rbank/3_install.py | 68 ++ .../build_gamedata/processes/shape/0_setup.py | 72 ++ .../processes/shape/1_export.py | 136 +++ .../build_gamedata/processes/shape/2_build.py | 118 +++ .../processes/shape/3_install.py | 70 ++ .../processes/shape/maxscript/shape_export.ms | 511 ++++++++++ .../processes/sheet_id/0_setup.py | 65 ++ .../processes/sheet_id/1_export.py | 49 + .../processes/sheet_id/2_build.py | 64 ++ .../processes/sheet_id/3_install.py | 57 ++ .../processes/sheets/0_setup.py | 66 ++ .../processes/sheets/1_export.py | 49 + .../processes/sheets/2_build.py | 65 ++ .../processes/sheets/3_install.py | 57 ++ .../build_gamedata/processes/skel/0_setup.py | 65 ++ .../build_gamedata/processes/skel/1_export.py | 63 ++ .../build_gamedata/processes/skel/2_build.py | 49 + .../processes/skel/3_install.py | 57 ++ .../processes/skel/todo_export_maxscript | 0 .../processes/smallbank/0_setup.py | 64 ++ .../processes/smallbank/1_export.py | 72 ++ .../processes/smallbank/2_build.py | 49 + .../processes/smallbank/3_install.py | 57 ++ .../build_gamedata/processes/sound/0_setup.py | 68 ++ .../processes/sound/1_export.py | 49 + .../build_gamedata/processes/sound/2_build.py | 67 ++ .../processes/sound/3_install.py | 60 ++ .../build_gamedata/processes/swt/0_setup.py | 65 ++ .../build_gamedata/processes/swt/1_export.py | 63 ++ .../build_gamedata/processes/swt/2_build.py | 49 + .../build_gamedata/processes/swt/3_install.py | 57 ++ .../processes/swt/maxscript/swt_export.ms | 139 +++ .../processes/swt/todo_export_maxscript | 0 .../build_gamedata/processes/tiles/0_setup.py | 65 ++ .../processes/tiles/1_export.py | 84 ++ .../build_gamedata/processes/tiles/2_build.py | 49 + .../processes/tiles/3_install.py | 55 + .../build_gamedata/processes/veget/0_setup.py | 66 ++ .../processes/veget/1_export.py | 91 ++ .../build_gamedata/processes/veget/2_build.py | 49 + .../processes/veget/3_install.py | 57 ++ .../processes/veget/maxscript/veget_export.ms | 249 +++++ .../processes/vegetset/0_setup.py | 65 ++ .../processes/vegetset/1_export.py | 57 ++ .../processes/vegetset/2_build.py | 49 + .../processes/vegetset/3_install.py | 57 ++ .../build_gamedata/processes/zone/0_setup.py | 65 ++ .../build_gamedata/processes/zone/1_export.py | 69 ++ .../build_gamedata/processes/zone/2_build.py | 102 ++ .../processes/zone/3_install.py | 50 + .../processes/zone/todo_build_dependencies | 0 .../processes/zone/todo_export_maxscript | 0 .../processes/zone_light/0_setup.py | 98 ++ .../processes/zone_light/1_export.py | 102 ++ .../processes/zone_light/2_build.py | 103 ++ .../processes/zone_light/3_install.py | 71 ++ .../zone_light/todo_patch_tile_water | 0 .../nel/tools/build_gamedata/work_in_progress | 0 .../tools/build_gamedata/work_in_progress | 0 .../continents/newbieland/directories.py | 109 ++ .../continents/newbieland/process.py | 103 ++ .../newbieland/zone_lighter_base.cfg | 52 + .../newbieland/zone_lighter_draft.cfg | 93 ++ .../newbieland/zone_lighter_final.cfg | 93 ++ .../ecosystems/jungle/directories.py | 245 +++++ .../workspace/ecosystems/jungle/process.py | 108 ++ .../build_gamedata/workspace/projects.py | 33 + 120 files changed, 10118 insertions(+) create mode 100644 code/nel/tools/build_gamedata/0_setup.py create mode 100644 code/nel/tools/build_gamedata/1_export.py create mode 100644 code/nel/tools/build_gamedata/2_build.py create mode 100644 code/nel/tools/build_gamedata/3_install.py create mode 100644 code/nel/tools/build_gamedata/configuration/buildsite.py create mode 100644 code/nel/tools/build_gamedata/configuration/scripts.py create mode 100644 code/nel/tools/build_gamedata/configuration/tools.py create mode 100644 code/nel/tools/build_gamedata/processes/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/cegui/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/cegui/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/cegui/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/cegui/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/displace/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/displace/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/displace/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/displace/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/font/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/font/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/font/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/font/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/map/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/map/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/map/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/map/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/tiles/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/tiles/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/tiles/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/tiles/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/todo_build_dependencies create mode 100644 code/nel/tools/build_gamedata/processes/zone/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/todo_patch_tile_water create mode 100644 code/nel/tools/build_gamedata/work_in_progress create mode 100644 code/ryzom/tools/build_gamedata/work_in_progress create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/projects.py diff --git a/code/nel/tools/build_gamedata/0_setup.py b/code/nel/tools/build_gamedata/0_setup.py new file mode 100644 index 000000000..cb90e1cd5 --- /dev/null +++ b/code/nel/tools/build_gamedata/0_setup.py @@ -0,0 +1,169 @@ +#!/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("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup build site") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +printLog(log, "This script will set up the buildsite configuration, and create needed directories.") +printLog(log, "To use the defaults, simply hit ENTER, else type in the new value.") +printLog(log, "Use -- if you need to insert an empty value.") +printLog(log, "") +BuildQuality = int(askVar(log, "Build Quality", str(BuildQuality))) +ToolDirectories[0] = askVar(log, "Primary Tool Directory", ToolDirectories[0]).replace("\\", "/") +ToolDirectories[1] = askVar(log, "Secondary Tool Directory", ToolDirectories[1]).replace("\\", "/") +ToolSuffix = askVar(log, "Tool Suffix", ToolSuffix) +ScriptDirectory = askVar(log, "Script Directory", os.getcwd().replace("\\", "/")).replace("\\", "/") +WorkspaceDirectory = askVar(log, "Workspace Directory", WorkspaceDirectory).replace("\\", "/") +DatabaseDirectory = askVar(log, "Database Directory", DatabaseDirectory).replace("\\", "/") +ExportBuildDirectory = askVar(log, "Export Build Directory", ExportBuildDirectory).replace("\\", "/") +ClientDataDirectory = askVar(log, "Client Data Directory", ClientDataDirectory).replace("\\", "/") +LeveldesignDirectory = askVar(log, "Leveldesign Directory", LeveldesignDirectory).replace("\\", "/") +LeveldesignDfnDirectory = askVar(log, "Leveldesign DFN Directory", LeveldesignDfnDirectory).replace("\\", "/") +LeveldesignWorldDirectory = askVar(log, "Leveldesign World Directory", LeveldesignWorldDirectory).replace("\\", "/") +MaxAvailable = int(askVar(log, "3dsMax Available", str(MaxAvailable))) +if MaxAvailable: + MaxDirectory = askVar(log, "3dsMax Directory", MaxDirectory).replace("\\", "/") + MaxUserDirectory = askVar(log, "3dsMax User Directory", MaxUserDirectory).replace("\\", "/") + MaxExecutable = askVar(log, "3dsMax Executable", MaxExecutable) +if os.path.isfile("configuration/buildsite.py"): + os.remove("configuration/buildsite.py") +sf = open("configuration/buildsite.py", "w") +sf.write("#!/usr/bin/python\n") +sf.write("# \n") +sf.write("# \\file site.py\n") +sf.write("# \\brief Site configuration\n") +sf.write("# \\date " + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "\n") +sf.write("# \\author Jan Boon (Kaetemi)\n") +sf.write("# Python port of game data build pipeline.\n") +sf.write("# Site configuration.\n") +sf.write("# \n") +sf.write("# NeL - MMORPG Framework \n") +sf.write("# Copyright (C) 2010 Winch Gate Property Limited\n") +sf.write("# \n") +sf.write("# This program is free software: you can redistribute it and/or modify\n") +sf.write("# it under the terms of the GNU Affero General Public License as\n") +sf.write("# published by the Free Software Foundation, either version 3 of the\n") +sf.write("# License, or (at your option) any later version.\n") +sf.write("# \n") +sf.write("# This program is distributed in the hope that it will be useful,\n") +sf.write("# but WITHOUT ANY WARRANTY; without even the implied warranty of\n") +sf.write("# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n") +sf.write("# GNU Affero General Public License for more details.\n") +sf.write("# \n") +sf.write("# You should have received a copy of the GNU Affero General Public License\n") +sf.write("# along with this program. If not, see .\n") +sf.write("# \n") +sf.write("\n") +sf.write("\n") +sf.write("# *** SITE INSTALLATION ***\n") +sf.write("\n") +sf.write("# Use '/' in path name, not '\'\n") +sf.write("# Don't put '/' at the end of a directory name\n") +sf.write("\n") +sf.write("\n") +sf.write("# Quality option for this site (1 for BEST, 0 for DRAFT)\n") +sf.write("BuildQuality = " + str(BuildQuality) + "\n") +sf.write("\n") +sf.write("ToolDirectories = " + str(ToolDirectories) + "\n") +sf.write("ToolSuffix = \"" + str(ToolSuffix) + "\"\n") +sf.write("\n") +sf.write("# Build script directory\n") +sf.write("ScriptDirectory = \"" + str(ScriptDirectory) + "\"\n") +sf.write("WorkspaceDirectory = \"" + str(WorkspaceDirectory) + "\"\n") +sf.write("\n") +sf.write("# Data build directories\n") +sf.write("DatabaseDirectory = \"" + str(DatabaseDirectory) + "\"\n") +sf.write("ExportBuildDirectory = \"" + str(ExportBuildDirectory) + "\"\n") +sf.write("\n") +sf.write("# Client data install directory (client/data)\n") +sf.write("ClientDataDirectory = \"" + str(ClientDataDirectory) + "\"\n") +sf.write("\n") +sf.write("# TODO: NETWORK RECONNECT NOT IMPLEMENTED :)\n") +sf.write("\n") +sf.write("# Leveldesign directories\n") +sf.write("LeveldesignDirectory = \"" + str(LeveldesignDirectory) + "\"\n") +sf.write("LeveldesignDfnDirectory = \"" + str(LeveldesignDfnDirectory) + "\"\n") +sf.write("LeveldesignWorldDirectory = \"" + str(LeveldesignWorldDirectory) + "\"\n") +sf.write("\n") +sf.write("# 3dsMax directives\n") +sf.write("MaxAvailable = " + str(MaxAvailable) + "\n") +sf.write("MaxDirectory = \"" + str(MaxDirectory) + "\"\n") +sf.write("MaxUserDirectory = \"" + str(MaxUserDirectory) + "\"\n") +sf.write("MaxExecutable = \"" + str(MaxExecutable) + "\"\n") +sf.write("\n") +sf.write("\n") +sf.write("# end of file\n") +sf.close() + +sys.path.append(WorkspaceDirectory) +from projects import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the setup projects") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "0_setup.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("0_setup.log"): + os.remove("0_setup.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_setup.log") +shutil.move("log.log", "0_setup.log") diff --git a/code/nel/tools/build_gamedata/1_export.py b/code/nel/tools/build_gamedata/1_export.py new file mode 100644 index 000000000..697e175dd --- /dev/null +++ b/code/nel/tools/build_gamedata/1_export.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Run all export processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all export 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("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +sys.path.append(WorkspaceDirectory) +from projects import * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the export processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "1_export.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("1_export.log"): + os.remove("1_export.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_export.log") +shutil.move("log.log", "1_export.log") diff --git a/code/nel/tools/build_gamedata/2_build.py b/code/nel/tools/build_gamedata/2_build.py new file mode 100644 index 000000000..914ccf522 --- /dev/null +++ b/code/nel/tools/build_gamedata/2_build.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Run all build processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all build 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("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +sys.path.append(WorkspaceDirectory) +from projects import * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the build processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "2_build.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("2_build.log"): + os.remove("2_build.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_build.log") +shutil.move("log.log", "2_build.log") diff --git a/code/nel/tools/build_gamedata/3_install.py b/code/nel/tools/build_gamedata/3_install.py new file mode 100644 index 000000000..6a2a3f3ac --- /dev/null +++ b/code/nel/tools/build_gamedata/3_install.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Run all install processes +# \date 2009-02-18 16:19GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all install 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("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +sys.path.append(WorkspaceDirectory) +from projects import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the install processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "3_install.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("3_install.log"): + os.remove("3_install.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_install.log") +shutil.move("log.log", "3_install.log") diff --git a/code/nel/tools/build_gamedata/configuration/buildsite.py b/code/nel/tools/build_gamedata/configuration/buildsite.py new file mode 100644 index 000000000..35b585057 --- /dev/null +++ b/code/nel/tools/build_gamedata/configuration/buildsite.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file site.py +# \brief Site configuration +# \date 2010-06-04-21-25-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Site configuration. +# +# 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 . +# + + +# *** SITE INSTALLATION *** + +# Use '/' in path name, not '' +# Don't put '/' at the end of a directory name + + +# Quality option for this site (1 for BEST, 0 for DRAFT) +BuildQuality = 1 + +ToolDirectories = ['R:/code/nel', 'R:/code/ryzom/tools'] +ToolSuffix = "_r.exe" + +# Build script directory +ScriptDirectory = "W:/build_gamedata" +WorkspaceDirectory = "R:/code/ryzom/tools/build_gamedata/workspace" + +# Data build directories +DatabaseDirectory = "W:/database" +ExportBuildDirectory = "W:/export" + +# Client data install directory (client/data) +ClientDataDirectory = "S:/ryzom_client_open/user" + +# TODO: NETWORK RECONNECT NOT IMPLEMENTED :) + +# Leveldesign directories +LeveldesignDirectory = "L:/leveldesign" +LeveldesignDfnDirectory = "L:/leveldesign/dfn" +LeveldesignWorldDirectory = "L:/leveldesign/world" + +# 3dsMax directives +MaxAvailable = 1 +MaxDirectory = "C:/Program Files (x86)/Autodesk/3ds Max 2010" +MaxUserDirectory = "C:/Users/Kaetemi/AppData/Local/Autodesk/3dsMax/2010 - 32bit/enu" +MaxExecutable = "3dsmax.exe" + + +# end of file diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py new file mode 100644 index 000000000..f07a94839 --- /dev/null +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -0,0 +1,232 @@ +#!/usr/bin/python +# +# \file export.py +# \brief Useful scripts +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Useful scripts +# +# 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 + +def printLog(log, text): + log.write(text + "\n") + print text + +def mkPath(log, path): + printLog(log, "DIR " + path) + distutils.dir_util.mkpath(path) + +def needUpdate(log, source, dest): + if (os.path.isfile(source)): + if (os.path.isfile(dest)): + if (os.stat(source).st_mtime > os.stat(dest).st_mtime): + return 1 + else: + return 0 + return 1 + printLog(log, "needUpdate: source doest not exist?! " + source) + return 0 + +def needUpdateRemoveDest(log, source, dest): + if (os.path.isfile(source)): + if (os.path.isfile(dest)): + if (os.stat(source).st_mtime > os.stat(dest).st_mtime): + os.remove(dest) + return 1 + else: + return 0 + return 1 + printLog(log, "needUpdate: source doest not exist?! " + source) + return 0 + +def needUpdateLogRemoveDest(log, source, dest): + if (os.path.isfile(source)): + if (os.path.isfile(dest)): + if (os.stat(source).st_mtime > os.stat(dest).st_mtime): + os.remove(dest) + printLog(log, source + " -> " + dest) + return 1 + else: + printLog(log, "SKIP " + dest) + return 0 + printLog(log, source + " -> " + dest) + return 1 + printLog(log, "needUpdate: source doest not exist?! " + source) + printLog(log, "SKIP " + dest) + return 0 + +def copyFileList(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn": + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + fileName) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName) + +def copyFileListNoTree(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn": + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + os.path.basename(fileName)) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + os.path.basename(fileName)) + +def copyFileListNoTreeIfNeeded(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + srcFile = dir_source + "/" + fileName + destFile = dir_target + "/" + os.path.basename(fileName) + if needUpdateLogRemoveDest(log, srcFile, destFile): + shutil.copy(srcFile, destFile) + +def removeFilesRecursive(log, dir_files): + files = os.listdir(dir_files) + for fileName in files: + if (fileName != ".svn"): + if os.path.isdir(dir_files + "/" + fileName): + removeFilesRecursive(log, dir_files + "/" + fileName) + else: + printLog(log, "RM " + dir_files + "/" + fileName) + os.remove(dir_files + "/" + fileName) + +def copyFilesRecursive(log, dir_source, dir_target): + files = os.listdir(dir_source) + mkPath(log, dir_target) + for fileName in files: + if (fileName != ".svn"): + if os.path.isdir(dir_source + "/" + fileName): + copyFilesRecursive(log, dir_source + "/" + fileName, dir_target + "/" + fileName) + else: + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + fileName) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName) + +def copyFiles(log, dir_source, dir_target): + copyFileList(log, dir_source, dir_target, os.listdir(dir_source)) + +def copyFilesExt(log, dir_source, dir_target, file_ext): + files = os.listdir(dir_source) + len_file_ext = len(file_ext) + for fileName in files: + if (fileName != ".svn") and (fileName[-len_file_ext:].lower() == file_ext.lower()): + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + fileName) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName) + +def copyFilesExtNoTree(log, dir_source, dir_target, file_ext): + files = findFiles(log, dir_source, "", file_ext) + copyFileListNoTree(log, dir_source, dir_target, files) + +def copyFilesExtNoTreeIfNeeded(log, dir_source, dir_target, file_ext): + files = findFiles(log, dir_source, "", file_ext) + copyFileListNoTreeIfNeeded(log, dir_source, dir_target, files) + +def copyFilesNoTreeIfNeeded(log, dir_source, dir_target): + copyFileListNoTreeIfNeeded(log, dir_source, dir_target, os.listdir(dir_source)) + +def copyFileListExtReplaceNoTreeIfNeeded(log, dir_source, dir_target, files, file_ext, target_ext): + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + srcFile = dir_source + "/" + fileName + destFile = dir_target + "/" + os.path.basename(fileName)[0:-len(file_ext)] + target_ext + if needUpdateLogRemoveDest(log, srcFile, destFile): + shutil.copy(srcFile, destFile) + +def copyFilesExtReplaceNoTreeIfNeeded(log, dir_source, dir_target, file_ext, target_ext): + files = findFiles(log, dir_source, "", file_ext) + copyFileListExtReplaceNoTreeIfNeeded(log, dir_source, dir_target, files, file_ext, target_ext) + +def copyFileIfNeeded(log, srcFile, destFile): + if needUpdateLogRemoveDest(log, srcFile, destFile): + shutil.copy(srcFile, destFile) + +def moveFileListNoTree(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn": + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + os.path.basename(fileName)) + shutil.move(dir_source + "/" + fileName, dir_target + "/" + os.path.basename(fileName)) + +def moveFilesExtNoTree(log, dir_source, dir_target, file_ext): + files = findFiles(log, dir_source, "", file_ext) + moveFileListNoTree(log, dir_source, dir_target, files) + +def findFiles(log, dir_where, dir_sub, file_ext): + result = [ ] + files = os.listdir(dir_where + "/" + dir_sub) + len_file_ext = len(file_ext) + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + filePath = dir_sub + fileName + fileFull = dir_where + "/" + dir_sub + fileName + if os.path.isfile(fileFull): + if fileName[-len_file_ext:].lower() == file_ext.lower(): + result += [ filePath ] + elif os.path.isdir(fileFull): + result += findFiles(log, dir_where, filePath + "/", file_ext) + else: + printLog(log, "findFiles: file not dir or file?!" + filePath) + return result + +def findFile(log, dir_where, file_name): + files = os.listdir(dir_where) + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + filePath = dir_where + "/" + fileName + if os.path.isfile(filePath): + if fileName == file_name: + return filePath + elif os.path.isdir(filePath): + result = findFile(log, filePath, file_name) + if result != "": + return result + else: + printLog(log, "findFile: file not dir or file?! " + filePath) + return "" + +def findTool(log, dirs_where, file_name, suffix): + try: + for dir in dirs_where: + tool = findFile(log, dir, file_name + suffix) + if tool != "": + printLog(log, "TOOL " + tool) + return tool + except Exception, e: + printLog(log, "EXCEPTION " + str(e)) + printLog(log, "TOOL NOT FOUND " + file_name + suffix) + return "" + +def findMax(log, dir, file): + tool = dir + "/" + file + if os.path.isfile(tool): + printLog(log, "3DSMAX " + tool) + return tool + printLog(log, "3DSMAX NOT FOUND " + file) + return "" + +def toolLogFail(log, tool, suffix): + printLog(log, "FAIL " + tool + suffix + " is not found") + +def askVar(log, name, default): + sys.stdout.write(name + " (" + default + "): ") + line = sys.stdin.readline() + linestrip = line.strip() + if linestrip == "--": + log.write(name + " (" + default + "): ''\n") + return "" + elif linestrip == "": + log.write(name + " (" + default + "): '" + default + "'\n") + return default + else: + log.write(name + " (" + default + "): '" + linestrip + "'\n") + return linestrip diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py new file mode 100644 index 000000000..c2f24a77f --- /dev/null +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# +# \file process.py +# \brief Tools configuration +# \date 2009-03-10 11:33GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Tools configuration. +# +# 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 TIMEOUT *** +SkelExportTimeout = 60000 +SwtExportTimeout = 60000 +ShapeExportTimeout = 3600000 +ZoneExportTimeout = 1800000 +ZoneBuildDependTimeout = 1800000 +ZoneBuildWeldTimeout = 60000 +ZoneLightBuildTimeout = 600000 +ZoneIgLightBuildTimeout = 600000 +SmallbankBuildTimeout = 60000 +FarbankBuildTimeout = 180000 +AnimExportTimeout = 1800000 +IgExportTimeout = 600000 +MapsBuildTimeout = 10000 +CmbExportTimeout = 60000 +RbankBuildTesselTimeout = 60000 +RbankBuildSmoothTimeout = 60000 +RbankBuildProclocalTimeout = 60000 +RbankBuildProcglobalTimeout = 180000 +RbankBuildIndoorTimeout = 180000 +# WmapBuildTimeout = 60000 +LigoExportTimeout = 3600000 +LigoBuildTimeout = 1800000 +PacsPrimExportTimeout = 60000 + +# *** TOOLS CONFIGURATION *** + +TgaToDdsTool = "tga2dds" +BuildInterfaceTool = "build_interface" +ExecTimeoutTool = "exec_timeout" +BuildSmallbankTool = "build_smallbank" +BuildFarbankTool = "build_far_bank" +ZoneDependenciesTool = "zone_dependencies" +ZoneWelderTool = "zone_welder" +BuildRbankTool = "build_rbank" +BuildIndoorRbankTool = "build_indoor_rbank" +BuildIgBoxesTool = "build_ig_boxes" +AiBuildWmapTool = "ai_build_wmap" +GetNeighborsTool = "get_neighbors" +ZoneLighterTool = "zone_lighter" +ZoneIgLighterTool = "zone_ig_lighter" +IgLighterTool = "ig_lighter" +AnimBuilderTool = "anim_builder" +TileEditTool = "tile_edit" +BuildImagesetTool = "th_build_imageset" +MakeSheetIdTool = "make_sheet_id" +BuildSheetsTool = "th_build_sheets" +BuildSoundTool = "th_build_sound" +BuildCoarseMeshTool = "build_coarse_mesh" +LightmapOptimizerTool = "lightmap_optimizer" +BuildClodtexTool = "build_clodtex" +BuildShadowSkinTool = "build_shadow_skin" +PanoplyMakerTool = "panoply_maker" +HlsBankMakerTool = "hls_bank_maker" +LandExportTool = "land_export" diff --git a/code/nel/tools/build_gamedata/processes/0_setup.py b/code/nel/tools/build_gamedata/processes/0_setup.py new file mode 100644 index 000000000..e973547f5 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/0_setup.py @@ -0,0 +1,80 @@ +#!/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") +sys.path.append("../configuration/project") +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 project") +#printLog(log, "-------") +#printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +#printLog(log, "") + +#printLog(log, "") +#printLog(log, "-------") +#printLog(log, "--- Setup client directories") +#printLog(log, "-------") +#printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +#printLog(log, "") +#for dir in ClientSetupDirectories: +# mkPath(log, ClientDataDirectory + "/" + dir) +#printLog(log, "") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the setup processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "0_setup.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/1_export.py b/code/nel/tools/build_gamedata/processes/1_export.py new file mode 100644 index 000000000..2730b560a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/1_export.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Run all export processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all export 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") +sys.path.append("../configuration/project") +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 * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the export processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "1_export.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/2_build.py b/code/nel/tools/build_gamedata/processes/2_build.py new file mode 100644 index 000000000..3952074b5 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/2_build.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Run all build processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all build 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") +sys.path.append("../configuration/project") +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 * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the build processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "2_build.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/3_install.py b/code/nel/tools/build_gamedata/processes/3_install.py new file mode 100644 index 000000000..5b2464e27 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/3_install.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Run all install processes +# \date 2009-02-18 16:19GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all install 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") +sys.path.append("../configuration/project") +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, "--- Run the install processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "3_install.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/0_setup.py b/code/nel/tools/build_gamedata/processes/anim/0_setup.py new file mode 100644 index 000000000..fc26202e6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup anim +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup anim +# +# 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") +sys.path.append("../../configuration/project") +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 anim") +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 AnimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + AnimBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + AnimClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py new file mode 100644 index 000000000..fd95fe95b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export anim +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export anim +# +# 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") +sys.path.append("../../configuration/project") +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 anim") +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 anim directory +printLog(log, ">>> Export anim 3dsmax <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) +for dir in AnimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/2_build.py b/code/nel/tools/build_gamedata/processes/anim/2_build.py new file mode 100644 index 000000000..8d07a3993 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/2_build.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build anim +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build anim +# +# 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") +sys.path.append("../../configuration/project") +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 anim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +AnimBuilder = findTool(log, ToolDirectories, AnimBuilderTool, ToolSuffix) +printLog(log, "") + +# For each anim directory +printLog(log, ">>> Build anim <<<") +if AnimBuilder == "": + toolLogFail(log, AnimBuilderTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + AnimExportDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + AnimBuildDirectory + mkPath(log, destDir) + subprocess.call([ AnimBuilder, srcDir, destDir, ScriptDirectory + "/configuration/zone_lighter_properties.cfg" ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/3_install.py b/code/nel/tools/build_gamedata/processes/anim/3_install.py new file mode 100644 index 000000000..ebf40642e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install anim +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install anim +# +# 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") +sys.path.append("../../configuration/project") +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 anim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install anim <<<") +srcDir = ExportBuildDirectory + "/" + AnimBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + AnimClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/cegui/0_setup.py b/code/nel/tools/build_gamedata/processes/cegui/0_setup.py new file mode 100644 index 000000000..429063d3b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Setup cegui +# +# 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") +sys.path.append("../../configuration/project") +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 cegui") +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 CeguiImagesetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + CeguiImagesetExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + CeguiImagesetBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + CeguiImagesetClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cegui/1_export.py b/code/nel/tools/build_gamedata/processes/cegui/1_export.py new file mode 100644 index 000000000..329a27dbb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/1_export.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Export cegui +# +# 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") +sys.path.append("../../configuration/project") +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 cegui") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# For each cegui imageset directory +printLog(log, ">>> Export cegui imagesets <<<") +destDir = ExportBuildDirectory + "/" + CeguiImagesetExportDirectory +mkPath(log, destDir) +for dir in CeguiImagesetSourceDirectories: + srcDir = DatabaseDirectory + "/" + dir + mkPath(log, srcDir) + imagesets = findFiles(log, srcDir, "", ".imageset") + if (len(imagesets) != 1): + printLog(log, "FAIL Cannot find *.imageset, folder must contain at least one and only one imageset xml file") + else: + niouname = dir.replace("/", "_") + newpath = destDir + "/" + niouname + mkPath(log, newpath) + copyFileIfNeeded(log, srcDir + "/" + imagesets[0], newpath + ".imageset") + copyFilesExtNoTreeIfNeeded(log, srcDir, newpath, ".tga") + copyFilesExtNoTreeIfNeeded(log, srcDir, newpath, ".png") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cegui/2_build.py b/code/nel/tools/build_gamedata/processes/cegui/2_build.py new file mode 100644 index 000000000..0f4653d0e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/2_build.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Build cegui +# +# 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") +sys.path.append("../../configuration/project") +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 cegui") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildImageset = findTool(log, ToolDirectories, BuildImagesetTool, ToolSuffix) +printLog(log, "") + +# For each cegui imageset directory +printLog(log, ">>> Build cegui imagesets <<<") +if BuildImageset == "": + toolLogFail(log, BuildImagesetTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + CeguiImagesetExportDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + CeguiImagesetBuildDirectory + mkPath(log, destDir) + for dir in os.listdir(srcDir): + if (os.path.isdir(srcDir + "/" + dir)) and dir != ".svn" and dir != "*.*": + mkPath(log, srcDir + "/" + dir) + subprocess.call([ BuildImageset, destDir + "/" + dir + ".tga", srcDir + "/" + dir ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cegui/3_install.py b/code/nel/tools/build_gamedata/processes/cegui/3_install.py new file mode 100644 index 000000000..7d458dced --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/3_install.py @@ -0,0 +1,56 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Install cegui +# +# 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") +sys.path.append("../../configuration/project") +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 cegui") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install cegui imagesets <<<") +srcDir = ExportBuildDirectory + "/" + CeguiImagesetBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + CeguiImagesetClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file 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 new file mode 100644 index 000000000..49326a260 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -0,0 +1,269 @@ +-- 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. + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +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 +) + +-- 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 goClodExport = +( + try + ( + -- Get files in the shape_source_directory + files = getFiles "shape_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- 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 + ( + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] 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 + ( + -- 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 + ) + ) + ) + ) + ) + + -- Something exported + if (exported == 0) then + ( + -- 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 + ) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting .clod: can't open the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("SKIPPED BY TAG "+files[i]) + ) + + 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 + ( + -- Error + nlerror ("ERROR fatal error exporting .clod in folder shape_source_directory") + return 0 + ) +) + +goClodExport() + +nlerror ("BYE") + +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/displace/0_setup.py b/code/nel/tools/build_gamedata/processes/displace/0_setup.py new file mode 100644 index 000000000..e84c6d787 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup displace +# +# 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") +sys.path.append("../../configuration/project") +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 displace") +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 DisplaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + DisplaceExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + DisplaceClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/displace/1_export.py b/code/nel/tools/build_gamedata/processes/displace/1_export.py new file mode 100644 index 000000000..ba7b29708 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/1_export.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export displace +# +# 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") +sys.path.append("../../configuration/project") +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 displace") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +mkPath(log, ExportBuildDirectory + "/" + DisplaceExportDirectory) +for dir in DisplaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + DisplaceExportDirectory, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + DisplaceExportDirectory, ".png") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/displace/2_build.py b/code/nel/tools/build_gamedata/processes/displace/2_build.py new file mode 100644 index 000000000..caa094059 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build displace +# +# 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") +sys.path.append("../../configuration/project") +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 displace") +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/processes/displace/3_install.py b/code/nel/tools/build_gamedata/processes/displace/3_install.py new file mode 100644 index 000000000..de5b34a9e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install displace +# +# 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") +sys.path.append("../../configuration/project") +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 displace") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install displace <<<") +clientPath = ClientDataDirectory + "/" + DisplaceClientDirectory +mkPath(log, clientPath) +mkPath(log, ExportBuildDirectory + "/" + DisplaceExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + DisplaceExportDirectory, clientPath, ".tga") +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + DisplaceExportDirectory, clientPath, ".png") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/farbank/0_setup.py b/code/nel/tools/build_gamedata/processes/farbank/0_setup.py new file mode 100644 index 000000000..d3786d179 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup farbank +# +# 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") +sys.path.append("../../configuration/project") +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 farbank") +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 postfix in MultipleTilesPostfix: + mkPath(log, DatabaseDirectory + "/" + TileRootSourceDirectory + postfix) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + BankClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/farbank/1_export.py b/code/nel/tools/build_gamedata/processes/farbank/1_export.py new file mode 100644 index 000000000..cbe55ea11 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export farbank +# +# 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") +sys.path.append("../../configuration/project") +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 farbank") +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/processes/farbank/2_build.py b/code/nel/tools/build_gamedata/processes/farbank/2_build.py new file mode 100644 index 000000000..cc62bc0a0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/2_build.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build farbank +# +# 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") +sys.path.append("../../configuration/project") +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 farbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildFarbank = findTool(log, ToolDirectories, BuildFarbankTool, ToolSuffix) +printLog(log, "") + +# For each bank export farbank +printLog(log, ">>> Build farbank <<<") +if ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +elif BuildFarbank == "": + toolLogFail(log, BuildFarbankTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory) + files = findFiles(log, ExportBuildDirectory + "/" + SmallbankExportDirectory, "", ".smallbank") + for file in files: + sourceFile = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + file + if os.path.isfile(sourceFile): + for postfix in MultipleTilesPostfix: + destFile = ExportBuildDirectory + "/" + FarbankBuildDirectory + "/" + file[0:-len(".smallbank")] + postfix + ".farbank" + if (needUpdateLogRemoveDest(log, sourceFile, destFile)): + mkPath(log, DatabaseDirectory + "/" + TileRootSourceDirectory + postfix) + subprocess.call([ ExecTimeout, str(FarbankBuildTimeout), BuildFarbank, sourceFile, destFile, "-d" + DatabaseDirectory + "/" + TileRootSourceDirectory + postfix + "/", "-p" + postfix ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/farbank/3_install.py b/code/nel/tools/build_gamedata/processes/farbank/3_install.py new file mode 100644 index 000000000..debd350e6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/3_install.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install farbank +# +# 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") +sys.path.append("../../configuration/project") +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 farbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install farbank <<<") +mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory) +mkPath(log, ClientDataDirectory + "/" + BankClientDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + FarbankBuildDirectory, ClientDataDirectory + "/" + BankClientDirectory, ".farbank") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/0_setup.py b/code/nel/tools/build_gamedata/processes/font/0_setup.py new file mode 100644 index 000000000..466444bd6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/0_setup.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# setup font +# +# 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") +sys.path.append("../../configuration/project") +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 font") +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 FontSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + FontClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/1_export.py b/code/nel/tools/build_gamedata/processes/font/1_export.py new file mode 100644 index 000000000..a44ae3bbb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/1_export.py @@ -0,0 +1,51 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export font +# +# 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") +sys.path.append("../../configuration/project") +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 font") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/2_build.py b/code/nel/tools/build_gamedata/processes/font/2_build.py new file mode 100644 index 000000000..bdc823e81 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/2_build.py @@ -0,0 +1,51 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build font +# +# 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") +sys.path.append("../../configuration/project") +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 font") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/3_install.py b/code/nel/tools/build_gamedata/processes/font/3_install.py new file mode 100644 index 000000000..b56978ff1 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/3_install.py @@ -0,0 +1,61 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install font +# +# 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") +sys.path.append("../../configuration/project") +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 font") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + FontClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install font <<<") +for dir in FontSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".ttf") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".afm") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfb") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfm") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py b/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py new file mode 100644 index 000000000..27f875bab --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup ig_light +# +# 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") +sys.path.append("../../configuration/project") +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 ig_light") +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 ig_lightSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +#mkPath(log, ExportBuildDirectory + "/" + ig_lightExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + IgVillageBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgLightVillageBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + IgClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ig_light/1_export.py b/code/nel/tools/build_gamedata/processes/ig_light/1_export.py new file mode 100644 index 000000000..c3229ca85 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export ig_light +# +# 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") +sys.path.append("../../configuration/project") +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 ig_light") +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/processes/ig_light/2_build.py b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py new file mode 100644 index 000000000..0dac110d3 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build ig_light +# +# 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") +sys.path.append("../../configuration/project") +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 ig_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +IgLighter = findTool(log, ToolDirectories, IgLighterTool, ToolSuffix) +printLog(log, "") + +# For each ig_light directory +printLog(log, ">>> Build ig_light <<<") +if IgLighter == "": + toolLogFail(log, IgLighterTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + IgVillageBuildDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + IgLightVillageBuildDirectory + mkPath(log, destDir) + subprocess.call([ IgLighter, srcDir, destDir, ScriptDirectory + "/configuration/zone_lighter_properties.cfg" ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ig_light/3_install.py b/code/nel/tools/build_gamedata/processes/ig_light/3_install.py new file mode 100644 index 000000000..2406ab170 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install ig_light +# +# 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") +sys.path.append("../../configuration/project") +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 ig_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install ig_light <<<") +srcDir = ExportBuildDirectory + "/" + IgLightVillageBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + IgClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/0_setup.py b/code/nel/tools/build_gamedata/processes/interface/0_setup.py new file mode 100644 index 000000000..49de11f0d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/0_setup.py @@ -0,0 +1,76 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup interface +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup interface +# +# 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") +sys.path.append("../../configuration/project") +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 interface") +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 InterfaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in InterfaceDxtcSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in InterfaceFullscreenSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in Interface3DSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + InterfaceClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/1_export.py b/code/nel/tools/build_gamedata/processes/interface/1_export.py new file mode 100644 index 000000000..a5eef4d0c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/1_export.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export interface +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export interface +# +# 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") +sys.path.append("../../configuration/project") +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 interface") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +printLog(log, "") + +# For each interface directory +printLog(log, ">>> Export interface <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory) +for dir in InterfaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + niouname = dir.replace("/", "_") + newpath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + niouname + mkPath(log, newpath) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") +printLog(log, "") + +# For each interface directory to compress in one DXTC +printLog(log, ">>> Export interface dxtc <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory) +for dir in InterfaceDxtcSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".tga") +printLog(log, "") + +# For each interface fullscreen directory compress independently all in dds +printLog(log, ">>> Export interface fullscreen <<<") +if TgaToDds == "": + toolLogFail(log, TgaToDdsTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory) + for dir in InterfaceFullscreenSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".tga") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) +printLog(log, "") + +# For each interface 3d directory +printLog(log, ">>> Export interface 3d <<<") +mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) +for dir in Interface3DSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".tga") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/2_build.py b/code/nel/tools/build_gamedata/processes/interface/2_build.py new file mode 100644 index 000000000..2b17b7a54 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/2_build.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build interface +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build interface +# +# 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") +sys.path.append("../../configuration/project") +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 interface") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildInterface = findTool(log, ToolDirectories, BuildInterfaceTool, ToolSuffix) +printLog(log, "") + +# For each interface directory +printLog(log, ">>> Build interface <<<") +if BuildInterface == "": + toolLogFail(log, BuildInterfaceTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory) + for dir in os.listdir(ExportBuildDirectory + "/" + InterfaceExportDirectory): + if (os.path.isdir(ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + dir)) and dir != ".svn" and dir != "*.*": + subprocess.call([ BuildInterface, ExportBuildDirectory + "/" + InterfaceBuildDirectory + "/texture_" + dir + ".tga", ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + dir ]) +printLog(log, "") + +# For each interface directory to compress in one DXTC +printLog(log, ">>> Build interface dxtc <<<") +if BuildInterface == "": + toolLogFail(log, BuildInterfaceTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory) + subprocess.call([ BuildInterface, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory + "/texture_interfaces_dxtc.tga", ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/3_install.py b/code/nel/tools/build_gamedata/processes/interface/3_install.py new file mode 100644 index 000000000..a727b0afc --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/3_install.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install interface +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install interface +# +# 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") +sys.path.append("../../configuration/project") +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 interface") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + InterfaceClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install interface <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory, clientPath) + +printLog(log, ">>> Install interface dxtc <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory, clientPath) + +printLog(log, ">>> Install interface fullscreen <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory, clientPath) + +printLog(log, ">>> Install interface 3d <<<") +mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + Interface3DExportDirectory, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py new file mode 100644 index 000000000..ecdc297f7 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py @@ -0,0 +1,119 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup ligo +# +# 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") +sys.path.append("../../configuration/project") +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 ligo") +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 <<<") +mkPath(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +if LigoExportLand != "": + mkPath(log, ExportBuildDirectory + "/" + LigoZoneBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + LigoIgLandBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + LigoIgOtherBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + RbankCmbBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") + +# Setup land exporter cfg +if LigoExportLand != "": + printLog(log, ">>> Setup land exporter cfg <<<") + mkPath(log, ScriptDirectory + "/configuration/project/generated") + cf = open(ScriptDirectory + "/configuration/project/generated/land_exporter.cfg", "w") + cf.write("\n") + cf.write("// Ligo settings\n") + cf.write("\n") + cf.write("OutZoneDir = \"" + ExportBuildDirectory + "/" + LigoZoneBuildDirectory + "\";\n") + cf.write("OutIGDir = \"" + ExportBuildDirectory + "/" + LigoIgLandBuildDirectory + "\";\n") + cf.write("AdditionnalIGOutDir = \"" + ExportBuildDirectory + "/" + LigoIgOtherBuildDirectory + "\";\n") + cf.write("\n") + cf.write("RefZoneDir = \"" + DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory+ "\";\n") # FIXME + cf.write("RefIGDir = \"" + DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory + "\";\n") + cf.write("AdditionnalIGInDir = \"" + DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory + "\";\n") # FIXME + cf.write("ContinentsDir = \"" + LeveldesignWorldDirectory + "\";\n") + cf.write("LigoBankDir = \"" + DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory + "\";\n") # FIXME + cf.write("\n") + cf.write("TileBankFile = \"" + DatabaseDirectory + "/" + LigoTileBankFile + "\";\n") + cf.write("\n") + cf.write("ColorMapFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportColormap + "\";\n") + cf.write("HeightMapFile1 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1 + "\";\n") + cf.write("ZFactor1 = " + LigoExportZFactor1 + ";\n") + cf.write("HeightMapFile2 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2 + "\";\n") + cf.write("ZFactor2 = " + LigoExportZFactor2 + ";\n") + cf.write("\n") + cf.write("ZoneLight = 0;\n") + cf.write("CellSize = 160;\n") + cf.write("Threshold = 1;\n") + cf.write("\n") + cf.write("DFNDir = \"" + LeveldesignDfnDirectory + "\";\n") + cf.write("RefCMBDir = \"" + DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory + "\";\n") # FIXME + cf.write("OutCMBDir = \"" + ExportBuildDirectory + "/" + RbankCmbBuildDirectory + "\";\n") # FIXME + cf.write("\n") + cf.write("ContinentFile = \"" + LeveldesignWorldDirectory + "/" + ContinentFile + "\";\n") + cf.write("\n") + cf.write("ExportCollisions = 1;\n") + cf.write("ExportAdditionnalIGs = 1;\n") + cf.write("\n") + cf.write("ZoneRegionFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand + "\";\n") + cf.write("\n") + cf.close() + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py new file mode 100644 index 000000000..77c3c9bff --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export ligo +# +# 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") +sys.path.append("../../configuration/project") +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 ligo") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +if LigoExportLand == "" or LigoExportOnePass == 1: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + printLog(log, "") + + # For each directory + printLog(log, ">>> Export ligo 3dsmax <<<") + + ligoIniPath = MaxUserDirectory + "/plugcfg/nelligo.ini" + mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) + mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) + 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.close() + + outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory + logFile = ScriptDirectory + "/processes/ligo/log.log" + smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" + + scriptSrc = "maxscript/nel_ligo_export.ms" + scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" + + if os.path.isfile(scriptDst): + os.remove(scriptDst) + + printLog(log, "WRITE " + scriptDst) + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("bankFilename", smallBank) + sDst.write(newline) + sSrc.close() + sDst.close() + + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-vn" ]) + + os.remove(scriptDst) + + printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/2_build.py b/code/nel/tools/build_gamedata/processes/ligo/2_build.py new file mode 100644 index 000000000..6ec37813c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/2_build.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build ligo +# +# 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") +sys.path.append("../../configuration/project") +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 ligo") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +if LigoExportLand != "": + ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + LandExport = findTool(log, ToolDirectories, LandExportTool, ToolSuffix) + + printLog(log, ">>> Generate ligo zone <<<") + if LandExport == "": + toolLogFail(log, LandExportTool, ToolSuffix) + elif ExecTimeout == "": + toolLogfail(log, ExecTimeoutTool, ToolSuffix) + else: + subprocess.call([ ExecTimeout, str(LigoExportTimeout), LandExport, ScriptDirectory + "/configuration/project/generated/land_exporter.cfg" ]) + + printLog(log, ">>> Copy to zone builder <<<") + dirSource = ExportBuildDirectory + "/" + LigoZoneBuildDirectory + dirTarget = ExportBuildDirectory + "/" + ZoneExportDirectory + mkPath(log, dirSource) + mkPath(log, dirTarget) + copyFilesExtReplaceNoTreeIfNeeded(log, dirSource, dirTarget, ".zonel", ".zone") + copyFilesExtNoTreeIfNeeded(log, dirSource, dirTarget, ".zonenh") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/3_install.py b/code/nel/tools/build_gamedata/processes/ligo/3_install.py new file mode 100644 index 000000000..d4bbc433c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/3_install.py @@ -0,0 +1,50 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install ligo +# +# 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") +sys.path.append("../../configuration/project") +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 ligo") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms new file mode 100644 index 000000000..a4aff1cb5 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -0,0 +1,957 @@ +-- Export zones and transzones + +ligo = 1304892483 +ligo_passable_app = ligo +ligo_rotate_app = 1266703978 +ligo_scale_app = 1266703979 +ligo_instance_app = 1266703980 + +TransitionScale = #( false, false, false, false, true, false, false, false, false) +TransitionRot = #( 2, 1, 3, 0, 1, 3, 0, 0, 0) +TransitionPos = #( [0, 0, 0], [-1, 0, 0], [-1, -1, 0], [-1, -2, 0], [0, -2, 0], [0, -3, 0], [-1, -3, 0], [-2, -3, 0], [-3, -3, 0]) +TransitionIds = #( #( 1, 2 ), #( undefinded, 3 ), #( 5, 4 ), #( 6, 7, 8, 9 ) ) +TransitionType = #( "CornerA", "CornerA", "Flat", "CornerA", "CornerB", "CornerB", "Flat", "Flat", "CornerB") +TransitionNumBis = #( 5, 4, 2, 3, 7, 6, 0, 1, 8) + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +tagThisFile = true + +-- 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 + ) +) + +-- Lower case +fn lowercase instring = +( + local upper, lower, outstring + upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + lower="abcdefghijklmnopqrstuvwxyz" + + outstring = copy instring + + for iii = 1 to outstring.count do + ( + jjj = findString upper outstring[iii] + if (jjj != undefined) then + outstring[iii] = lower[jjj] + else + outstring[iii] = instring[iii] + ) + return outstring -- value of outstring will be returned as function result +) + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +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 +) + +-- Add properties +fn addProperties node propsArray = +( + -- The passable properties + if (getappdata node ligo_passable_app) != undefined then + append propsArray #( "passable", "yes") + else + append propsArray #( "passable", "no") +) + +-- Is this node a debug markers ? +fn isDebugMarker node = +( + return matchPattern node.name pattern:"[NELLIGO]*" +) + +-- Delete debug markers +fn DeleteDebugMarkersFn = +( + -- Array to delete + arrayToDelete = #() + + -- For each error names + for i = 1 to rootNode.children.count do + ( + -- Node id + id = rootNode.children.count-i+1 + + if (isDebugMarker rootNode.children[id]) == true then + ( + append arrayToDelete rootNode.children[id] + ) + ) + + -- For each node to delete + for i = 1 to arrayToDelete.count do + ( + -- Node id + delete arrayToDelete[i] + ) +) + +-- Get the transition zone coordinate +fn getTransitionZoneCoordinates node x y = +( + -- Get nelsize + cellSize = NeLLigoGetCellSize () + + -- Object center + center = node.center + + -- Get X and Y coordinates + x[1] = (center.x / cellSize) as Integer + y[1] = (center.y / cellSize) as Integer + + -- Valid Y coordinate ? + if (y[1] < 0) or (y[1] >= TransitionIds.count) then + ( + if (nodeArray != undefined) then + messageBox ("The zone "+nodeArray[zone].name+" is not well positionned. Check the transition scheme.") title:title_msgbox beep:true + return false + ) + else + ( + -- Valid X coordinate ? + if (x[1] < 0) or (x[1] >= TransitionIds[y[1]+1].count) then + ( + if (nodeArray != undefined) then + messageBox ("The zone "+nodeArray[zone].name+" is not well positionned. Check the transition scheme.") title:title_msgbox beep:true + return false + ) + ) + + return true +) + +fn selectAllPatch = +( + clearselection () + for i in geometry do + ( + if (classof i) == RklPatch then + ( + if (i.isFrozen == false) then + ( + selectmore i + ) + ) + ) +) + + +-- Get the ig name of this object +fn getIg node = +( + igName = (getappdata node NEL3D_APPDATA_IGNAME) + if igName == "" then + ( + return undefined + ) + if (igName != undefined) then + return (lowercase (igName)) + else + return undefined +) + + + + +-- Export collisions from the current loaded zone +fn exportCollisionsFromZone outputPath filename = +( + max select all + -- Export the collision + if (NelExportCollision ($selection as array) outputPath) == false then + ( + -- nlerror ("WARNING No collision exported from file "+filename) + ) + else + ( + nlerror ("OK collision in folder "+outputPath) + ) +) + +fn buildTransitionMatrix mt transitionZone cellSize = +( + copyMt = mt + backupPos = copyMt.pos + copyMt.pos = [0,0,0] + + -- Scale ? + if TransitionScale[transitionZone] == true then + ( + copyMt = scale copyMt [-1,1,1] + ) + + -- Rotate + if TransitionRot[transitionZone] != 0 then + ( + copyMt = rotateZ copyMt (90*TransitionRot[transitionZone]) + ) + + -- Translation + return translate copyMt ( (TransitionPos[transitionZone] * cellSize) + backupPos) +) + +fn buildTransitionMatrixObj mt transitionZone cellSize = +( + -- Place at the origine + copyMt = transMatrix (TransitionPos[transitionZone] * cellSize) + + -- Center the zone + copyMt = translate copyMt [-cellSize/2, -cellSize/2, 0] + + -- Scale ? + if TransitionScale[transitionZone] == true then + ( + copyMt = scale copyMt [-1,1,1] true + ) + + -- Rotate + if TransitionRot[transitionZone] != 0 then + ( + copyMt = rotateZ copyMt (90*TransitionRot[transitionZone]) + ) + + -- Translation + copyMt = translate copyMt [cellSize/2,cellSize/2,0] + + -- Compose + return (mt * copyMt) +) + +-- Export instance groups from the current loaded zone +fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSize = +( + -- 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 geometry do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") and ( (igName == "") or (ig == igName) ) ) then + ( + -- Transition ? + if ( ig == IgName) then + ( + -- Transform the object + node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize + ) + + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + for node in lights do + ( + ig = getIg node + + if ( (ig != undefined) and (ig != "") and ( (igName == "") or ( ig == igName) ) ) then + ( + -- Transition ? + if ( ig == IgName) then + ( + -- Transform the object + node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize + ) + + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + for node in helpers do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") and ( (igName == "") or (ig == igName) ) ) then + ( + -- Transition ? + if (ig == IgName) then + ( + -- Transform the object + node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize + ) + + -- Found ? + found = false + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + ) + ) + -- 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 + ( + if ( (igName == "") or (ig_array[ig] == IgName) ) then + ( + -- Output filename + output = (outputPath + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate output inputFile) == 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 helpers 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 "+inputFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ig "+ig_array[ig]+" in file "+inputFile) + tagThisFile = false + ) + ) + else + ( + nlerror ("SKIPPED ligo ig "+output) + tagThisFile = false + ) + ) + ) + ) +) + +------------------------------------------------------------------------------------------------------------------ +-- ENTRY POINT +-- *********** + +ligopath = getINISetting ((GetDir #plugcfg)+"\\nelligo.ini") "LigoConfig" "LigoPath" +if ligopath != "" then ligo_root_path = ligopath +ligopath = getINISetting ((GetDir #plugcfg)+"\\nelligo.ini") "LigoConfig" "LigoExportPath" +if ligopath != "" then ligo_export_path = ligopath + +MaxFilesList = getFiles (ligo_root_path + "*.max") + + +-- EXPORT ZONES + +try +( + -- Set the bank pathname + bank_filename = "bankFilename" + NelSetTileBank bank_filename + + cellSize = NeLLigoGetCellSize () + + for curFileName in MaxFilesList do + ( + -- Free memory and file handles + gc () + resetMAXFile #noprompt + + + tokenArray = filterString (getFilenameFile curFileName) "-" + if (tokenArray.count == 3) and (tokenArray[1] == "zonematerial") then + ( + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag curFileName) == true then + ( + -- Try to tag this file + tagThisFile = true + + resetMAXFile #noprompt + + nlerror ("Scanning file "+curFileName+" ...") + mergeMaxFile curFileName quiet:true + + -- Unhide category + unhidecategory() + + DeleteDebugMarkersFn () + selectAllPatch () + -- nlerror ("EXPORT "+ (getFilenameFile curFileName)) + + props = #( #("zone", (tokenArray[2] + "-" + tokenArray[3])), #("material", tokenArray[2]) ) + + if (selection as array).count > 1 then + ( + nlerror ("ERROR In file "+(getFilenameFile curFileName)+", multiple NelPatchMesh. Can't export."); + tagThisFile = false + ) + else + ( + if (selection as array).count == 0 then + ( + nlerror ("WARNING In file "+(getFilenameFile curFileName)+", no NelPatchMesh to export."); + ) + else + ( + addProperties $ props + + dstFileName = ligo_export_path + tokenArray[2] + "-" + tokenArray[3] + ".ligozone" + + -- Error catching + try + ( + -- export ligo zone + if (NeLLigoExportZone $ dstFileName props false false) then + ( + nlerror ("OK "+ (getFilenameFile curFileName)) + ) + else + ( + nlerror ("ERROR Error exporting ligo zone from file "+ (getFilenameFile curFileName)) + tagThisFile = false + ) + + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ligo zone "+curFileName) + tagThisFile = false + ) + + ) + ) + + -- export matching igs + try + ( + exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") "" 0 cellSize + ) + catch + ( + nlerror("couldn't export ig for " + curFileName) + tagThisFile = false + ) + + -- export collisions + try + ( + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) + + -- 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 + ) + ) + + resetMAXFile #noprompt + ) + else + ( + nlerror ("SKIPPED BY TAG ligozone "+ (getFilenameFile curFileName)) + ) + ) + ) + + -- EXPORT TRANSZONES + + for curFileName in MaxFilesList do + ( + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + tokenArray = filterString (getFilenameFile curFileName) "-" + if (tokenArray.count == 4) and (tokenArray[1] == "zonetransition") then + ( + HaveToExport = #() + for zone = 1 to 9 do + ( + filename = tokenArray[2] + "-" + tokenArray[3] + "-" + tokenArray[4] + "-" + ((zone-1) as string) + filename = ligo_export_path + "zoneLigos\\" + filename + ".ligozone" + + if (nelTestFileDate filename curFileName) == true then + ( + append HaveToExport true + ) + else + ( + append HaveToExport false + ) + ) + + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag curFileName) == true then + ( + -- Try to tag this file + tagThisFile = true + + resetMAXFile #noprompt + + nlerror ("Scanning file "+curFileName+" ...") + mergeMaxFile curFileName quiet:true + + -- Unhide category + unhidecategory() + + DeleteDebugMarkersFn () + selectAllPatch () + -- nlerror ("EXPORT "+ (getFilenameFile curFileName)) + + -- Array of selection + nodeArray = #() + if $ == $selection then + ( + nodeArray = $selection as array + ) + else + ( + append nodeArray $ + ) + + -- Ok flag + ok = true + findOne = false + + -- Cell Size + if cellSize != undefined then + ( + -- Array of transitions zones + transitionZone = #() + for zone = 1 to 9 do + append transitionZone undefined + for zone = 1 to nodeArray.count do + ( + -- Find one + findOne = true; + + -- Get the zone coordinates + x = #() + y = #() + ok = getTransitionZoneCoordinates nodeArray[zone] x y + + -- No error ? + if ok == true then + ( + -- Transition number + id = TransitionIds[y[1]+1][x[1]+1] + + -- Store it + if (id == undefined) then + ( + nlerror ("ERROR A zone is not at the right position in "+ (getFilenameFile curFileName)) + tagThisFile = false + ok = false + ) + else + ( + transitionZone[id] = nodeArray[zone] + ) + ) + ) + + -- Continue ? + if (ok == true) and (findOne == true) then + ( + -- For each zone selected + for zone = 1 to 9 do + ( + -- Zone name + zoneBaseName = tokenArray[2] + "-" + tokenArray[3] + "-" + tokenArray[4] + "-" + ((zone-1) as string) + + -- Get the destination filename for export + filename = ligo_export_path + zoneBaseName + ".ligozone" + + if (HaveToExport[zone] == true) then + ( + -- Defined ? + if (transitionZone[zone] != undefined) then + ( + -- Make an array of properties + props = #( #("zone", zoneBaseName), #("transname", (tokenArray[2]+"-"+tokenArray[3]) ), #("transtype", TransitionType[zone] ), #("transtype", TransitionType[zone] ), #("transnum", (TransitionNumBis[zone] as string) ) ) + + -- Add the properties + addProperties transitionZone[zone] props + + -- Transform the zone + c = instance transitionZone[zone] + + -- Change the name + c.name = "[NELLIGO] tmp export" + + -- The matrix + mt = buildTransitionMatrix transitionZone[zone].transform zone cellSize + + -- Scale ? + if TransitionScale[zone] == true then + ( + setappdata c ligo_scale_app "1" + ) + + -- Rotate + if TransitionRot[zone] != 0 then + ( + setappdata c ligo_rotate_app (TransitionRot[zone] as string) + ) + + -- Transform the node + c.transform = mt + + -- Export the zone + + -- Error catching + try + ( + -- nlerror ("EXPORT "+ (getFilenameFile filename)) + if (NeLLigoExportZone c filename props false false) then + ( + nlerror ("OK "+ (getFilenameFile filename)) + ) + else + ( + nlerror ("ERROR Error exporting ligo zone from file "+ (getFilenameFile filename)) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ligo zone "+curFileName) + tagThisFile = false + ) + + -- Delete + delete c + ) + ) + else + ( + nlerror ("SKIPPED ligozone transition "+ (getFilenameFile filename)) + ) + + -- export igs + try + ( + exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") (lowercase (zoneBaseName)) zone cellSize + ) + catch + ( + nlerror("couldn't export ig for " + curFileName) + tagThisFile = false + ) + + -- export collisions + try + ( + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) + ) + ) + + -- 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 + ) + ) + ) + + resetMAXFile #noprompt + ) + else + ( + nlerror ("SKIPPED BY TAG transition "+ (getFilenameFile curFileName)) + ) + ) + ) + + -- EXPORT SPECIAL ZONES + + for curFileName in MaxFilesList do + ( + -- Free memory and file handles + gc () + resetMAXFile #noprompt + + tokenArray = filterString (getFilenameFile curFileName) "-" + if (tokenArray.count == 2) and (tokenArray[1] == "zonespecial") then + ( + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag curFileName) == true then + ( + -- Try to tag this file + tagThisFile = true + + resetMAXFile #noprompt + + nlerror ("Scanning file "+curFileName+" ...") + mergeMaxFile curFileName quiet:true + + -- Unhide category + unhidecategory() + + DeleteDebugMarkersFn () + selectAllPatch () + -- nlerror ("EXPORT "+ (getFilenameFile curFileName)) + + props = #( #("zone", tokenArray[2]), #("material", "special") ) + + if (selection as array).count > 1 then + ( + nlerror ("ERROR In file "+(getFilenameFile curFileName)+", multiple NelPatchMesh. Can't export."); + tagThisFile = false + ) + else + ( + if (selection as array).count == 0 then + ( + nlerror ("WARNING In file "+(getFilenameFile curFileName)+", no NelPatchMesh to export."); + ) + else + ( + addProperties $ props + + dstFileName = ligo_export_path + tokenArray[2] + ".ligozone" + + -- Error catching + try + ( + if (NeLLigoExportZone $ dstFileName props false false) then + ( + nlerror ("OK "+ (getFilenameFile curFileName)) + ) + else + ( + nlerror ("ERROR Error exporting ligo zone from file "+ (getFilenameFile curFileName)) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ligo zone "+curFileName) + tagThisFile = false + ) + ) + ) + + -- export matching igs + try + ( + exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") "" 0 cellSize + ) + catch + ( + nlerror("couldn't export ig for " + curFileName) + tagThisFile = false + ) + + -- export collisions + try + ( + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) + + -- 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 + ) + ) + + resetMAXFile #noprompt + ) + else + ( + nlerror ("SKIPPED BY TAG ligozone special "+ (getFilenameFile curFileName)) + ) + ) + ) +) +catch +( + -- Error + nlerror ("ERROR fatal error exporting ligo zone in folder"+ligo_root_path) + tagThisFile = false +) + + + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/map/0_setup.py b/code/nel/tools/build_gamedata/processes/map/0_setup.py new file mode 100644 index 000000000..a1e6dc63f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/0_setup.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup map +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup map +# +# 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") +sys.path.append("../../configuration/project") +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 map") +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 MapSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in MapUncompressedSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + MapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + MapPanoplyBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + MapClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/map/1_export.py b/code/nel/tools/build_gamedata/processes/map/1_export.py new file mode 100644 index 000000000..e8c3004c9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export map +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export map +# +# 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") +sys.path.append("../../configuration/project") +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 map") +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/processes/map/2_build.py b/code/nel/tools/build_gamedata/processes/map/2_build.py new file mode 100644 index 000000000..275cc1303 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/2_build.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build map +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build map +# +# 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") +sys.path.append("../../configuration/project") +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 map") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +PanoplyMaker = findTool(log, ToolDirectories, PanoplyMakerTool, ToolSuffix) +HlsBankMaker = findTool(log, ToolDirectories, HlsBankMakerTool, ToolSuffix) +printLog(log, "") + +# For each map directory +printLog(log, ">>> Build map compressed: compress tga and png to dds <<<") +if TgaToDds == "": + toolLogFail(log, TgaToDdsTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + MapBuildDirectory) + for dir in MapSourceDirectories: + sourcePath = DatabaseDirectory + "/" + dir + mkPath(log, sourcePath) + destPath = ExportBuildDirectory + "/" + MapBuildDirectory + mkPath(log, destPath) + files = findFiles(log, sourcePath, "", ".tga") + for file in files: + sourceFile = sourcePath + "/" + file + destFile = destPath + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-m", "-r" + str(ReduceBitmapFactor) ]) + files = findFiles(log, sourcePath, "", ".png") + for file in files: + sourceFile = sourcePath + "/" + file + destFile = destPath + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-m", "-r" + str(ReduceBitmapFactor) ]) +printLog(log, "") + +printLog(log, ">>> Build map uncompressed: copy tga, png, dds <<<") +for dir in MapSourceDirectories: + sourcePath = DatabaseDirectory + "/" + dir + mkPath(log, sourcePath) + destPath = ExportBuildDirectory + "/" + MapBuildDirectory + mkPath(log, destPath) + copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".dds") + copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".png") + copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".tga") + +printLog(log, ">>> Build panoply <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, ">>> Build panoply dds <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, ">>> Build hls map <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/map/3_install.py b/code/nel/tools/build_gamedata/processes/map/3_install.py new file mode 100644 index 000000000..f69df3db2 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/3_install.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install map +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install map +# +# 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") +sys.path.append("../../configuration/project") +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 map") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + MapClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install map <<<") +sourcePath = ExportBuildDirectory + "/" + MapBuildDirectory +mkPath(log, sourcePath) +copyFilesExtNoTreeIfNeeded(log, sourcePath, clientPath, ".dds") +copyFilesExtNoTreeIfNeeded(log, sourcePath, clientPath, ".png") +copyFilesExtNoTreeIfNeeded(log, sourcePath, clientPath, ".tga") + +printLog(log, ">>> Install map panoply <<<") +mkPath(log, ExportBuildDirectory + "/" + MapPanoplyBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + MapPanoplyBuildDirectory, clientPath, ".dds") + +printLog(log, ">>> Install map hlsbank <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py new file mode 100644 index 000000000..36417e483 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup rbank +# +# 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") +sys.path.append("../../configuration/project") +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 rbank") +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 <<<") +mkPath(log, LeveldesignWorldDirectory) +#for dir in rbankSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +#for dir in rbankDxtcSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +#for dir in rbankFullscreenSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +#for dir in rbank3DSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) +#mkPath(log, ExportBuildDirectory + "/" + rbankExportDirectory) +#mkPath(log, ExportBuildDirectory + "/" + rbankDxtcExportDirectory) +#mkPath(log, ExportBuildDirectory + "/" + rbankFullscreenExportDirectory) +#mkPath(log, ExportBuildDirectory + "/" + rbank3DExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +for dir in RbankIgPaths: + mkPath(log, ExportBuildDirectory + "/" + dir) +for dir in RbankShapePaths: + mkPath(log, ExportBuildDirectory + "/" + dir) +mkPath(log, ExportBuildDirectory + "/" + RbankBboxBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgVillageBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankTessellationBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankSmoothBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankRawBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankPreprocBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankMeshBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + PacsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/1_export.py b/code/nel/tools/build_gamedata/processes/rbank/1_export.py new file mode 100644 index 000000000..59543c728 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/1_export.py @@ -0,0 +1,98 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export rbank +# +# 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") +sys.path.append("../../configuration/project") +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 * + +# ################### result = subprocess.Popen([ dfdsklfjslk ], stdout = PIPE).communicate()[0] ###################################### + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export rbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +printLog(log, "") + +# For each rbank directory +printLog(log, ">>> Export rbank test 1 <<<") +#mkPath(log, ExportBuildDirectory + "/" + rbankExportDirectory) +#for dir in rbankSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# niouname = dir.replace("/", "_") +# newpath = ExportBuildDirectory + "/" + rbankExportDirectory + "/" + niouname +# mkPath(log, newpath) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") +printLog(log, "") + +# For each rbank directory to compress in one DXTC +printLog(log, ">>> Export rbank test 2 <<<") +#mkPath(log, ExportBuildDirectory + "/" + rbankDxtcExportDirectory) +#for dir in rbankDxtcSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + rbankDxtcExportDirectory, ".tga") +printLog(log, "") + +# For each rbank fullscreen directory compress independently all in dds +printLog(log, ">>> Export rbank test 3 <<<") +#if TgaToDds == "": +# toolLogFail(log, TgaToDdsTool, ToolSuffix) +#else: +# mkPath(log, ExportBuildDirectory + "/" + rbankFullscreenExportDirectory) +# for dir in rbankFullscreenSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".tga") +# for file in files: +# sourceFile = DatabaseDirectory + "/" + dir + "/" + file +# destFile = ExportBuildDirectory + "/" + rbankFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" +# if needUpdateLogRemoveDest(log, sourceFile, destFile): +# subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) +printLog(log, "") + +# For each rbank 3d directory +printLog(log, ">>> Export rbank test 4 <<<") +#mkPath(log, ExportBuildDirectory + "/" + rbank3DExportDirectory) +#for dir in rbank3DSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + rbank3DExportDirectory, ".tga") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/2_build.py b/code/nel/tools/build_gamedata/processes/rbank/2_build.py new file mode 100644 index 000000000..42a86eb8c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/2_build.py @@ -0,0 +1,248 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build rbank +# +# 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") +sys.path.append("../../configuration/project") +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 rbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildIgBoxes = findTool(log, ToolDirectories, BuildIgBoxesTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildRbank = findTool(log, ToolDirectories, BuildRbankTool, ToolSuffix) +GetNeighbors = findTool(log, ToolDirectories, GetNeighborsTool, ToolSuffix) +BuildIndoorRbank = findTool(log, ToolDirectories, BuildIndoorRbankTool, ToolSuffix) +# AiBuildWmap = findTool(log, ToolDirectories, AiBuildWmapTool, ToolSuffix) +printLog(log, "") + +# Build rbank bbox +printLog(log, ">>> Build rbank bbox <<<") +if BuildIgBoxes == "": + toolLogFail(log, BuildIgBoxesTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + RbankBboxBuildDirectory) + cf = open("build_ig_boxes.cfg", "w") + cf.write("\n") + cf.write("Pathes = {\n") + for dir in RbankIgPaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") + for dir in RbankShapePaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("IGs = {\n") + for dir in RbankIgPaths: + files = findFiles(log, ExportBuildDirectory + "/" + dir, "", ".ig") + for file in files: + cf.write("\t\"" + os.path.basename(file)[0:-len(".ig")] + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("Output = \"" + ExportBuildDirectory + "/" + RbankBboxBuildDirectory + "/temp.bbox\";\n") + cf.write("\n") + cf.close() + subprocess.call([ BuildIgBoxes ]) + os.remove("build_ig_boxes.cfg") +printLog(log, "") + +printLog(log, ">>> Build rbank build config <<<") +cf = open("build_rbank.cfg", "w") +cf.write("\n") +cf.write("// Rbank settings\n") +cf.write("\n") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +cf.write("ZonePath = \"" + ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/\";\n") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) +cf.write("BanksPath = \"" + ExportBuildDirectory + "/" + SmallbankExportDirectory + "/\";\n") +cf.write("Bank = \"" + ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + RbankBankName + ".smallbank\";\n") +cf.write("ZoneExt = \".zonew\";\n") +cf.write("ZoneNHExt = \".zonenhw\";\n") +cf.write("IGBoxes = \"" + ExportBuildDirectory + "/" + RbankBboxBuildDirectory + "/temp.bbox\";\n") +mkPath(log, LeveldesignWorldDirectory) +cf.write("LevelDesignWorldPath = \"" + LeveldesignWorldDirectory + "\";\n") +mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory) +cf.write("IgLandPath = \"" + ExportBuildDirectory + "/" + IgLandBuildDirectory + "\";\n") +mkPath(log, ExportBuildDirectory + "/" + IgVillageBuildDirectory) +cf.write("IgVillagePath = \"" + ExportBuildDirectory + "/" + IgVillageBuildDirectory + "\";\n") +cf.write("\n") +mkPath(log, ExportBuildDirectory + "/" + RbankTessellationBuildDirectory) +cf.write("TessellationPath = \"" + ExportBuildDirectory + "/" + RbankTessellationBuildDirectory + "/\";\n") +cf.write("TessellateLevel = " + str(BuildQuality) + ";\n") # BuildQuality +cf.write("\n") +cf.write("WaterThreshold = 1.0;\n") +cf.write("\n") +cf.write("OutputRootPath = \"" + ExportBuildDirectory + "/\";\n") +mkPath(log, ExportBuildDirectory + "/" + RbankSmoothBuildDirectory) +cf.write("SmoothDirectory = \"" + RbankSmoothBuildDirectory + "/\";\n") +mkPath(log, ExportBuildDirectory + "/" + RbankRawBuildDirectory) +cf.write("RawDirectory = \"" + RbankRawBuildDirectory + "/\";\n") +cf.write("\n") +cf.write("ReduceSurfaces = " + str(RbankReduceSurfaces) + ";\n") +cf.write("SmoothBorders = " + str(RbankSmoothBorders) + ";\n") +cf.write("\n") +cf.write("ComputeElevation = " + str(RbankComputeElevation) + ";\n") +cf.write("ComputeLevels = " + str(RbankComputeLevels) + ";\n") +cf.write("\n") +cf.write("LinkElements = " + str(RbankLinkElements) + ";\n") +cf.write("\n") +cf.write("CutEdges = " + str(RbankCutEdges) + ";\n") +cf.write("\n") +cf.write("UseZoneSquare = " + str(RbankUseZoneSquare) + ";\n") +cf.write("\n") +cf.write("// The whole landscape\n") +cf.write("ZoneUL = \"" + RbankZoneUl + "\";\n") +cf.write("ZoneDR = \"" + RbankZoneDr + "\";\n") +cf.write("\n") +mkPath(log, ExportBuildDirectory + "/" + RbankPreprocBuildDirectory) +cf.write("PreprocessDirectory = \"" + ExportBuildDirectory + "/" + RbankPreprocBuildDirectory + "/\";\n") +cf.write("\n") +cf.write("// The global retriever processing settings\n") +cf.write("GlobalRetriever = \"temp.gr\";\n") +cf.write("RetrieverBank = \"temp.rbank\";\n") +cf.write("\n") +cf.write("GlobalUL = \"" + RbankZoneUl + "\";\n") +cf.write("GlobalDR = \"" + RbankZoneDr + "\";\n") +cf.write("\n") +cf.write("// Which kind of stuff to do\n") +cf.write("TessellateZones = 0;\n") +cf.write("MoulineZones = 0;\n") +cf.write("ProcessRetrievers = 0;\n") +cf.write("ProcessGlobal = 0;\n") +cf.write("\n") +cf.write("Zones = {\n") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +files = findFiles(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory, "", ".zonew") +for file in files: + cf.write("\t\"" + os.path.basename(file) + "\", \n") +cf.write("};\n") +cf.write("\n") +cf.write("Pathes = {\n") +for dir in RbankIgPaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") +for dir in RbankShapePaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") +cf.write("};\n") +cf.write("\n") +cf.close() +printLog(log, "") + +printLog(log, ">>> Build rbank check prims <<<") +if BuildRbank == "": + toolLogFail(log, BuildRbankTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + subprocess.call([ ExecTimeout, str(RbankBuildTesselTimeout), BuildRbank, "-C", "-p", "-g" ]) +printLog(log, "") + +printLog(log, ">>> Build rbank process all passes <<<") +if BuildRbank == "": + toolLogFail(log, BuildRbankTool, ToolSuffix) +if GetNeighbors == "": + toolLogFail(log, GetNeighborsTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + zonefiles = findFiles(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory, "", ".zonew") + for zonefile in zonefiles: + zone = os.path.basename(zonefile)[0:-len(".zonew")] + lr1 = ExportBuildDirectory + "/" + RbankSmoothBuildDirectory + "/" + zone + ".lr" + nearzones = subprocess.Popen([ GetNeighbors, zone ], stdout = subprocess.PIPE).communicate()[0].strip().split(" ") + printLog(log, "ZONE " + zone + ": " + str(nearzones)) + zone_to_build = 0 + for nearzone in nearzones: + sourcePath = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + nearzone + ".zonew" + if (os.path.isfile(sourcePath)): + if (needUpdate(log, sourcePath, lr1)): + zone_to_build = 1 + sourcePath = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + zone + ".zonew" + if zone_to_build: + printLog(log, sourcePath + " -> " + lr1) + subprocess.call([ ExecTimeout, str(RbankBuildTesselTimeout), BuildRbank, "-c", "-P", "-g", os.path.basename(zonefile) ]) + else: + printLog(log, "SKIP " + lr1) +printLog(log, "") + +printLog(log, ">>> Build rbank process global <<<") # TODO: Check if the LR changed? +if BuildRbank == "": + toolLogFail(log, BuildRbankTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + subprocess.call([ ExecTimeout, str(RbankBuildProcglobalTimeout), BuildRbank, "-c", "-P", "-G" ]) +printLog(log, "") +os.remove("build_rbank.cfg") + +printLog(log, ">>> Build rbank indoor <<<") +if BuildIndoorRbank == "": + toolLogFail(log, BuildIndoorRbankTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + cf = open("build_indoor_rbank.cfg", "w") + cf.write("\n") + mkPath(log, ExportBuildDirectory + "/" + RbankMeshBuildDirectory) + cf.write("MeshPath = \"" + ExportBuildDirectory + "/" + RbankMeshBuildDirectory + "/\";\n") + cf.write("Meshes = { };\n") # *********************** TODO export CMB ******************************************** + # mkPath(log, ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory) + # cf.write("OutputPath = \"" + ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory + "/\";\n") + mkPath(log, ExportBuildDirectory + "/" + RbankOutputBuildDirectory) + cf.write("OutputPath = \"" + ExportBuildDirectory + "/" + RbankOutputBuildDirectory + "/\";\n") + cf.write("OutputPrefix = \"unused\";\n") + cf.write("Merge = 1;\n") + mkPath(log, ExportBuildDirectory + "/" + RbankSmoothBuildDirectory) + cf.write("MergePath = \"" + ExportBuildDirectory + "/" + RbankSmoothBuildDirectory + "/\";\n") + cf.write("MergeInputPrefix = \"temp\";\n") + # cf.write("MergeOutputPrefix = \"tempMerged\";\n") + cf.write("MergeOutputPrefix = \"" + RbankRbankName + "\";\n") + cf.write("AddToRetriever = 1;\n") + cf.write("\n") + cf.close() + subprocess.call([ ExecTimeout, str(RbankBuildIndoorTimeout), BuildIndoorRbank ]) + os.remove("build_indoor_rbank.cfg") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/3_install.py b/code/nel/tools/build_gamedata/processes/rbank/3_install.py new file mode 100644 index 000000000..c929820cd --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/3_install.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install rbank +# +# 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") +sys.path.append("../../configuration/project") +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 rbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install rbank <<<") +clientPath = ClientDataDirectory + "/" + PacsClientDirectory +mkPath(log, clientPath) +srcPath = ExportBuildDirectory + "/" + RbankOutputBuildDirectory +mkPath(log, srcPath) +copyFilesNoTreeIfNeeded(log, srcPath, clientPath) +#clientPath = ClientDataDirectory + "/" + PacsClientDirectory +#mkPath(log, clientPath) +#srcPath = ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory +#mkPath(log, srcPath) +#copyFileIfNeeded(log, srcPath + "/tempMerged.rbank", clientPath + "/" + RbankRbankName + ".rbank") +#copyFileIfNeeded(log, srcPath + "/tempMerged.gr", clientPath + "/" + RbankRbankName + ".gr") +#for file in findFiles(log, srcPath, "", ".lr"): +# copyFileIfNeeded(log, srcPath + "/" + file, clientPath + "/" + file.replace("tempMerged", RbankRbankName)) +# mkPath(log, ExportBuildDirectory + "/" + rbankBuildDirectory) +# copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + rbankBuildDirectory, clientPath) +#copyFileIfNeeded +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/0_setup.py b/code/nel/tools/build_gamedata/processes/shape/0_setup.py new file mode 100644 index 000000000..d3674c746 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup shape +# +# 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") +sys.path.append("../../configuration/project") +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 shape") +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 ShapeSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in MapSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ShapeClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py new file mode 100644 index 000000000..362af5ed8 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -0,0 +1,136 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export shape +# +# 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") +sys.path.append("../../configuration/project") +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 shape") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Override config values for draft mode +if BuildQuality == 0: + ShapeExportOptExportLighting = "false" + ShapeExportOptShadow = "false" + ShapeExportOptLightingLimit = 0 + ShapeExportOptLumelSize = "0.25" + ShapeExportOptOversampling = 1 + +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + # ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + printLog(log, "") + + # Export shape 3dsmax + printLog(log, ">>> Export shape 3dsmax <<<") + + # Build paths + scriptSrc = "maxscript/shape_export.ms" + # scriptDst = MaxDirectory + "/scripts/shape_export.ms" + scriptDst = MaxUserDirectory + "/scripts/shape_export.ms" + logFile = ScriptDirectory + "/processes/shape/log.log" + outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory + mkPath(log, outDirTag) + outDirWithoutCoarse = ExportBuildDirectory + "/" + ShapeExportDirectory + mkPath(log, outDirWithoutCoarse) + outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory + mkPath(log, outDirWithCoarse) + outDirLightmap = ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory + mkPath(log, outDirLightmap) + outDirAnim = ExportBuildDirectory + "/" + ShapeAnimExportDirectory + mkPath(log, outDirAnim) + + tagList = findFiles(log, outDirTag, "", ".tag") + tagLen = len(tagList) + + # For each directoy + if os.path.isfile(scriptDst): + os.remove(scriptDst) + for dir in ShapeSourceDirectories: + tagDiff = 1 + shapeSourceDir = DatabaseDirectory + "/" + dir + mkPath(log, shapeSourceDir) + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("shape_source_directory", shapeSourceDir) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse) + newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse) + newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting) + newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow) + newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit)) + newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize) + newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling)) + newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog) + newline = newline.replace("shape_lightmap_path", outDirLightmap) + newline = newline.replace("output_directory_anim", outDirAnim) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "shape_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) + + # Export clod 3dsmax + printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") + + # cat ../clodbank/maxscript/clod_export.ms + #| sed -e "s&shape_source_directory&$database_directory/$i&g" + #| sed -e "s&output_directory_clod&$build_gamedata_directory/processes/shape/clod&g" + #| sed -e "s&output_directory_tag&$build_gamedata_directory/processes/shape/tag&g" + # > $max_directory/scripts/clod_export.ms + + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/2_build.py b/code/nel/tools/build_gamedata/processes/shape/2_build.py new file mode 100644 index 000000000..10f52735f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -0,0 +1,118 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build shape +# +# 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") +sys.path.append("../../configuration/project") +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 shape") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildShadowSkin = findTool(log, ToolDirectories, BuildShadowSkinTool, ToolSuffix) +BuildClodtex = findTool(log, ToolDirectories, BuildClodtexTool, ToolSuffix) +LightmapOptimizer = findTool(log, ToolDirectories, LightmapOptimizerTool, ToolSuffix) +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +BuildCoarseMesh = findTool(log, ToolDirectories, BuildCoarseMeshTool, ToolSuffix) + +if DoBuildShadowSkin: + printLog(log, ">>> BuildShadowSkin <<<") + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") + +if ClodConfigFile != "": + printLog(log, ">>> BuildClodtex <<<") + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") + +printLog(log, ">>> LightmapOptimizer <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, ">>> TgaToDds <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +if 1: # todo: CoarseMeshTextureNames length > 0 ... + printLog(log, ">>> Build coarse meshes <<<") + shapeWithCoarseMesh = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory + mkPath(log, shapeWithCoarseMesh) + shapeWithCoarseMeshBuilded = ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory + mkPath(log, shapeWithCoarseMeshBuilded) + cf = open("config_generated.cfg", "w") + cf.write("texture_mul_size = " + TextureMulSizeValue + ";\n") + cf.write("\n") + cf.write("search_path = \n") + cf.write("{\n") + cf.write("\t\"" + shapeWithCoarseMesh + "\", \n") + for dir in MapSourceDirectories: + cf.write("\t\"" + DatabaseDirectory + "/" + dir + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("list_mesh = \n") + cf.write("{\n") + # For each shape with coarse mesh + files = findFiles(log, shapeWithCoarseMesh, "", ".shape") + for file in files: + sourceFile = shapeWithCoarseMesh + "/" + file + if os.path.isfile(sourceFile): + destFile = shapeWithCoarseMeshBuilded + "/" + file + cf.write("\t\"" + file + "\", \"" + destFile + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("output_textures = \n") + cf.write("{\n") + # For each shape with coarse mesh + for tn in CoarseMeshTextureNames: + cf.write("\t\"" + shapeWithCoarseMesh + "/" + tn + ".tga\", \n") + cf.write("};\n") + cf.close() + subprocess.call([ BuildCoarseMesh, "config_generated.cfg" ]) + os.remove("config_generated.cfg") + for tn in CoarseMeshTextureNames: + subprocess.call([ TgaToDds, shapeWithCoarseMesh + "/" + tn + ".tga", "-o", shapeWithCoarseMeshBuilded + "/" + tn + ".dds", "-a", "5" ]) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/3_install.py b/code/nel/tools/build_gamedata/processes/shape/3_install.py new file mode 100644 index 000000000..de352fcab --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/3_install.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install shape +# +# 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") +sys.path.append("../../configuration/project") +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 shape") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + ShapeClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install shape <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeExportDirectory, clientPath, ".shape") +mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".shape") +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".dds") + +#if test "$lightmap_install_directory"; then +# mkdir $client_directory/$lightmap_install_directory 2>> log.log 2> /dev/null +# cp -u -p -R lightmap_16_bits/. $client_directory/$lightmap_install_directory 2>> log.log +#fi + +mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory, clientPath, ".anim") + +# ls anim | grep ".anim" >> $client_directory/auto_animations_list.txt + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms new file mode 100644 index 000000000..f8af9e878 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -0,0 +1,511 @@ +-- 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_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 +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 +NEL3D_APPDATA_AUTOMATIC_ANIMATION = 1423062617 + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +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 +) + +-- 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 +) + +-- Must export this node ? +fn isToBeExported node = +( + if (isAccelerator node) == true then + return false + + 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 + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + return true +) + +-- Must export this node ? +fn isAnimToBeExported node = +( + automaticAnimation = getappdata node NEL3D_APPDATA_AUTOMATIC_ANIMATION + if (automaticAnimation == undefined) then + return false + if (automaticAnimation == "0") then + return false + + if (isAccelerator node) == true 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 + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + return true +) + +-- Cast shadow ? +fn isCastShadow node = +( + if (classof node == nel_ps) then + return false + + if (isAccelerator node) == true then + ( + return false + ) + else + ( + return true + ) +) + +-- List the lod +lod_array = #() + +-- is a lod ? +fn isLod node = +( + for i = 1 to lod_array.count do + ( + if (lod_array[i] == node) then + return true + ) + return false +) + +-- have a coarse mesh ? +fn haveCoarseMesh node = +( + -- Get lod count + nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT + if (nodeCount != undefined) then + ( + -- For each lod + nodeCountNum = nodeCount as Integer + for lod = 1 to nodeCountNum do + ( + -- Get the lod + lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) + + -- Exist ? + if (lod != undefined) then + ( + -- Select a node + nd = execute ("$'"+lod+"'") + + -- Node exist ? + if (nd != undefined) then + ( + -- Is a coarse mesh ? + if (getappdata nd NEL3D_APPDATA_LOD_COARSE_MESH == "1") then + return true + ) + ) + ) + ) + return false +) + +fn goShapeExport = +( + try + ( + -- Get files in the shape_source_directory + files = getFiles "shape_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + 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 + ( + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] quiet:true == true then + ( + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Add the lod + for node in geometry do + ( + -- Get lod count + nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT + if (nodeCount != undefined) then + ( + -- For each lod + nodeCountNum = nodeCount as Integer + for lod = 1 to nodeCountNum do + ( + -- Get the lod + lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) + + -- Exist ? + if (lod != undefined) then + ( + -- Select a node + try + ( + nd = execute ("$'"+lod+"'") + ) + catch + ( + nlerror ("Error in Execute $'"+lod+"' from node "+node.name) + nd = undefined + ) + + -- Node exist ? + if (nd != undefined) then + ( + append lod_array nd + ) + ) + ) + ) + ) + + -- Select objects for shadows + for node in geometry do + ( + if (node.parent == undefined) then + ( + -- Cast shadow ? + if (isCastShadow node == true) then + ( + -- Select this node + selectmore node + ) + ) + ) + + -- Tag this file ? + tagThisFile = true + + -- Array of node to export + array_node = #() + + -- Add geometry + for node in geometry do + append array_node node + + -- Add shapes + for node in shapes do + append array_node node + + -- For each node + for node in array_node 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 + ( + -- Not a lod ? + if ((isLod node) == false) then + ( + -- Output directory + if (haveCoarseMesh node) == true then + output = ("output_directory_with_coarse_mesh/"+(node.name)+".shape") + else + output = ("output_directory_without_coarse_mesh/"+(node.name)+".shape") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + try + ( + -- Export the shape + if (NelExportShapeEx node output shape_export_opt_shadow shape_export_opt_export_lighting "shape_lightmap_path" shape_export_opt_lighting_limit shape_export_opt_lumel_size shape_export_opt_oversampling true false shape_export_opt_lightmap_log) == true then + ( + nlerror ("OK "+output) + exported = exported+1 + ) + else + ( + -- Error + nlerror ("ERROR exporting shape "+node.name+" in file "+files[i]) + tagThisFile = false + return 0 + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+files[i]) + tagThisFile = false + return 0 + ) + ) + else + ( + -- Error + nlerror ("SKIPPED "+output) + exported = exported+1 + ) + ) + ) + ) + ) + ) + + -- Export default animations + + for node in objects do + ( + -- Can export it ? + if (isAnimToBeExported node) == true then + ( + -- Anim output directory + output = ("output_directory_anim/"+(node.name)+".anim") + + -- Export the animation + if (NelExportAnimation #(node) output false) == false then + ( + nlerror ("ERROR exporting animation "+output) + return 0 + ) + else + ( + nlerror ("OK "+output) + ) + ) + ) + + -- 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 + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror ("WARNING no shape exported from the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting shape: can't open the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("SKIPPED BY TAG "+files[i]) + ) + + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape in file " + files[i]) + -- return 0 + ) + ) + ) + else + ( + nlerror ("WARNING no max file in folder shape_source_directory") + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape in folder shape_source_directory") + return 0 + ) +) + +goShapeExport() + +nlerror ("BYE") + +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py b/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py new file mode 100644 index 000000000..93b8d3d7c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup sheet_id +# +# 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") +sys.path.append("../../configuration/project") +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 sheet_id") +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 <<<") +mkPath(log, LeveldesignDirectory) +mkPath(log, LeveldesignDfnDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SheetIdClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py b/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py new file mode 100644 index 000000000..183664f26 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export sheet_id +# +# 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") +sys.path.append("../../configuration/project") +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 sheet_id") +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/processes/sheet_id/2_build.py b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py new file mode 100644 index 000000000..f2f210b99 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build sheet_id +# +# 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") +sys.path.append("../../configuration/project") +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 sheet_id") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +MakeSheetId = findTool(log, ToolDirectories, MakeSheetIdTool, ToolSuffix) +printLog(log, "") + +# For each sheet_id directory +printLog(log, ">>> Build sheet_id <<<") +if MakeSheetId == "": + toolLogFail(log, MakeSheetIdTool, ToolSuffix) +else: + mkPath(log, LeveldesignDirectory) + mkPath(log, LeveldesignDfnDirectory) + mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) + subprocess.call([ MakeSheetId, "-c" + ScriptDirectory + "/configuration/make_sheet_id.cfg", "-o" + ExportBuildDirectory + "/" + SheetIdBuildDirectory + "/" + "sheet_id.bin", LeveldesignDirectory ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py b/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py new file mode 100644 index 000000000..e79124c61 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install sheet_id +# +# 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") +sys.path.append("../../configuration/project") +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 sheet_id") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SheetIdClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install sheet_id <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory, clientPath, ".bin") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets/0_setup.py b/code/nel/tools/build_gamedata/processes/sheets/0_setup.py new file mode 100644 index 000000000..4151a89ee --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup sheets +# +# 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") +sys.path.append("../../configuration/project") +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 sheets") +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 <<<") +mkPath(log, LeveldesignDirectory) +mkPath(log, LeveldesignDfnDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + SheetsBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SheetsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets/1_export.py b/code/nel/tools/build_gamedata/processes/sheets/1_export.py new file mode 100644 index 000000000..22c067ae3 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export sheets +# +# 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") +sys.path.append("../../configuration/project") +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 sheets") +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/processes/sheets/2_build.py b/code/nel/tools/build_gamedata/processes/sheets/2_build.py new file mode 100644 index 000000000..8530d8604 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/2_build.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build sheets +# +# 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") +sys.path.append("../../configuration/project") +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 sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildSheets = findTool(log, ToolDirectories, BuildSheetsTool, ToolSuffix) +printLog(log, "") + +# For each sheets directory +printLog(log, ">>> Build sheets <<<") +if BuildSheets == "": + toolLogFail(log, BuildSheetsTool, ToolSuffix) +else: + mkPath(log, LeveldesignDirectory) + mkPath(log, LeveldesignDfnDirectory) + mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + SheetsBuildDirectory) + subprocess.call([ BuildSheets, LeveldesignDirectory, LeveldesignDfnDirectory, ExportBuildDirectory + "/" + SheetIdBuildDirectory, ExportBuildDirectory + "/" + SheetsBuildDirectory ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets/3_install.py b/code/nel/tools/build_gamedata/processes/sheets/3_install.py new file mode 100644 index 000000000..326af190a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install sheets +# +# 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") +sys.path.append("../../configuration/project") +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 sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SheetsClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install sheets <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetsBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SheetsBuildDirectory, clientPath, ".packed_sheets") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/0_setup.py b/code/nel/tools/build_gamedata/processes/skel/0_setup.py new file mode 100644 index 000000000..43de0b7ca --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup skel +# +# 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") +sys.path.append("../../configuration/project") +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 skel") +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 SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SkelClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/1_export.py b/code/nel/tools/build_gamedata/processes/skel/1_export.py new file mode 100644 index 000000000..643bfc556 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/1_export.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export skel +# +# 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") +sys.path.append("../../configuration/project") +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 skel") +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 skel directory +printLog(log, ">>> Export skel 3dsmax <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/2_build.py b/code/nel/tools/build_gamedata/processes/skel/2_build.py new file mode 100644 index 000000000..9557f3b29 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build skel +# +# 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") +sys.path.append("../../configuration/project") +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 skel") +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/processes/skel/3_install.py b/code/nel/tools/build_gamedata/processes/skel/3_install.py new file mode 100644 index 000000000..d96b7d5e0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install skel +# +# 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") +sys.path.append("../../configuration/project") +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 skel") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SkelClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install skel <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SkelExportDirectory, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py b/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py new file mode 100644 index 000000000..d68485a6d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup smallbank +# +# 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") +sys.path.append("../../configuration/project") +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 smallbank") +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 <<<") +mkPath(log, DatabaseDirectory + "/" + BankSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + BankClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/smallbank/1_export.py b/code/nel/tools/build_gamedata/processes/smallbank/1_export.py new file mode 100644 index 000000000..5598dab23 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/1_export.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export smallbank +# +# 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") +sys.path.append("../../configuration/project") +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 smallbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildSmallbank = findTool(log, ToolDirectories, BuildSmallbankTool, ToolSuffix) +printLog(log, "") + +# For each bank export smallbank +printLog(log, ">>> Export smallbank <<<") +if ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +elif BuildSmallbank == "": + toolLogFail(log, BuildSmallbankTool, ToolSuffix) +else: + mkPath(log, DatabaseDirectory + "/" + BankSourceDirectory) + mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + files = findFiles(log, DatabaseDirectory + "/" + BankSourceDirectory, "", ".bank") + for file in files: + sourceFile = DatabaseDirectory + "/" + BankSourceDirectory + "/" + file + if os.path.isfile(sourceFile): + destFile = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + file[0:-len(".bank")] + ".smallbank" + if (needUpdateLogRemoveDest(log, sourceFile, destFile)): + subprocess.call([ ExecTimeout, str(SmallbankBuildTimeout), BuildSmallbank, sourceFile, destFile, DatabaseDirectory + "/" + TileRootSourceDirectory + "/" ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/smallbank/2_build.py b/code/nel/tools/build_gamedata/processes/smallbank/2_build.py new file mode 100644 index 000000000..a158ada96 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build smallbank +# +# 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") +sys.path.append("../../configuration/project") +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 smallbank") +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/processes/smallbank/3_install.py b/code/nel/tools/build_gamedata/processes/smallbank/3_install.py new file mode 100644 index 000000000..84b30b47d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install smallbank +# +# 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") +sys.path.append("../../configuration/project") +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 smallbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + BankClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install smallbank <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SmallbankExportDirectory, clientPath, ".smallbank") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sound/0_setup.py b/code/nel/tools/build_gamedata/processes/sound/0_setup.py new file mode 100644 index 000000000..b9e467725 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/0_setup.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup sound +# +# 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") +sys.path.append("../../configuration/project") +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 sound") +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 <<<") +mkPath(log, LeveldesignDirectory) +mkPath(log, LeveldesignDfnDirectory) +mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SoundSheetsClientDirectory) +mkPath(log, ClientDataDirectory + "/" + SoundSamplebanksClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sound/1_export.py b/code/nel/tools/build_gamedata/processes/sound/1_export.py new file mode 100644 index 000000000..60193669e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export sound +# +# 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") +sys.path.append("../../configuration/project") +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 sound") +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/processes/sound/2_build.py b/code/nel/tools/build_gamedata/processes/sound/2_build.py new file mode 100644 index 000000000..95aa0e9e4 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/2_build.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build sound +# +# 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") +sys.path.append("../../configuration/project") +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 sound") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildSound = findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) +printLog(log, "") + +# For each sound directory +printLog(log, ">>> Build sound <<<") +if BuildSound == "": + toolLogFail(log, BuildSoundTool, ToolSuffix) +else: + mkPath(log, LeveldesignDirectory) + mkPath(log, LeveldesignDfnDirectory) + mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory) + mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) + subprocess.call([ BuildSound, LeveldesignDirectory, LeveldesignDfnDirectory, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory ]) + moveFilesExtNoTree(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, ".sample_bank") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sound/3_install.py b/code/nel/tools/build_gamedata/processes/sound/3_install.py new file mode 100644 index 000000000..c32415bd7 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/3_install.py @@ -0,0 +1,60 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install sound +# +# 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") +sys.path.append("../../configuration/project") +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 sound") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install sound packed_sheets <<<") +mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) +mkPath(log, ClientDataDirectory + "/" + SoundSheetsClientDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory, ClientDataDirectory + "/" + SoundSheetsClientDirectory, ".packed_sheets") + +printLog(log, ">>> Install sound samplebanks <<<") +mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) +mkPath(log, ClientDataDirectory + "/" + SoundSamplebanksClientDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, ClientDataDirectory + "/" + SoundSamplebanksClientDirectory, ".sample_bank") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/0_setup.py b/code/nel/tools/build_gamedata/processes/swt/0_setup.py new file mode 100644 index 000000000..6f67165f3 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup swt +# +# 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") +sys.path.append("../../configuration/project") +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 skeleton weigths") +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 SwtSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SwtClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/1_export.py b/code/nel/tools/build_gamedata/processes/swt/1_export.py new file mode 100644 index 000000000..cb5a5b162 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/1_export.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export swt +# +# 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") +sys.path.append("../../configuration/project") +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 skeleton weigths") +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 <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) +for dir in SwtSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/2_build.py b/code/nel/tools/build_gamedata/processes/swt/2_build.py new file mode 100644 index 000000000..c2b2e7d9c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build swt +# +# 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") +sys.path.append("../../configuration/project") +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 skeleton weigths") +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/processes/swt/3_install.py b/code/nel/tools/build_gamedata/processes/swt/3_install.py new file mode 100644 index 000000000..7d1f0c779 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install swt +# +# 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") +sys.path.append("../../configuration/project") +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 skeleton weigths") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SwtClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install skeleton weigths <<<") +mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SwtExportDirectory, clientPath) + +printLog(log, "") +log.close() + + +# end of file 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 new file mode 100644 index 000000000..98cdb0c30 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms @@ -0,0 +1,139 @@ +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +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 = +( + 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 + ) +) + +try +( + -- Get files in the swt_source_directory + files = getFiles "swt_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- Output file + output = ("output_directory/"+(getFilenameFile files[i])+".swt") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] == 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) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting skeleton weight: can't open the file "+files[i]) + ) + ) + else + ( + nlerror ("SKIPPED "+files[i]) + ) + ) + catch + ( + -- Error + nlerror ("ERROR error exporting skeleton weight in files " + files[i]) + ) + ) + ) + else + ( + nlerror ("WARNING no skeleton weight file in folder swt_source_directory") + ) +) +catch +( + -- Error + nlerror ("ERROR error exporting skeleton weight in folder swt_source_directory") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/tiles/0_setup.py b/code/nel/tools/build_gamedata/processes/tiles/0_setup.py new file mode 100644 index 000000000..a15122e91 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup tiles +# +# 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") +sys.path.append("../../configuration/project") +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 tiles") +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 TilesSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + TilesClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/tiles/1_export.py b/code/nel/tools/build_gamedata/processes/tiles/1_export.py new file mode 100644 index 000000000..d6b78b2f0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/1_export.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export tiles +# +# 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") +sys.path.append("../../configuration/project") +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 tiles") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +printLog(log, "") + +# For each tiles directory +printLog(log, ">>> Export tiles as DDS <<<") +if TgaToDds == "": + toolLogFail(log, TgaToDdsTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) + for dir in TilesSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".tga") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + TilesExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-a", "5", "-m" ]) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".png") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + TilesExportDirectory + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-a", "5", "-m" ]) + +#printLog(log, ">>> Copy PNG tiles <<<") +#mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) +#for dir in TilesSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + TilesExportDirectory, ".png") +#printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/tiles/2_build.py b/code/nel/tools/build_gamedata/processes/tiles/2_build.py new file mode 100644 index 000000000..c40803a2b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build tiles +# +# 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") +sys.path.append("../../configuration/project") +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 tiles") +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/processes/tiles/3_install.py b/code/nel/tools/build_gamedata/processes/tiles/3_install.py new file mode 100644 index 000000000..2a971b9f0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/3_install.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install tiles +# +# 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") +sys.path.append("../../configuration/project") +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 tiles") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install tiles <<<") +mkPath(log, ClientDataDirectory + "/" + TilesClientDirectory) +mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + TilesExportDirectory, ClientDataDirectory + "/" + TilesClientDirectory) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/0_setup.py b/code/nel/tools/build_gamedata/processes/veget/0_setup.py new file mode 100644 index 000000000..8a25227d6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup veget +# +# 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") +sys.path.append("../../configuration/project") +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 veget") +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 VegetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + VegetTagExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + VegetClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py new file mode 100644 index 000000000..44cd0b931 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -0,0 +1,91 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export veget +# +# 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") +sys.path.append("../../configuration/project") +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 veget") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +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) + for dir in VegetSourceDirectories: + vegetSourceDir = DatabaseDirectory + "/" + dir + mkPath(log, vegetSourceDir) + 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) + sDst.write(newline) + sSrc.close() + sDst.close() + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + os.remove(scriptDst) + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/2_build.py b/code/nel/tools/build_gamedata/processes/veget/2_build.py new file mode 100644 index 000000000..30ad86fc8 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build veget +# +# 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") +sys.path.append("../../configuration/project") +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 veget") +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/processes/veget/3_install.py b/code/nel/tools/build_gamedata/processes/veget/3_install.py new file mode 100644 index 000000000..fad4ea33b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install veget +# +# 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") +sys.path.append("../../configuration/project") +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 veget") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + VegetClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install veget <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + VegetExportDirectory, clientPath, ".veget") + +printLog(log, "") +log.close() + + +# end of file 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 new file mode 100644 index 000000000..404f6e2ed --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms @@ -0,0 +1,249 @@ +-- 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 + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +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 +) + +-- 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 +) + +try +( + -- Get files in the veget_source_directory + files = getFiles "veget_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + 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 + ( + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] 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]) + ) + + -- 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 + ) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting veget: can't open the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("SKIPPED BY TAG "+files[i]) + ) + ) + catch + ( + -- Error + nlerror ("ERROR error exporting veget in files " + files[i]) + ) + ) + ) + else + ( + nlerror ("WARNING no max file in folder veget_source_directory") + ) +) +catch +( + -- Error + nlerror ("ERROR fatal error exporting veget in folder veget_source_directory") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py b/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py new file mode 100644 index 000000000..bd8df545b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup vegetset +# +# 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") +sys.path.append("../../configuration/project") +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 vegetset") +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 VegetSetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetSetExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + VegetSetClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/vegetset/1_export.py b/code/nel/tools/build_gamedata/processes/vegetset/1_export.py new file mode 100644 index 000000000..63ea405ef --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/1_export.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export vegetset +# +# 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") +sys.path.append("../../configuration/project") +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 vegetset") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# For each vegetset directoy +printLog(log, ">>> Export vegetset <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetSetExportDirectory) +for dir in VegetSetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + VegetSetExportDirectory, ".vegetset") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/vegetset/2_build.py b/code/nel/tools/build_gamedata/processes/vegetset/2_build.py new file mode 100644 index 000000000..2bc216775 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build vegetset +# +# 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") +sys.path.append("../../configuration/project") +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 vegetset") +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/processes/vegetset/3_install.py b/code/nel/tools/build_gamedata/processes/vegetset/3_install.py new file mode 100644 index 000000000..6e5f5506a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install vegetset +# +# 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") +sys.path.append("../../configuration/project") +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 vegetset") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + VegetSetClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install vegetset <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetSetExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + VegetSetExportDirectory, clientPath, ".vegetset") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/0_setup.py b/code/nel/tools/build_gamedata/processes/zone/0_setup.py new file mode 100644 index 000000000..7ec4e5c5f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup zone +# +# 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") +sys.path.append("../../configuration/project") +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 zone") +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 <<<") +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ZoneClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/1_export.py b/code/nel/tools/build_gamedata/processes/zone/1_export.py new file mode 100644 index 000000000..564c47bb7 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/1_export.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export zone +# +# 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") +sys.path.append("../../configuration/project") +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 zone") +printLog(log, "-------") +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, "") + +printLog(log, ">>> Export zone ligo <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/2_build.py b/code/nel/tools/build_gamedata/processes/zone/2_build.py new file mode 100644 index 000000000..60f8d034f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/2_build.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build zone +# +# 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") +sys.path.append("../../configuration/project") +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 zone") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ZoneDependencies = findTool(log, ToolDirectories, ZoneDependenciesTool, ToolSuffix) +ZoneWelder = findTool(log, ToolDirectories, ZoneWelderTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +printLog(log, "") + +# We are in BEST mode +# TODO if (high quality) blahblahblah +printLog(log, ">>> Build zone dependencies <<<") +if ZoneDependencies == "": + toolLogFail(log, ZoneDependenciesTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") +printLog(log, "") + +# For each zone directory +printLog(log, ">>> Build zone weld <<<") +if ZoneWelder == "": + toolLogFail(log, ZoneWelderTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) + files = findFiles(log, ExportBuildDirectory + "/" + ZoneExportDirectory, "", ".zone") + for file in files: + sourceFile = ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + file + destFile = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + os.path.basename(file)[0:-len(".zone")] + ".zonew" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(ZoneBuildWeldTimeout), ZoneWelder, sourceFile, destFile ]) +printLog(log, "") + +# For each zone directory +printLog(log, ">>> Build zone weld no heightmap <<<") +if ZoneWelder == "": + toolLogFail(log, ZoneWelderTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) + files = findFiles(log, ExportBuildDirectory + "/" + ZoneExportDirectory, "", ".zonenh") + for file in files: + sourceFile = ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + file + destFile = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + os.path.basename(file)[0:-len(".zonenh")] + ".zonenhw" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(ZoneBuildWeldTimeout), ZoneWelder, sourceFile, destFile ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/3_install.py b/code/nel/tools/build_gamedata/processes/zone/3_install.py new file mode 100644 index 000000000..d305974c4 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/3_install.py @@ -0,0 +1,50 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install zone +# +# 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") +sys.path.append("../../configuration/project") +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 zone") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/todo_build_dependencies b/code/nel/tools/build_gamedata/processes/zone/todo_build_dependencies new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/zone/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/zone/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..0626bb784 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py @@ -0,0 +1,98 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup zone_light +# +# 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") +sys.path.append("../../configuration/project") +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 zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +mkPath(log, ScriptDirectory + "/configuration/project/generated") +zlp = open(ScriptDirectory + "/configuration/project/generated/zone_lighter.cfg", "w") +ps = open(ScriptDirectory + "/configuration/project/zone_lighter_base.cfg", "r") +for line in ps: + newline = line.replace("%ExportBuildDirectory%", ExportBuildDirectory) + newline = newline.replace("%SmallbankExportDirectory%", SmallbankExportDirectory) + newline = newline.replace("%FarbankBuildDirectory%", FarbankBuildDirectory) + newline = newline.replace("%EcosystemName%", EcosystemName) + newline = newline.replace("%EcosystemPath%", EcosystemPath) + newline = newline.replace("%BankTileBankName%", BankTileBankName) + newline = newline.replace("%IgLandBuildDirectory%", IgLandBuildDirectory) + newline = newline.replace("%IgVillageBuildDirectory%", IgVillageBuildDirectory) + newline = newline.replace("%RbankOutputBuildDirectory%", RbankOutputBuildDirectory) + newline = newline.replace("%RbankRbankName%", RbankRbankName) + newline = newline.replace("%BuildQuality%", str(BuildQuality)) + zlp.write(newline) +ps.close() +if (BuildQuality == 1): + ps = open(ScriptDirectory + "/configuration/project/zone_lighter_final.cfg", "r") +else: + ps = open(ScriptDirectory + "/configuration/project/zone_lighter_draft.cfg", "r") +for line in ps: + zlp.write(line) +zlp.close() +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in WaterMapSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ZoneClientDirectory) +mkPath(log, ClientDataDirectory + "/" + IgClientDirectory) +mkPath(log, ClientDataDirectory + "/" + WaterMapsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone_light/1_export.py b/code/nel/tools/build_gamedata/processes/zone_light/1_export.py new file mode 100644 index 000000000..50e1d6e36 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/1_export.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export zone_light +# +# 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") +sys.path.append("../../configuration/project") +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 zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +#TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +printLog(log, "") + +# For each zone_light directory +printLog(log, ">>> Export zone_light water maps <<<") +srcDir = ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirectory +mkPath(log, srcDir) +for dir in WaterMapSourceDirectories: + destDir = DatabaseDirectory + "/" + dir + mkPath(log, destDir) + copyFilesExtNoTreeIfNeeded(log, srcDir, destDir, ".tga") +#mkPath(log, ExportBuildDirectory + "/" + zone_lightExportDirectory) +#for dir in zone_lightSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# niouname = dir.replace("/", "_") +# newpath = ExportBuildDirectory + "/" + zone_lightExportDirectory + "/" + niouname +# mkPath(log, newpath) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") +printLog(log, "") + +# For each zone_light directory to compress in one DXTC +#printLog(log, ">>> Export zone_light dxtc <<<") +#mkPath(log, ExportBuildDirectory + "/" + zone_lightDxtcExportDirectory) +#for dir in zone_lightDxtcSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + zone_lightDxtcExportDirectory, ".tga") +#printLog(log, "") + +# For each zone_light fullscreen directory compress independently all in dds +#printLog(log, ">>> Export zone_light fullscreen <<<") +#if TgaToDds == "": +# toolLogFail(log, TgaToDdsTool, ToolSuffix) +#else: +# mkPath(log, ExportBuildDirectory + "/" + zone_lightFullscreenExportDirectory) +# for dir in zone_lightFullscreenSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".tga") +# for file in files: +# sourceFile = DatabaseDirectory + "/" + dir + "/" + file +# destFile = ExportBuildDirectory + "/" + zone_lightFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" +# if needUpdateLogRemoveDest(log, sourceFile, destFile): +# subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) +#printLog(log, "") + +# For each zone_light 3d directory +#printLog(log, ">>> Export zone_light 3d <<<") +#mkPath(log, ExportBuildDirectory + "/" + zone_light3DExportDirectory) +#for dir in zone_light3DSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + zone_light3DExportDirectory, ".tga") +#printLog(log, "") + +log.close() + + +# end of file 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 new file mode 100644 index 000000000..124e7cf4f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build zone_light +# +# 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") +sys.path.append("../../configuration/project") +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 zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +ZoneLighter = findTool(log, ToolDirectories, ZoneLighterTool, ToolSuffix) +ZoneIgLighter = findTool(log, ToolDirectories, ZoneIgLighterTool, ToolSuffix) +printLog(log, "") + +# For each zone_light directory +printLog(log, ">>> Build zone_light <<<") +if ZoneLighter == "": + toolLogFail(log, ZoneLighterTool, ToolSuffix) +elif ExecTimeout == "": + toolLogfail(log, ExecTimeoutTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory + mkPath(log, destDir) + dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + 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" + subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ScriptDirectory + "/configuration/project/generated/zone_lighter.cfg", dependFile ]) +printLog(log, "") + +# For each zone_light ig +printLog(log, ">>> Build zone_light ig <<<") +if ZoneIgLighter == "": + toolLogFail(log, ZoneIgLighterTool, ToolSuffix) +elif ExecTimeout == "": + toolLogfail(log, ExecTimeoutTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory + mkPath(log, srcDir) + igsrcDir = ExportBuildDirectory + "/" + IgLandBuildDirectory + mkPath(log, igsrcDir) + destDir = ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory + mkPath(log, destDir) + dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + mkPath(log, dependDir) + files = findFiles(log, srcDir, "", ".zonel") + for file in files: + igsrcFile = igsrcDir + os.path.basename(file)[0:-len(".zonel")] + ".ig" + destFile = destDir + "/" + os.path.basename(file)[0:-len(".zonel")] + ".ig" + if (os.path.isfile(igsrcFile)): + if (needUpdateLogRemoveDest(log, igsrcFile, destFile)): + srcFile = srcDir + "/" + file # ************************* TODO CHECK IF THIS REALLY WORKS ************************************* + dependFile = destDir + "/" + file[0:-len(".zonel")] + ".depend" + subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ScriptDirectory + "/configuration/project/generated/zone_lighter.cfg", dependFile ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone_light/3_install.py b/code/nel/tools/build_gamedata/processes/zone_light/3_install.py new file mode 100644 index 000000000..5027dd8bb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/3_install.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install zone_light +# +# 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") +sys.path.append("../../configuration/project") +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 zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install zone_light zones <<<") +srcDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + ZoneClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, ">>> Install zone_light water maps <<<") +srcDir = ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + WaterMapsClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, ">>> Install zone_light igs <<<") +srcDir = ExportBuildDirectory + "/" + IgLandBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + IgClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone_light/todo_patch_tile_water b/code/nel/tools/build_gamedata/processes/zone_light/todo_patch_tile_water new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/work_in_progress b/code/nel/tools/build_gamedata/work_in_progress new file mode 100644 index 000000000..e69de29bb diff --git a/code/ryzom/tools/build_gamedata/work_in_progress b/code/ryzom/tools/build_gamedata/work_in_progress new file mode 100644 index 000000000..e69de29bb diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py new file mode 100644 index 000000000..406cf358b --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-05-24 06:34GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# 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 . +# + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + + +# *** ECOSYSTEM AND CONTINENT NAMES *** +EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName +ContinentName = "newbieland" +ContinentPath = "continents/" + ContinentName + + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = "landscape/zones/" + EcosystemName + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = ContinentPath + "/zone" +WaterMapSourceDirectories = [ ] + +# Smallbank directories +SmallbankExportDirectory = EcosystemPath + "/smallbank" + +# Tiles directories +DisplaceExportDirectory = EcosystemPath + "/diplace" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Ligo directories +LigoZoneBuildDirectory = ContinentPath + "/ligo_zones" +LigoIgLandBuildDirectory = ContinentPath + "/ligo_ig_land" +LigoIgOtherBuildDirectory = ContinentPath + "/ligo_ig_other" + +# Zone directories +ZoneWeldBuildDirectory = ContinentPath + "/zone_weld" +ZoneLightWaterShapesLightedExportDirectory = ContinentPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = ContinentPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = ContinentPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = ContinentPath + "/zone_lighted_ig_land" #fixme + +# Farbank directories +FarbankBuildDirectory = EcosystemPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgVillageBuildDirectory = "_invalid" + +# Rbank directories +RbankCmbBuildDirectory = ContinentPath + "/rbank_cmb" + +# Rbank directories +RbankOutputBuildDirectory = ContinentPath + "/rbank_output" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Ig directory +IgClientDirectory = ContinentName + "_ig" + +# Zone directory +ZoneClientDirectory = ContinentName + "_zones" +WaterMapsClientDirectory = ContinentName + "_zones" + +# PACS directory +PacsClientDirectory = ContinentName + "_pacs" + +# PS directory +IgClientDirectory = ContinentName + "_ig" diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py new file mode 100644 index 000000000..cf211f60f --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-05-24 06:30GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# 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 += [ "ligo" ] # not fully implemented, works for this process (not yet), but does not export max files +ProcessToComplete += [ "zone" ] +#ProcessToComplete += [ "ig" ] # not implemented +ProcessToComplete += [ "zone_light" ] +#ProcessToComplete += [ "rbank" ] +#ProcessToComplete += [ "ig_light" ] +#ProcessToComplete += [ "ps" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** +EcosystemName = "jungle" +ContinentName = "newbieland" + + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + +# *** CONTINENT FILE *** +ContinentFile = ContinentName + "/" + ContinentName + ".continent" + + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + + +# *** LIGO OPTIONS *** +LigoExportLand = ContinentName + ".land" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_" + ContinentName + ".png" +LigoExportHeightmap1 = "big_" + ContinentName + ".png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_" + ContinentName + ".png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/" + EcosystemName + "/" + EcosystemName + ".bank" + +# *** ZONE REGIONS ( up-left, down-right ) *** +ZoneRegion = [ "65_bz", "77_cs" ] + +# *** RBANK OPTIONS *** + +# Options +RbankReduceSurfaces = 1 +RbankSmoothBorders = 1 +RbankComputeElevation = 0 +RbankComputeLevels = 1 +RbankLinkElements = 1 +RbankCutEdges = 1 +RbankUseZoneSquare = 0 + +# Region to compute ( ALPHA UPPER CASE! ) +RbankZoneUl = "65_BZ" +RbankZoneDr = "77_CS" + +# Output names +RbankRbankName = LandscapeName + +# Import ig pathes +RbankIgPaths = [ ] # ExportBuildDirectory/... +RbankIgPaths += [ "continents/" + ContinentName + "/ig_other" ] +RbankIgPaths += [ "continents/" + ContinentName + "/ig_land" ] + +# Import shape pathes +RbankShapePaths = [ ] # ExportBuildDirectory/... +RbankShapePaths += [ "continents/" + ContinentName + "/shape" ] +RbankShapePaths += [ "continents/" + ContinentName + "/shape_with_coarse_mesh_builded" ] +RbankShapePaths += [ "ecosystems/" + EcosystemName + "/shape" ] +RbankShapePaths += [ "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_builded" ] +RbankShapePaths += [ "common/sfx/ps" ] +# RbankShapePaths += [ "l:/leveldesign/world_edit_files" ] + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg new file mode 100644 index 000000000..4b886d584 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg @@ -0,0 +1,52 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/%SmallbankExportDirectory%/%EcosystemName%.smallbank"; +bankfar_name = "%ExportBuildDirectory%/%FarbankBuildDirectory%/%EcosystemName%.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/continents/newbieland/ig_land", // Instance group directory + "%ExportBuildDirectory%/continents/newbieland/ig_other", // Instance group directory + "%ExportBuildDirectory%/continents/newbieland/shape", // Shape directory + "%ExportBuildDirectory%/continents/newbieland/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/common/sfx/processes/ps/ps", // Sfx directory + "%ExportBuildDirectory%/ecosystems/jungle/shape", // Shape directory + "%ExportBuildDirectory%/ecosystems/jungle/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/ecosystems/jungle/map/tga", // Map directory + "%ExportBuildDirectory%/continents/newbieland/zone_light/water_shapes_lighted", // Water shape lighted directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/%RbankOutputBuildDirectory%/%RbankRbankName%.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/%RbankOutputBuildDirectory%/%RbankRbankName%.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg new file mode 100644 index 000000000..ccb91159d --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; // FIXME: should be 1, but missing .depend files + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py new file mode 100644 index 000000000..aa3ad4c47 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py @@ -0,0 +1,245 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-05-24 06:34GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# 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 . +# + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + + +# *** ECOSYSTEM NAME *** +EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/" + EcosystemName + "/decors/_textures/Vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] + +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-junglegoo" ] +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/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-junglegoo" ] +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/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-junglegoo" ] +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/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-junglegoo" ] +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 +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directoriy +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "/displace" ] + +# 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 + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = "ecosystems/" + EcosystemName + "/shape_tag" +ShapeExportDirectory = "ecosystems/" + EcosystemName + "/shape" +ShapeWithCoarseMeshExportDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = "ecosystems/" + EcosystemName + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = "ecosystems/" + EcosystemName + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = "ecosystems/" + EcosystemName + "/smallbank" + +# Tiles directories +TilesExportDirectory = "ecosystems/" + EcosystemName + "/tiles" + +# Tiles directories +DisplaceExportDirectory = "ecosystems/" + EcosystemName + "/diplace" + +# Veget directories +VegetExportDirectory = "ecosystems/" + EcosystemName + "/veget" +VegetTagExportDirectory = "ecosystems/" + EcosystemName + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = "ecosystems/" + EcosystemName + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = "ecosystems/" + EcosystemName + "/zone" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = "ecosystems/" + EcosystemName + "/map" +MapPanoplyBuildDirectory = "ecosystems/" + EcosystemName + "/map_panoply" + +# Shape directories +ShapeWithCoarseMeshBuildDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_builded" + +# Farbank directories +FarbankBuildDirectory = "ecosystems/" + EcosystemName + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgVillageBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" + +# Ligo directories + + +# *** 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" ] + +# Shape directory +MapClientDirectory = "jungle_maps" + +# Shape directory +ShapeClientDirectory = "jungle_shapes" + +# Map directory +BitmapClientDirectory = "jungle_maps" + +# Lightmap directory +LightmapClientDirectory = "jungle_lightmaps" + +# Tile directory +TilesClientDirectory = "jungle_tiles" + +# Displace directory +DisplaceClientDirectory = "jungle_displaces" + +# Bank directory +BankClientDirectory = "jungle_bank" + +# Vegetable set directory +VegetSetClientDirectory = "jungle_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = "jungle_vegetables" + +# PACS primitives directories +PacsPrimitiveClientDirectory = "jungle_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 new file mode 100644 index 000000000..b5e288d15 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-05-24 06:30GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# 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" ] # 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 += [ "pacs_prim" ] + +# *** 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 = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "false" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +# *** 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" ] + +# *** 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 = "jungle" + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py new file mode 100644 index 000000000..035f43900 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -0,0 +1,33 @@ +#!/usr/bin/python +# +# \file projects.py +# \brief Projects configuration +# \date 2010-05-24-09-19-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Projects configuration. +# +# 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 . +# + + +ProjectsToProcess = [ ] +ProjectsToProcess += [ "ecosystems/jungle" ] +ProjectsToProcess += [ "continents/newbieland" ] + + +# end of file