From bc871cb99b398f772c6b42107e8cc606a83dea25 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 21 Sep 2011 23:16:03 +0200 Subject: [PATCH] Changed: #1093 #1092 Stability workarounds for plant shape exporting. --- .../generators/max_exporter_scripts/shape.ms | 33 ++++++++++++++++- .../export_footer.ms | 4 +- .../build_gamedata/processes/anim/1_export.py | 2 +- .../processes/anim/maxscript/anim_export.ms | 4 +- .../processes/clodbank/1_export.py | 2 +- .../clodbank/maxscript/clod_export.ms | 4 +- .../processes/ig/maxscript/ig_export.ms | 4 +- .../processes/rbank/1_export.py | 2 +- .../processes/rbank/maxscript/cmb_export.ms | 4 +- .../processes/shape/maxscript/shape_export.ms | 37 ++++++++++++++++++- .../processes/veget/1_export.py | 2 +- .../processes/veget/maxscript/veget_export.ms | 4 +- 12 files changed, 89 insertions(+), 13 deletions(-) diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms index 0f8af5276..c1f4761ff 100644 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms @@ -187,7 +187,7 @@ fn haveCoarseMesh node = return false ) -fn runNelMaxExport inputMaxFile = +fn runNelMaxExportSub inputMaxFile retryCount = ( tagThisFile = false @@ -354,8 +354,39 @@ fn runNelMaxExport inputMaxFile = ( -- Error nlerror("WARNING no shape exported from the file " + inputMaxFile) + if tagThisFile then + ( + if retryCount < 2 then + ( + nlerror("INFO retry this file") + + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExportSub inputMaxFile (retryCount + 1) + ) + else + ( + -- Error + nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) + nlerror("FAIL Mysterious error occured") + NelForceQuitRightNow() + ) + ) + ) ) return tagThisFile ) +fn runNelMaxExport inputMaxFile = +( + return runNelMaxExportSub inputMaxFile 0 +) + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms index 5facf07e7..2db696b7f 100644 --- a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms @@ -90,7 +90,9 @@ try catch ( -- Error - nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") + nlerror("ERROR Fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") + nlerror("FAIL Fatal error occured") + NelForceQuitRightNow() removeRunningTag = false ) diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py index 3bdd5e028..5d5fe4b84 100644 --- a/code/nel/tools/build_gamedata/processes/anim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -6,7 +6,7 @@ # # \file 1_export.py # \brief Export anim -# \date 2010-09-26-08-38-GMT +# \date 2011-09-21-20-51-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export anim diff --git a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms index 86d02fd15..7121e16d5 100644 --- a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms +++ b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms @@ -224,7 +224,9 @@ try catch ( -- Error - nlerror("ERROR fatal error exporting 'anim' in folder %MaxSourceDirectory%") + nlerror("ERROR Fatal error exporting 'anim' in folder %MaxSourceDirectory%") + nlerror("FAIL Fatal error occured") + NelForceQuitRightNow() removeRunningTag = false ) diff --git a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py index a9f6cf7c1..183307e30 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py @@ -6,7 +6,7 @@ # # \file 1_export.py # \brief Export clodbank -# \date 2010-09-26-08-38-GMT +# \date 2011-09-21-20-51-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export clodbank diff --git a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms index 1ab3ce7e2..f01a973e4 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -279,7 +279,9 @@ try catch ( -- Error - nlerror("ERROR fatal error exporting 'clod' in folder %MaxSourceDirectory%") + nlerror("ERROR Fatal error exporting 'clod' in folder %MaxSourceDirectory%") + nlerror("FAIL Fatal error occured") + NelForceQuitRightNow() removeRunningTag = false ) diff --git a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms index 5618a68d9..526d06dc8 100644 --- a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms +++ b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms @@ -328,7 +328,9 @@ try catch ( -- Error - nlerror("ERROR fatal error exporting 'ig' in folder %MaxSourceDirectory%") + nlerror("ERROR Fatal error exporting 'ig' in folder %MaxSourceDirectory%") + nlerror("FAIL Fatal error occured") + NelForceQuitRightNow() removeRunningTag = false ) diff --git a/code/nel/tools/build_gamedata/processes/rbank/1_export.py b/code/nel/tools/build_gamedata/processes/rbank/1_export.py index de32ae841..20c7aa54d 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/rbank/1_export.py @@ -6,7 +6,7 @@ # # \file 1_export.py # \brief Export rbank -# \date 2010-09-26-08-38-GMT +# \date 2011-09-21-20-51-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export rbank diff --git a/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms index c60a675d0..74cf3a8dd 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms +++ b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms @@ -215,7 +215,9 @@ try catch ( -- Error - nlerror("ERROR fatal error exporting 'cmb' in folder %MaxSourceDirectory%") + nlerror("ERROR Fatal error exporting 'cmb' in folder %MaxSourceDirectory%") + nlerror("FAIL Fatal error occured") + NelForceQuitRightNow() removeRunningTag = false ) 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 index 06a02bcbb..e979f6b0d 100644 --- a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -253,7 +253,7 @@ fn haveCoarseMesh node = return false ) -fn runNelMaxExport inputMaxFile = +fn runNelMaxExportSub inputMaxFile retryCount = ( tagThisFile = false @@ -420,11 +420,42 @@ fn runNelMaxExport inputMaxFile = ( -- Error nlerror("WARNING no shape exported from the file " + inputMaxFile) + if tagThisFile then + ( + if retryCount < 2 then + ( + nlerror("INFO retry this file") + + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExportSub inputMaxFile (retryCount + 1) + ) + else + ( + -- Error + nlerror("ERROR exporting 'shape': can't open the file " + inputMaxFile) + nlerror("FAIL Mysterious error occured") + NelForceQuitRightNow() + ) + ) + ) ) return tagThisFile ) +fn runNelMaxExport inputMaxFile = +( + return runNelMaxExportSub inputMaxFile 0 +) + removeRunningTag = true @@ -517,7 +548,9 @@ try catch ( -- Error - nlerror("ERROR fatal error exporting 'shape' in folder %MaxSourceDirectory%") + nlerror("ERROR Fatal error exporting 'shape' in folder %MaxSourceDirectory%") + nlerror("FAIL Fatal error occured") + NelForceQuitRightNow() removeRunningTag = false ) diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py index 61e33ea74..e6d2c53cc 100644 --- a/code/nel/tools/build_gamedata/processes/veget/1_export.py +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -6,7 +6,7 @@ # # \file 1_export.py # \brief Export veget -# \date 2010-09-26-08-38-GMT +# \date 2011-09-21-20-51-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export veget diff --git a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms index 4390e5cca..828a78d42 100644 --- a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms +++ b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms @@ -269,7 +269,9 @@ try catch ( -- Error - nlerror("ERROR fatal error exporting 'veget' in folder %MaxSourceDirectory%") + nlerror("ERROR Fatal error exporting 'veget' in folder %MaxSourceDirectory%") + nlerror("FAIL Fatal error occured") + NelForceQuitRightNow() removeRunningTag = false )