mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-27 01:06:19 +00:00
Changed: #929 Max shape export runs all the way through now.
Added: #929, #1082 Interface build project.
This commit is contained in:
parent
67307bc6e8
commit
b33c1a0f8e
9 changed files with 480 additions and 290 deletions
|
@ -181,6 +181,20 @@ def findFiles(log, dir_where, dir_sub, file_ext):
|
||||||
printLog(log, "findFiles: file not dir or file?!" + filePath)
|
printLog(log, "findFiles: file not dir or file?!" + filePath)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def findFilesNoSubdir(log, dir_where, file_ext):
|
||||||
|
result = [ ]
|
||||||
|
files = os.listdir(dir_where)
|
||||||
|
len_file_ext = len(file_ext)
|
||||||
|
for fileName in files:
|
||||||
|
if fileName != ".svn" and fileName != "*.*":
|
||||||
|
fileFull = dir_where + "/" + fileName
|
||||||
|
if os.path.isfile(fileFull):
|
||||||
|
if fileName[-len_file_ext:].lower() == file_ext.lower():
|
||||||
|
result += [ fileName ]
|
||||||
|
elif not os.path.isdir(fileFull):
|
||||||
|
printLog(log, "findFilesNoSubdir: file not dir or file?!" + filePath)
|
||||||
|
return result
|
||||||
|
|
||||||
def findFile(log, dir_where, file_name):
|
def findFile(log, dir_where, file_name):
|
||||||
files = os.listdir(dir_where)
|
files = os.listdir(dir_where)
|
||||||
for fileName in files:
|
for fileName in files:
|
||||||
|
|
|
@ -49,6 +49,8 @@ LigoExportTimeout = 3600000
|
||||||
LigoBuildTimeout = 1800000
|
LigoBuildTimeout = 1800000
|
||||||
PacsPrimExportTimeout = 600000
|
PacsPrimExportTimeout = 600000
|
||||||
|
|
||||||
|
MaxShapeExportTimeout = 300000 # 5min
|
||||||
|
|
||||||
# *** TOOLS CONFIGURATION ***
|
# *** TOOLS CONFIGURATION ***
|
||||||
|
|
||||||
TgaToDdsTool = "tga2dds"
|
TgaToDdsTool = "tga2dds"
|
||||||
|
|
|
@ -45,8 +45,9 @@ printLog(log, "")
|
||||||
|
|
||||||
# Setup source directories
|
# Setup source directories
|
||||||
printLog(log, ">>> Setup source directories <<<")
|
printLog(log, ">>> Setup source directories <<<")
|
||||||
for dir in InterfaceSourceDirectories:
|
for dirs in InterfaceSourceDirectories:
|
||||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
for dir in dirs:
|
||||||
|
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||||
for dir in InterfaceDxtcSourceDirectories:
|
for dir in InterfaceDxtcSourceDirectories:
|
||||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||||
for dir in InterfaceFullscreenSourceDirectories:
|
for dir in InterfaceFullscreenSourceDirectories:
|
||||||
|
|
|
@ -50,12 +50,14 @@ printLog(log, "")
|
||||||
# For each interface directory
|
# For each interface directory
|
||||||
printLog(log, ">>> Export interface <<<")
|
printLog(log, ">>> Export interface <<<")
|
||||||
mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory)
|
mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory)
|
||||||
for dir in InterfaceSourceDirectories:
|
for dirs in InterfaceSourceDirectories:
|
||||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
niouname = dirs[0].replace("/", "_")
|
||||||
niouname = dir.replace("/", "_")
|
|
||||||
newpath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + niouname
|
newpath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + niouname
|
||||||
mkPath(log, newpath)
|
mkPath(log, newpath)
|
||||||
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga")
|
for dir in dirs:
|
||||||
|
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||||
|
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga")
|
||||||
|
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".png")
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
# For each interface directory to compress in one DXTC
|
# For each interface directory to compress in one DXTC
|
||||||
|
@ -64,6 +66,7 @@ mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory)
|
||||||
for dir in InterfaceDxtcSourceDirectories:
|
for dir in InterfaceDxtcSourceDirectories:
|
||||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||||
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".tga")
|
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".tga")
|
||||||
|
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".png")
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
# For each interface fullscreen directory compress independently all in dds
|
# For each interface fullscreen directory compress independently all in dds
|
||||||
|
@ -80,6 +83,12 @@ else:
|
||||||
destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds"
|
destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds"
|
||||||
if needUpdateLogRemoveDest(log, sourceFile, destFile):
|
if needUpdateLogRemoveDest(log, sourceFile, destFile):
|
||||||
subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ])
|
subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ])
|
||||||
|
files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".png")
|
||||||
|
for file in files:
|
||||||
|
sourceFile = DatabaseDirectory + "/" + dir + "/" + file
|
||||||
|
destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".png")] + ".dds"
|
||||||
|
if needUpdateLogRemoveDest(log, sourceFile, destFile):
|
||||||
|
subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ])
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
# For each interface 3d directory
|
# For each interface 3d directory
|
||||||
|
@ -88,6 +97,7 @@ mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory)
|
||||||
for dir in Interface3DSourceDirectories:
|
for dir in Interface3DSourceDirectories:
|
||||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||||
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".tga")
|
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".tga")
|
||||||
|
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".png")
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
log.close()
|
log.close()
|
||||||
|
|
|
@ -27,38 +27,46 @@
|
||||||
import time, sys, os, shutil, subprocess, distutils.dir_util
|
import time, sys, os, shutil, subprocess, distutils.dir_util
|
||||||
sys.path.append("../../configuration")
|
sys.path.append("../../configuration")
|
||||||
|
|
||||||
if os.path.isfile("log.log"):
|
if os.path.isfile("temp_log.log"):
|
||||||
os.remove("log.log")
|
os.remove("temp_log.log")
|
||||||
log = open("log.log", "w")
|
log = open("temp_log.log", "w")
|
||||||
from scripts import *
|
from scripts import *
|
||||||
from buildsite import *
|
from buildsite import *
|
||||||
from process import *
|
from process import *
|
||||||
from tools import *
|
from tools import *
|
||||||
from directories import *
|
from directories import *
|
||||||
|
|
||||||
|
# Todo: make a tool to verify the files :)
|
||||||
|
|
||||||
|
def getTagFileName(filePath):
|
||||||
|
return os.path.split(filePath)[1] + ".tag"
|
||||||
|
|
||||||
def hackBigTree():
|
def hackBigTree():
|
||||||
# FO_S2_big_tree is corrupt on first export...
|
return 0
|
||||||
outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory
|
if EcosystemName == "jungle":
|
||||||
outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory
|
# FO_S2_big_tree is corrupt on first export...
|
||||||
shapeName = "FO_S2_big_tree.shape"
|
outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory
|
||||||
tagName = "FO_S2_big_tree.max.tag"
|
outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory
|
||||||
hackName = "FO_S2_big_tree_hack.tag"
|
shapeName = "FO_S2_big_tree.shape"
|
||||||
if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName):
|
tagName = "FO_S2_big_tree.max.tag"
|
||||||
printLog(log, "Removing bad export of FO_S2_big_tree")
|
hackName = "FO_S2_big_tree_hack.tag"
|
||||||
printLog(log, "RM " + outDirWithCoarse + "/" + shapeName)
|
if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName):
|
||||||
os.remove(outDirWithCoarse + "/" + shapeName)
|
printLog(log, "Removing bad export of FO_S2_big_tree")
|
||||||
printLog(log, "RM " + outDirTag + "/" + tagName)
|
printLog(log, "RM " + outDirWithCoarse + "/" + shapeName)
|
||||||
os.remove(outDirTag + "/" + tagName)
|
os.remove(outDirWithCoarse + "/" + shapeName)
|
||||||
printLog(log, "TAG " + outDirTag + "/" + hackName)
|
printLog(log, "RM " + outDirTag + "/" + tagName)
|
||||||
hackTagFile = open(outDirTag + "/" + hackName, "w")
|
os.remove(outDirTag + "/" + tagName)
|
||||||
hackTagFile.write("FO_S2_big_tree")
|
printLog(log, "TAG " + outDirTag + "/" + hackName)
|
||||||
hackTagFile.close()
|
hackTagFile = open(outDirTag + "/" + hackName, "w")
|
||||||
return 1
|
hackTagFile.write("FO_S2_big_tree")
|
||||||
elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName):
|
hackTagFile.close()
|
||||||
printLog(log, "Missing export of FO_S2_big_tree")
|
return 1
|
||||||
return 0
|
elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName):
|
||||||
else:
|
printLog(log, "Missing export of FO_S2_big_tree")
|
||||||
return 0
|
return 0
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
printLog(log, "-------")
|
printLog(log, "-------")
|
||||||
|
@ -78,7 +86,7 @@ if BuildQuality == 0:
|
||||||
if MaxAvailable:
|
if MaxAvailable:
|
||||||
# Find tools
|
# Find tools
|
||||||
Max = findMax(log, MaxDirectory, MaxExecutable)
|
Max = findMax(log, MaxDirectory, MaxExecutable)
|
||||||
# ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix)
|
ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix)
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
# Export shape 3dsmax
|
# Export shape 3dsmax
|
||||||
|
@ -108,37 +116,66 @@ if MaxAvailable:
|
||||||
os.remove(scriptDst)
|
os.remove(scriptDst)
|
||||||
for dir in ShapeSourceDirectories:
|
for dir in ShapeSourceDirectories:
|
||||||
tagDiff = 1
|
tagDiff = 1
|
||||||
|
secondTry = 1
|
||||||
shapeSourceDir = DatabaseDirectory + "/" + dir
|
shapeSourceDir = DatabaseDirectory + "/" + dir
|
||||||
mkPath(log, shapeSourceDir)
|
mkPath(log, shapeSourceDir)
|
||||||
sSrc = open(scriptSrc, "r")
|
maxFiles = findFilesNoSubdir(log, shapeSourceDir, ".max")
|
||||||
sDst = open(scriptDst, "w")
|
for maxFile in maxFiles:
|
||||||
for line in sSrc:
|
maxFilePath = shapeSourceDir + "/" + maxFile
|
||||||
newline = line.replace("output_logfile", logFile)
|
tagFilePath = outDirTag + "/" + getTagFileName(maxFilePath)
|
||||||
newline = newline.replace("shape_source_directory", shapeSourceDir)
|
if (needUpdate(log, maxFilePath, tagFilePath)):
|
||||||
newline = newline.replace("output_directory_tag", outDirTag)
|
sSrc = open(scriptSrc, "r")
|
||||||
newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse)
|
sDst = open(scriptDst, "w")
|
||||||
newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse)
|
for line in sSrc:
|
||||||
newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting)
|
newline = line.replace("output_logfile", logFile)
|
||||||
newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow)
|
# newline = newline.replace("shape_source_directory", shapeSourceDir)
|
||||||
newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit))
|
newline = newline.replace("shape_max_file_path", maxFilePath)
|
||||||
newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize)
|
newline = newline.replace("output_directory_tag", outDirTag)
|
||||||
newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling))
|
newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse)
|
||||||
newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog)
|
newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse)
|
||||||
newline = newline.replace("shape_lightmap_path", outDirLightmap)
|
newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting)
|
||||||
newline = newline.replace("output_directory_anim", outDirAnim)
|
newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow)
|
||||||
sDst.write(newline)
|
newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit))
|
||||||
sSrc.close()
|
newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize)
|
||||||
sDst.close()
|
newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling))
|
||||||
while tagDiff > 0:
|
newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog)
|
||||||
printLog(log, "MAXSCRIPT " + scriptDst)
|
newline = newline.replace("shape_lightmap_path", outDirLightmap)
|
||||||
subprocess.call([ Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ])
|
newline = newline.replace("output_directory_anim", outDirAnim)
|
||||||
tagList = findFiles(log, outDirTag, "", ".tag")
|
sDst.write(newline)
|
||||||
newTagLen = len(tagList)
|
sSrc.close()
|
||||||
tagDiff = newTagLen - tagLen
|
sDst.close()
|
||||||
tagLen = newTagLen
|
retriesLeft = 5
|
||||||
printLog(log, "Exported " + str(tagDiff) + " .max files!")
|
while retriesLeft > 0:
|
||||||
tagDiff += hackBigTree() # force rerun also when big tree deleted
|
printLog(log, "MAXSCRIPT " + scriptDst + "; " + maxFilePath)
|
||||||
os.remove(scriptDst)
|
subprocess.call([ ExecTimeout, str(MaxShapeExportTimeout), Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ])
|
||||||
|
lSrc = open(logFile, "r")
|
||||||
|
for line in lSrc:
|
||||||
|
if (len(line) > 0):
|
||||||
|
printLog(log, line.strip())
|
||||||
|
lSrc.close()
|
||||||
|
os.remove(logFile)
|
||||||
|
if (os.path.exists(tagFilePath)):
|
||||||
|
printLog(log, "OK " + maxFilePath)
|
||||||
|
retriesLeft = 0
|
||||||
|
else:
|
||||||
|
printLog(log, "FAIL " + maxFilePath)
|
||||||
|
retriesLeft = retriesLeft - 1
|
||||||
|
os.remove(scriptDst)
|
||||||
|
else:
|
||||||
|
printLog(log, "SKIP " + maxFilePath)
|
||||||
|
#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!")
|
||||||
|
# if not tagDiff > 0:
|
||||||
|
# tagDiff += hackBigTree() # force rerun also when big tree deleted
|
||||||
|
# if not tagDiff > 0:
|
||||||
|
# tagDiff += secondTry
|
||||||
|
# secondTry = 0
|
||||||
|
|
||||||
# Export clod 3dsmax
|
# Export clod 3dsmax
|
||||||
printLog(log, ">>> Export character lod shape files (.clod) from Max <<<")
|
printLog(log, ">>> Export character lod shape files (.clod) from Max <<<")
|
||||||
|
@ -156,6 +193,6 @@ if MaxAvailable:
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
log.close()
|
log.close()
|
||||||
|
shutil.move("temp_log.log", "log.log")
|
||||||
|
|
||||||
# end of file
|
# end of file
|
||||||
|
|
|
@ -245,267 +245,271 @@ fn goShapeExport =
|
||||||
(
|
(
|
||||||
try
|
try
|
||||||
(
|
(
|
||||||
-- Get files in the shape_source_directory
|
-- Get filepath
|
||||||
files = getFiles "shape_source_directory/*.max"
|
filePath = "shape_max_file_path"
|
||||||
|
|
||||||
-- Sort files
|
try
|
||||||
sort files
|
|
||||||
|
|
||||||
-- No file ?
|
|
||||||
if files.count != 0 then
|
|
||||||
(
|
(
|
||||||
-- For each files
|
-- Delete lod files
|
||||||
for i = 1 to files.count do
|
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 filePath) + (getFilenameType filePath) + ".tag")
|
||||||
|
|
||||||
|
-- Open the max project
|
||||||
|
nlerror ("Scanning file " + filePath + " ...")
|
||||||
|
if loadMaxFile filePath quiet:true == true then
|
||||||
(
|
(
|
||||||
try
|
-- Unhide category
|
||||||
|
unhidecategory()
|
||||||
|
|
||||||
|
-- Unhide
|
||||||
|
max unhide all
|
||||||
|
|
||||||
|
-- unselect
|
||||||
|
max select none
|
||||||
|
|
||||||
|
-- Exported object count
|
||||||
|
exported = 0
|
||||||
|
|
||||||
|
-- Add the lod
|
||||||
|
for node in geometry do
|
||||||
(
|
(
|
||||||
-- Delete lod files
|
-- Get lod count
|
||||||
lod_array = #()
|
nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT
|
||||||
|
if (nodeCount != undefined) then
|
||||||
-- Ok ?
|
|
||||||
ok = false
|
|
||||||
|
|
||||||
-- Free memory and file handles
|
|
||||||
gc ()
|
|
||||||
|
|
||||||
-- Reset 3dsmax
|
|
||||||
resetMAXFile #noprompt
|
|
||||||
|
|
||||||
-- Get the tag file name
|
|
||||||
tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag")
|
|
||||||
|
|
||||||
-- Compare date with the tag file
|
|
||||||
if (NeLTestFileDate tag files[i]) == true then
|
|
||||||
(
|
(
|
||||||
-- Open the max project
|
-- For each lod
|
||||||
nlerror ("Scanning file "+files[i]+" ...")
|
nodeCountNum = nodeCount as Integer
|
||||||
if loadMaxFile files[i] quiet:true == true then
|
for lod = 1 to nodeCountNum do
|
||||||
(
|
(
|
||||||
-- Unhide category
|
-- Get the lod
|
||||||
unhidecategory()
|
lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1)
|
||||||
|
|
||||||
-- Unhide
|
-- Exist ?
|
||||||
max unhide all
|
if (lod != undefined) then
|
||||||
|
|
||||||
-- unselect
|
|
||||||
max select none
|
|
||||||
|
|
||||||
-- Exported object count
|
|
||||||
exported = 0
|
|
||||||
|
|
||||||
-- Add the lod
|
|
||||||
for node in geometry do
|
|
||||||
(
|
(
|
||||||
-- Get lod count
|
-- Select a node
|
||||||
nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT
|
try
|
||||||
if (nodeCount != undefined) then
|
|
||||||
(
|
(
|
||||||
-- For each lod
|
nd = execute ("$'"+lod+"'")
|
||||||
nodeCountNum = nodeCount as Integer
|
)
|
||||||
for lod = 1 to nodeCountNum do
|
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 filePath) == true then
|
||||||
(
|
(
|
||||||
-- Get the lod
|
try
|
||||||
lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1)
|
|
||||||
|
|
||||||
-- Exist ?
|
|
||||||
if (lod != undefined) then
|
|
||||||
(
|
(
|
||||||
-- Select a node
|
-- Export the shape
|
||||||
try
|
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
|
||||||
(
|
(
|
||||||
nd = execute ("$'"+lod+"'")
|
nlerror ("OK "+output)
|
||||||
|
exported = exported+1
|
||||||
)
|
)
|
||||||
catch
|
else
|
||||||
(
|
(
|
||||||
nlerror ("Error in Execute $'"+lod+"' from node "+node.name)
|
-- Error
|
||||||
nd = undefined
|
nlerror ("ERROR exporting shape "+node.name+" in file "+filePath)
|
||||||
)
|
tagThisFile = false
|
||||||
|
return 0
|
||||||
-- Node exist ?
|
|
||||||
if (nd != undefined) then
|
|
||||||
(
|
|
||||||
append lod_array nd
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
catch
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
-- 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 ?
|
-- Error
|
||||||
if ((isLod node) == false) then
|
nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+filePath)
|
||||||
(
|
tagThisFile = false
|
||||||
-- Output directory
|
return 0
|
||||||
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
|
else
|
||||||
(
|
(
|
||||||
nlerror ("OK "+output)
|
-- Error
|
||||||
|
nlerror ("SKIPPED "+output)
|
||||||
|
exported = exported+1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
-- Write a tag file
|
-- Export default animations
|
||||||
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
|
for node in objects do
|
||||||
if exported == 0 then
|
(
|
||||||
(
|
-- Can export it ?
|
||||||
-- Error
|
if (isAnimToBeExported node) == true then
|
||||||
nlerror ("WARNING no shape exported from the file "+files[i])
|
(
|
||||||
)
|
-- 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
|
else
|
||||||
(
|
(
|
||||||
-- Error
|
nlerror ("OK "+output)
|
||||||
nlerror ("ERROR exporting shape: can't open 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
|
else
|
||||||
(
|
(
|
||||||
-- Error
|
print "toto" to: tagFile
|
||||||
nlerror ("SKIPPED BY TAG "+files[i])
|
close tagFile
|
||||||
)
|
)
|
||||||
|
|
||||||
gc ()
|
|
||||||
|
|
||||||
-- Reset 3dsmax
|
|
||||||
resetMAXFile #noprompt
|
|
||||||
)
|
)
|
||||||
catch
|
|
||||||
|
-- Something exported
|
||||||
|
if exported == 0 then
|
||||||
(
|
(
|
||||||
-- Error
|
-- Error
|
||||||
nlerror ("ERROR fatal error exporting shape in file " + files[i])
|
nlerror ("WARNING no shape exported from the file "+filePath)
|
||||||
-- return 0
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
else
|
||||||
|
(
|
||||||
|
-- Error
|
||||||
|
nlerror ("ERROR exporting shape: can't open the file "+filePath)
|
||||||
|
)
|
||||||
|
|
||||||
|
try
|
||||||
|
(
|
||||||
|
gc ()
|
||||||
|
)
|
||||||
|
catch
|
||||||
|
(
|
||||||
|
nlerror ("ERROR gc " + getCurrentException())
|
||||||
|
)
|
||||||
|
|
||||||
|
try
|
||||||
|
(
|
||||||
|
-- Reset 3dsmax
|
||||||
|
resetMAXFile #noprompt
|
||||||
|
)
|
||||||
|
catch
|
||||||
|
(
|
||||||
|
nlerror ("ERROR resetMAXFile " + getCurrentException())
|
||||||
|
)
|
||||||
|
|
||||||
|
try
|
||||||
|
(
|
||||||
|
gc ()
|
||||||
|
)
|
||||||
|
catch
|
||||||
|
(
|
||||||
|
nlerror ("ERROR gc " + getCurrentException())
|
||||||
|
)
|
||||||
)
|
)
|
||||||
else
|
catch
|
||||||
(
|
(
|
||||||
nlerror ("WARNING no max file in folder shape_source_directory")
|
-- Error
|
||||||
|
nlerror ("ERROR fatal error exporting shape in file " + filePath)
|
||||||
|
return 0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
catch
|
catch
|
||||||
(
|
(
|
||||||
-- Error
|
-- Error
|
||||||
nlerror ("ERROR fatal error exporting shape in folder shape_source_directory")
|
nlerror ("ERROR fatal error exporting shape in file")
|
||||||
return 0
|
return 0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
goShapeExport()
|
undo off
|
||||||
|
(
|
||||||
|
goShapeExport()
|
||||||
|
)
|
||||||
|
|
||||||
nlerror ("BYE")
|
nlerror ("BYE")
|
||||||
|
|
||||||
quitMAX #noPrompt
|
quitMAX #noPrompt
|
||||||
quitMAX () #noPrompt
|
quitMAX () #noPrompt
|
||||||
|
|
||||||
|
quitMAX #noPrompt
|
||||||
|
quitMAX () #noPrompt
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
#
|
||||||
|
# \file directories.py
|
||||||
|
# \brief Directories configuration
|
||||||
|
# \date 2010-08-27 17:13GMT
|
||||||
|
# \author Jan Boon (Kaetemi)
|
||||||
|
# \date 2001-2005
|
||||||
|
# \author Nevrax
|
||||||
|
# Python port of game data build pipeline.
|
||||||
|
# Directories configuration.
|
||||||
|
#
|
||||||
|
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
# *** COMMON PATH ***
|
||||||
|
|
||||||
|
CommonPath = "common/interface"
|
||||||
|
|
||||||
|
# *** SOURCE DIRECTORIES IN THE DATABASE ***
|
||||||
|
|
||||||
|
#Interface directories
|
||||||
|
InterfaceSourceDirectories = [ ]
|
||||||
|
InterfaceSourceDirectories += [ [ "interfaces/v3" ] + [ "interfaces/ring_interface" ] ]
|
||||||
|
InterfaceSourceDirectories += [ [ "interfaces/v3_outgame/ui" ] ]
|
||||||
|
InterfaceSourceDirectories += [ [ "interfaces/v3_login" ] ]
|
||||||
|
|
||||||
|
InterfaceDxtcSourceDirectories = [ ]
|
||||||
|
InterfaceDxtcSourceDirectories += [ "interfaces/v3_bricks" ]
|
||||||
|
InterfaceDxtcSourceDirectories += [ "interfaces/v3_items" ]
|
||||||
|
InterfaceDxtcSourceDirectories += [ "interfaces/v3_dxtc_misc" ]
|
||||||
|
|
||||||
|
InterfaceFullscreenSourceDirectories = [ ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_fullscreen" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_outgame/fullscreen" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/abilities_items" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/buy_sell" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/camera_character" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/create_perso" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/fight" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/MatisTown" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/spell" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/talk_bot" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/abilities_items" ]
|
||||||
|
InterfaceFullscreenSourceDirectories += [ "interfaces/v3_quick_help/graph" ]
|
||||||
|
|
||||||
|
Interface3DSourceDirectories = [ ]
|
||||||
|
Interface3DSourceDirectories += [ "interfaces/v3_outgame/3d" ]
|
||||||
|
Interface3DSourceDirectories += [ "interfaces/v3_doc/htm" ]
|
||||||
|
Interface3DSourceDirectories += [ "interfaces/v3_doc" ]
|
||||||
|
Interface3DSourceDirectories += [ "interfaces/v3_quick_help" ]
|
||||||
|
|
||||||
|
|
||||||
|
# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE ***
|
||||||
|
|
||||||
|
# Interface directories
|
||||||
|
InterfaceExportDirectory = CommonPath + "/interface_export"
|
||||||
|
InterfaceDxtcExportDirectory = CommonPath + "/interface_dxtc_export"
|
||||||
|
InterfaceFullscreenExportDirectory = CommonPath + "/interface_fullscreen_export"
|
||||||
|
Interface3DExportDirectory = CommonPath + "/interface_3d_export"
|
||||||
|
|
||||||
|
|
||||||
|
# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE ***
|
||||||
|
|
||||||
|
# Interface directories
|
||||||
|
InterfaceBuildDirectory = CommonPath + "/interface_build"
|
||||||
|
InterfaceDxtcBuildDirectory = CommonPath + "/interface_dxtc_build"
|
||||||
|
|
||||||
|
|
||||||
|
# *** INSTALL DIRECTORIES IN THE CLIENT DATA ***
|
||||||
|
|
||||||
|
# Lightmap directory
|
||||||
|
InterfaceClientDirectory = "interfaces"
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
#
|
||||||
|
# \file config.py
|
||||||
|
# \brief Process configuration
|
||||||
|
# \date 2010-08-27 17:02GMT
|
||||||
|
# \author Jan Boon (Kaetemi)
|
||||||
|
# Python port of game data build pipeline.
|
||||||
|
# Process configuration.
|
||||||
|
#
|
||||||
|
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
# *** PROCESS CONFIGURATION ***
|
||||||
|
|
||||||
|
# *** PROCESS CONFIG ***
|
||||||
|
ProcessToComplete = [ ]
|
||||||
|
ProcessToComplete += [ "interface" ]
|
||||||
|
|
||||||
|
# *** MAPS OPTIONS ***
|
||||||
|
|
||||||
|
ReduceBitmapFactor = 0
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
|
|
||||||
ProjectsToProcess = [ ]
|
ProjectsToProcess = [ ]
|
||||||
|
ProjectsToProcess += [ "common/interface" ]
|
||||||
ProjectsToProcess += [ "ecosystems/jungle" ]
|
ProjectsToProcess += [ "ecosystems/jungle" ]
|
||||||
ProjectsToProcess += [ "continents/newbieland" ]
|
ProjectsToProcess += [ "continents/newbieland" ]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue