MaxScript job, Task progress or Render Status?

I have made a MaxScript Job which does some heavy mesh processing. It all works nicely but I am unsure of how to show a progress update on Monitor. Is there any way I can access “Task Progress” or “Task Render Status” to show what it is doing through monitor?

Thanks,

Rob

Certainly!

If you are using the MAXScript Job Template provided by the Submit Max To Deadline dialog (SMTD>Scripts tab>New Script From Template), you will see the following:

(
	local du = DeadlineUtil  --this is the interface exposed by the Lightning Plug-in which provides communication between Deadline and 3ds Max
	if du == undefined do  --if the script is not being run on Deadline (for testing purposes),
	(
		struct DeadlineUtilStruct   --define a stand-in struct with the same methods as the Lightning plug-in
		(
			fn SetTitle title = ( format "Title: %\n" title ),
			fn SetProgress percent = (true),
			fn FailRender msg = ( throw msg ),
			fn GetJobInfoEntry key = ( undefined ),
			fn GetAuxFilename index = ( undefined ),
			fn LogMessage msg = ( format "%\n" msg ),
			CurrentFrame = ((sliderTime as string) as integer)
		)
		du = DeadlineUtilStruct() --create an instance of the stand-in struct
	)--end if
	
	du.SetTitle "MAXScript Job" --set the job title 
	du.LogMessage "Starting MAXScript Job..." --output a message to the log
	local st = timestamp() --get the current system time
	
	--YOUR SCENE PROCESSING CODE GOES HERE
	
	du.LogMessage ("Finished MAXScript Job in "+ ((timestamp() - st)/1000.0) as string + " sec.") --output the job duration
	true  --return true if the task has finished successfully, return false to fail the task.
)--end script

As you can see, the DeadlineUtil interface exposed by the Deadline connection plugin (Lightning.dlx) provides the methods .SetTitle() and .SetProgress().
The former sets the text shown in the “Plugin Status” field of the Slave dialog, the latter sets the percentage shown in the “Progress” field. The Monitor will show the same data for its columns. You can also call .LogMessage() to output to the actual log (see example above which does not set progress, but sets the title and logs messages).

Hope this helps.

Fantastic! Thank you, exactly what I was after. :slight_smile: