Hi!
I’m trying to use Deadline to do some non-render processing. As such I am submitting jobs to deadline with maxscript to evaluate my tasks.
I’ve been scouring the web to determine if this is a max problem, a maxscript problem (aka MY problem) or a deadline problem. I’ve vaguely eliminated the first two and am posting here.
My code is below:
[code]global fName = “C:/z_boxes/diagnostics/ScriptLogs.txt” --defines file path and name
global fs
if (doesFileExist fName) == false then --if the file does not exist, create it
(
createFile fName --creates the file
fs = openFile fName mode:“r+”
format “This is a diagnostic file, please do not tamper with it!\n” to:fs
format “--------------------------------------------------------\n” to:fs
flush fs --clear the file from memory
close fs --close the file stream
)
fn AppendFile = (global fs = openFile fName mode:“a+”) --opens the file
fn StartLog =
(
format “\n-------------------------\n” to:fs
format “%\n” localtime to:fs
format “-------------------------\n” to:fs
)
fn CloseFile =
(
–format “\n” to:fs
flush fs --clear the file from memory
close fs --close the file stream
)
AppendFile()
StartLog()
–Start Diganostic Logging Here
------------------------File Saving--------------------------------------
filePath = maxfilepath
filePath = “C:\z_boxes\diagnostics\”
fn SaveTheFile nameVariant = --File saving function
(
if testFileName = matchPattern (filePath + getFilenamefile maxfilename) pattern:("* - " + nameVariant + “*”) == true then
(
–saveNodes (objects as array) (filePath + maxfilename) quiet:true
if (saveNodes (objects as array) (filePath + maxfilename) quiet:true) == ok then
(
format “I’m trying to save %.\n” (filePath + maxfilename) to:fs
)
else ( format “I failed to save a .max file.\n” to:fs)
)
else
(
–saveNodes (objects as array) (filePath + getFilenamefile maxfilename + " - " + nameVariant + “.max”) quiet:true
if (saveNodes (objects as array) (filePath + getFilenamefile maxfilename + " - " + nameVariant + “.max”) quiet:true) == ok then
(
format “I’m trying to save %.\n” (filePath + getFilenamefile maxfilename + " - " + nameVariant + “.max”) to:fs
)
else ( format “I failed to save a .max file.\n” to:fs)
)
)
------------------------File Saving--------------------------------------
SaveTheFile “Unwrapped”
–End Diagnostic Logging Here
CloseFile()[/code]
When I send this script to Deadline in headless form I get the following in my diagnostic file:
When I navigate to that directory however, the .max file does not exist.
I was originally trying to save the file to a network drive, but changed the directory to my local machine to try and help debugging.
My question is this: is deadline putting this file somewhere else? I can’t seem to find it anywhere related to the job itself, even if I change the filePath to maxfilepath.
I am testing in 3DS Max 2009 SP1(64bit) and 3DS Max 2011 SP2 (64bit)
Please, if someone can help me out, I would greatly appreciate it!
Thank you.