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] outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") try ( -- Compare file date if (NeLTestFileDate outputTagFile 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 ( tagThisFile = runNelMaxExport(inputMaxFile) -- Write a tag file if tagThisFile == true then ( tagFile = createFile outputTagFile if tagFile == undefined then ( nlerror("WARNING can't create tag file " + outputTagFile) ) else ( print "mukyu" to: tagFile close tagFile ) ) ) else ( -- Error nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) ) ) else ( nlerror("SKIPPED BY TAG " + 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