Notifications
Clear all

[Closed] Headless Vs Workstation

I’ve been trying to do some research as to what the limits of a headless Max Node are, specifically using maxscript.

exporterPlugin.classes

does not seem to be valid in headless.

exportFile

does not seem valid in headless either.

And to that extent

savemaxfile

definitely does not work.

Does anyone know of a more comprehensive resource of material on the things that do/don’t work in headless mode?!

I’ve been scouring for individual effects, which is great when scope is small.
Thanks!

7 Replies

Define “Headless” mode, how you are calling the commands, how you know they aren’t valid. So more information and detailed steps from start to end are really need to help diagnose the issue or cause.

-Eric

1 Reply
(@alexanderh)
Joined: 11 months ago

Posts: 0

Headless meaning called by commandline, backburner, or Deadline to operate as a render node.
An instance of 3DS max which does not require a workstation licence.

I have been testing specific commands (the ones above) and writing to a log file what results commands produce (if any) and where/when they fail to produce in order to both diagnose and identify processes that work GREAT when workin in 3ds max but fail to yield the expected results when sent to a Node.

I am testing all of this on my local machine so I can verify that all paths are correct and that all scripts run as expected.

Using deadline for example I can send a job with a script in normal render node mode and have no results returned – aside from my log file – where if I send it out in Workstation mode which forces the loading of UI and consumption of a max licence then I get all expected output + all confirmation in my log file.
The difference between the two log files seems to detail the faults as described above.
Though I have since made the

exporterPlugin.classes

work in a useful manner.

My question still remains though: is there any source for information on the capability differences between a “headless” render node instance of max and a Workstation one.

Are you calling 3dsmax.exe -U maxscript.ms? Are you using 3dsmaxcmd.exe? Please post exact steps and code. Otherwise there are way too many variables to guess on a possible cause.

-Eric

1 Reply
(@alexanderh)
Joined: 11 months ago

Posts: 0

I’m not using any of the command line anymore.
I spent enough time testing code to know that submissions are going through correctly.

But as per your request of code: submitting the following to backburner via a pre/post render script, via command line and via deadline all produce the same output. The output is some text in my diagnostic file and a .dae exported but no .max file.

global fName = "//fs1/sketch2new/Alex Temp/Network Rendering Tests/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
	global fs = openFile fName mode:"r+"
	format "This is a diagnostic file, please do not tamper with it!
" to:fs
	format "--------------------------------------------------------
" 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 "
-------------------------
" to:fs
	format "%
" localtime to:fs
	format "-------------------------
" to:fs
)
fn CloseFile =
(
	--format "
" to:fs
	flush fs	--clear the file from memory
	close fs	--close the file stream
)

AppendFile()
StartLog()
--------------------------------------------------------------------------Start Diganostic Logging Here


b=box name:"test"	

dateStamp = localtime
if (matchPattern dateStamp pattern:"*/*") then (dateStamp = substitutestring dateStamp "/" "-")
if (matchPattern dateStamp pattern:"*:*") then (dateStamp = substitutestring dateStamp ":" ".")

outputName = "\\\\fs1\sketch2new\\Alex Temp\\Network Rendering Tests\\boxes\\" + "box - " + dateStamp as string + ".max"
if savemaxfile outputName != true then
(
	format "I got through the saveMaxFile function but did not save the file.
" to:fs
)
else
(
	format "I got through the save function and succeeded!
" to:fs
)

--savemaxfile "\\\\fs1\sketch2new\\Alex Temp\\Network Rendering Tests\\boxes\\box.max"
--quitMax #noPrompt

format "I'm about to try finding exporters.
" to:fs
format "There are % export classes.
" exporterPlugin.classes.count to:fs
global exporter
for exporter = 1 to exporterPlugin.classes.count do 
(
	print exporterplugin.classes[exporter] to:fs
	if exporterplugin.classes[exporter] == OpenCOLLADAExporter then 
	(
		format "Our exporter class is: %.
" exporter to:fs
		global daename = "\\\\fs1\sketch2new\\Alex Temp\\Network Rendering Tests\\boxes\\" + (getfileNameFile maxfilename) + ".dae"
		exportFile daename #noPrompt using:exporterPlugin.classes[exporter]
		format "The filename is :%
" daename to:fs
	)
)

format "I managed to get all the way to the end of the script." to:fs
--------------------------------------------------------------------------End Diagnostic Logging Here
CloseFile()

If however you run the above code in a 3ds max window or via 3dsmax.exe -U you get the updated diagnostic file, you get your .dae and you get your .max file.

A lot of the data that I need to process is dependent on a few max files and a few other functions in 3ds max and with related plug-ins – code which does not seem to evaluate in headless mode.

Some of the trials that I still have for command line look like:

"C:\Program Files\Autodesk\3ds Max 2009\3dsmaxcmd.exe" -jobName "Script Test" -description "This is Alex's attempt at network scripting" -manager FS1 -priority 25 -group Flatiron "C:\Program Files\Autodesk\3ds Max 2009\3dsmax.exe" -U MAXScript "\\fs1\sketch2new\Alex Temp\Network Rendering Tests\Unwrap!.ms"

"C:\Program Files (x86)\Autodesk\Backburner\cmdjob.exe" -jobName "Script Test" -description "This is Alex's attempt at network scripting" -manager FS1 -priority 25 -group Flatiron "C:\Program Files\Autodesk\3ds Max 2009\3dsmax.exe" -U MAXScript "\\fs1\sketch2new\Alex Temp\Network Rendering Tests\Unwrap!.ms"


--This is for rendering a small square image and using a pre-render script on the file
"C:\Program Files\Autodesk\3ds Max 2009\3dsmaxcmd.exe" -prerenderScript:"\\fs1\sketch2new\Alex Temp\Network Rendering Tests\Unwrap!.ms" "\\fs1\sketch2new\Alex Temp\Network rendering Tests\ze files\New Look - ze farm.max"

Though the code that was passed through with those tries was much simpler and included no diagnostic information/files.
Tested today with my diagnostic script things follow as described previously – because it is headless it does not save the max file.

"C:\Program Files\Autodesk\3ds Max 2009\3dsmaxcmd.exe" -script:"C:\z_boxes\box.ms" "C:\z_boxes\blank.max"

When I run through the command prompt I get confirmation of job completion.
So I can verify running of, but not necessarily completion of all kinds of script.
for example:

"C:\Program Files\Autodesk\3ds Max 2009\3dsmaxcmd.exe" -script:"C:\z_boxes\box.ms" "C:\z_boxes\blank.max"

returns:

Unfortunately I am well past using 2009, so not sure if it is something specific there or the issue may be when the code is executed and what can happen at that time… Have you tried using persistent callbacks in the file in filepostopen or other call back to execute the code?

-Eric

1 Reply
(@alexanderh)
Joined: 11 months ago

Posts: 0

I have indeed.
I gave up on them because they didn’t appear to be working at all.
And until I get the code that I want working, their method of execution is purely arbitrary.
Just running the script on a node itself is good enough to indicate what it is/isn’t doing, especially since I now have three ways of testing/verifying.
However I was hoping that someone might have traveled this road before and had some experience to share, but I may be walking a road that few others have in 3ds, or at least that few others have successfully done.