khanat-opennel-code/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms
kaetemi 96935c5be2 Added: #929 Generators for ecosystem projects, all four ecosystem projects, generators for max exporter scripts, rbank cmb export.
Changed: #929 Improved skipping of exported max files, corrected search paths for some tools configurations.
2010-09-03 12:37:35 +02:00

74 lines
1.4 KiB
Text

try
(
-- Get files in the %MaxSourceDirectory% directory
files = getFiles "%MaxSourceDirectory%/*.max"
gc()
-- Sort files
sort files
gc()
-- No file ?
if files.count != 0 then
(
-- For each files
for i = 1 to files.count do
(
inputMaxFile = files[i]
outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%")
try
(
-- Compare file date
if (NeLTestFileDate outputNelFile inputMaxFile) == true then
(
-- Free memory and file handles
gc()
heapfree
-- Reset 3dsmax
resetMAXFile #noprompt
-- Open the max project
nlerror("Scanning file " + inputMaxFile + " ...")
if (loadMaxFile inputMaxFile quiet:true) == true then
(
runNelMaxExport(inputMaxFile)
)
else
(
-- Error
nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile)
)
)
else
(
nlerror("SKIPPED " + inputMaxFile)
)
)
catch
(
-- Error
nlerror("ERROR error exporting '%PreGenFileExtension%' in files " + inputMaxFile)
)
)
)
else
(
nlerror("WARNING no *.max file in folder %MaxSourceDirectory%")
)
)
catch
(
-- Error
nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%")
)
-- Bye
resetMAXFile #noprompt
quitMAX #noPrompt
quitMAX() #noPrompt