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)
|
||||
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):
|
||||
files = os.listdir(dir_where)
|
||||
for fileName in files:
|
||||
|
|
|
@ -49,6 +49,8 @@ LigoExportTimeout = 3600000
|
|||
LigoBuildTimeout = 1800000
|
||||
PacsPrimExportTimeout = 600000
|
||||
|
||||
MaxShapeExportTimeout = 300000 # 5min
|
||||
|
||||
# *** TOOLS CONFIGURATION ***
|
||||
|
||||
TgaToDdsTool = "tga2dds"
|
||||
|
|
|
@ -45,8 +45,9 @@ printLog(log, "")
|
|||
|
||||
# Setup source directories
|
||||
printLog(log, ">>> Setup source directories <<<")
|
||||
for dir in InterfaceSourceDirectories:
|
||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||
for dirs in InterfaceSourceDirectories:
|
||||
for dir in dirs:
|
||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||
for dir in InterfaceDxtcSourceDirectories:
|
||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||
for dir in InterfaceFullscreenSourceDirectories:
|
||||
|
|
|
@ -50,12 +50,14 @@ 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("/", "_")
|
||||
for dirs in InterfaceSourceDirectories:
|
||||
niouname = dirs[0].replace("/", "_")
|
||||
newpath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + niouname
|
||||
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, "")
|
||||
|
||||
# For each interface directory to compress in one DXTC
|
||||
|
@ -64,6 +66,7 @@ mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory)
|
|||
for dir in InterfaceDxtcSourceDirectories:
|
||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".tga")
|
||||
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".png")
|
||||
printLog(log, "")
|
||||
|
||||
# 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"
|
||||
if needUpdateLogRemoveDest(log, sourceFile, destFile):
|
||||
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, "")
|
||||
|
||||
# For each interface 3d directory
|
||||
|
@ -88,6 +97,7 @@ mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory)
|
|||
for dir in Interface3DSourceDirectories:
|
||||
mkPath(log, DatabaseDirectory + "/" + dir)
|
||||
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".tga")
|
||||
copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".png")
|
||||
printLog(log, "")
|
||||
|
||||
log.close()
|
||||
|
|
|
@ -27,38 +27,46 @@
|
|||
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")
|
||||
if os.path.isfile("temp_log.log"):
|
||||
os.remove("temp_log.log")
|
||||
log = open("temp_log.log", "w")
|
||||
from scripts import *
|
||||
from buildsite import *
|
||||
from process import *
|
||||
from tools import *
|
||||
from directories import *
|
||||
|
||||
# Todo: make a tool to verify the files :)
|
||||
|
||||
def getTagFileName(filePath):
|
||||
return os.path.split(filePath)[1] + ".tag"
|
||||
|
||||
def hackBigTree():
|
||||
# FO_S2_big_tree is corrupt on first export...
|
||||
outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory
|
||||
outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory
|
||||
shapeName = "FO_S2_big_tree.shape"
|
||||
tagName = "FO_S2_big_tree.max.tag"
|
||||
hackName = "FO_S2_big_tree_hack.tag"
|
||||
if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName):
|
||||
printLog(log, "Removing bad export of FO_S2_big_tree")
|
||||
printLog(log, "RM " + outDirWithCoarse + "/" + shapeName)
|
||||
os.remove(outDirWithCoarse + "/" + shapeName)
|
||||
printLog(log, "RM " + outDirTag + "/" + tagName)
|
||||
os.remove(outDirTag + "/" + tagName)
|
||||
printLog(log, "TAG " + outDirTag + "/" + hackName)
|
||||
hackTagFile = open(outDirTag + "/" + hackName, "w")
|
||||
hackTagFile.write("FO_S2_big_tree")
|
||||
hackTagFile.close()
|
||||
return 1
|
||||
elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName):
|
||||
printLog(log, "Missing export of FO_S2_big_tree")
|
||||
return 0
|
||||
else:
|
||||
return 0
|
||||
return 0
|
||||
if EcosystemName == "jungle":
|
||||
# FO_S2_big_tree is corrupt on first export...
|
||||
outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory
|
||||
outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory
|
||||
shapeName = "FO_S2_big_tree.shape"
|
||||
tagName = "FO_S2_big_tree.max.tag"
|
||||
hackName = "FO_S2_big_tree_hack.tag"
|
||||
if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName):
|
||||
printLog(log, "Removing bad export of FO_S2_big_tree")
|
||||
printLog(log, "RM " + outDirWithCoarse + "/" + shapeName)
|
||||
os.remove(outDirWithCoarse + "/" + shapeName)
|
||||
printLog(log, "RM " + outDirTag + "/" + tagName)
|
||||
os.remove(outDirTag + "/" + tagName)
|
||||
printLog(log, "TAG " + outDirTag + "/" + hackName)
|
||||
hackTagFile = open(outDirTag + "/" + hackName, "w")
|
||||
hackTagFile.write("FO_S2_big_tree")
|
||||
hackTagFile.close()
|
||||
return 1
|
||||
elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName):
|
||||
printLog(log, "Missing export of FO_S2_big_tree")
|
||||
return 0
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
printLog(log, "")
|
||||
printLog(log, "-------")
|
||||
|
@ -78,7 +86,7 @@ if BuildQuality == 0:
|
|||
if MaxAvailable:
|
||||
# Find tools
|
||||
Max = findMax(log, MaxDirectory, MaxExecutable)
|
||||
# ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix)
|
||||
ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix)
|
||||
printLog(log, "")
|
||||
|
||||
# Export shape 3dsmax
|
||||
|
@ -108,37 +116,66 @@ if MaxAvailable:
|
|||
os.remove(scriptDst)
|
||||
for dir in ShapeSourceDirectories:
|
||||
tagDiff = 1
|
||||
secondTry = 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!")
|
||||
tagDiff += hackBigTree() # force rerun also when big tree deleted
|
||||
os.remove(scriptDst)
|
||||
maxFiles = findFilesNoSubdir(log, shapeSourceDir, ".max")
|
||||
for maxFile in maxFiles:
|
||||
maxFilePath = shapeSourceDir + "/" + maxFile
|
||||
tagFilePath = outDirTag + "/" + getTagFileName(maxFilePath)
|
||||
if (needUpdate(log, maxFilePath, tagFilePath)):
|
||||
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("shape_max_file_path", maxFilePath)
|
||||
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()
|
||||
retriesLeft = 5
|
||||
while retriesLeft > 0:
|
||||
printLog(log, "MAXSCRIPT " + scriptDst + "; " + maxFilePath)
|
||||
subprocess.call([ ExecTimeout, str(MaxShapeExportTimeout), Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ])
|
||||
lSrc = open(logFile, "r")
|
||||
for line in lSrc:
|
||||
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
|
||||
printLog(log, ">>> Export character lod shape files (.clod) from Max <<<")
|
||||
|
@ -156,6 +193,6 @@ if MaxAvailable:
|
|||
printLog(log, "")
|
||||
|
||||
log.close()
|
||||
|
||||
shutil.move("temp_log.log", "log.log")
|
||||
|
||||
# end of file
|
||||
|
|
|
@ -99,40 +99,40 @@ 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
|
||||
)
|
||||
|
||||
|
@ -144,16 +144,16 @@ fn isAnimToBeExported node =
|
|||
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
|
||||
(
|
||||
|
@ -221,13 +221,13 @@ fn haveCoarseMesh node =
|
|||
(
|
||||
-- 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
|
||||
(
|
||||
|
@ -245,267 +245,271 @@ 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
|
||||
-- Get filepath
|
||||
filePath = "shape_max_file_path"
|
||||
|
||||
try
|
||||
(
|
||||
-- For each files
|
||||
for i = 1 to files.count do
|
||||
-- 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 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
|
||||
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
|
||||
-- Get lod count
|
||||
nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT
|
||||
if (nodeCount != undefined) then
|
||||
(
|
||||
-- Open the max project
|
||||
nlerror ("Scanning file "+files[i]+" ...")
|
||||
if loadMaxFile files[i] quiet:true == true then
|
||||
-- For each lod
|
||||
nodeCountNum = nodeCount as Integer
|
||||
for lod = 1 to nodeCountNum do
|
||||
(
|
||||
-- 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 the lod
|
||||
lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1)
|
||||
|
||||
-- Exist ?
|
||||
if (lod != undefined) then
|
||||
(
|
||||
-- Get lod count
|
||||
nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT
|
||||
if (nodeCount != undefined) then
|
||||
-- Select a node
|
||||
try
|
||||
(
|
||||
-- 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
|
||||
nd = execute ("$'"+lod+"'")
|
||||
)
|
||||
catch
|
||||
(
|
||||
-- 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
|
||||
nlerror ("Error in Execute $'"+lod+"' from node "+node.name)
|
||||
nd = undefined
|
||||
)
|
||||
|
||||
-- Node exist ?
|
||||
if (nd != 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
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
append lod_array nd
|
||||
)
|
||||
)
|
||||
|
||||
-- Export default animations
|
||||
|
||||
for node in objects do
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
-- 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
|
||||
(
|
||||
-- Can export it ?
|
||||
if (isAnimToBeExported node) == true then
|
||||
-- Not a lod ?
|
||||
if ((isLod node) == false) then
|
||||
(
|
||||
-- Anim output directory
|
||||
output = ("output_directory_anim/"+(node.name)+".anim")
|
||||
|
||||
-- Export the animation
|
||||
if (NelExportAnimation #(node) output false) == 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
|
||||
(
|
||||
nlerror ("ERROR exporting animation "+output)
|
||||
return 0
|
||||
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 "+filePath)
|
||||
tagThisFile = false
|
||||
return 0
|
||||
)
|
||||
)
|
||||
catch
|
||||
(
|
||||
-- Error
|
||||
nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+filePath)
|
||||
tagThisFile = false
|
||||
return 0
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
nlerror ("OK "+output)
|
||||
-- Error
|
||||
nlerror ("SKIPPED "+output)
|
||||
exported = exported+1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
-- 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])
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
-- 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
|
||||
(
|
||||
-- Error
|
||||
nlerror ("ERROR exporting shape: can't open the file "+files[i])
|
||||
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
|
||||
(
|
||||
-- Error
|
||||
nlerror ("SKIPPED BY TAG "+files[i])
|
||||
print "toto" to: tagFile
|
||||
close tagFile
|
||||
)
|
||||
|
||||
gc ()
|
||||
|
||||
-- Reset 3dsmax
|
||||
resetMAXFile #noprompt
|
||||
)
|
||||
catch
|
||||
|
||||
-- Something exported
|
||||
if exported == 0 then
|
||||
(
|
||||
-- Error
|
||||
nlerror ("ERROR fatal error exporting shape in file " + files[i])
|
||||
-- return 0
|
||||
nlerror ("WARNING no shape exported from the file "+filePath)
|
||||
)
|
||||
)
|
||||
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
|
||||
(
|
||||
-- Error
|
||||
nlerror ("ERROR fatal error exporting shape in folder shape_source_directory")
|
||||
nlerror ("ERROR fatal error exporting shape in file")
|
||||
return 0
|
||||
)
|
||||
)
|
||||
|
||||
goShapeExport()
|
||||
undo off
|
||||
(
|
||||
goShapeExport()
|
||||
)
|
||||
|
||||
nlerror ("BYE")
|
||||
|
||||
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 += [ "common/interface" ]
|
||||
ProjectsToProcess += [ "ecosystems/jungle" ]
|
||||
ProjectsToProcess += [ "continents/newbieland" ]
|
||||
|
||||
|
|
Loading…
Reference in a new issue