3dsmaxbatch plugin?

Here is an example of loading and calling the SMTD Workflow outside of the SMTD UI. You must have loaded the SubmitMaxToDeadline_Functions.ms before that.

(
	global SMTDWorkflow_3dsMaxBatch
	local the3dsmaxbathWorkflowFile = @"C:\DeadlineRepository\submission\3dsmax\Main\Workflows\SMTDWorkflow_3dsmaxbatch.ms"
	fileIn the3dsmaxbathWorkflowFile --change the code above to detect your Repo, or hard-code to your Repo path
	
	SMTDWorkflow_3dsMaxBatch.restoreSettings() --load settings from the .MAX file, if any
	
	if not doesFileExist SMTDWorkflow_3dsMaxBatch.BatchScriptFile do SMTDWorkflow_3dsMaxBatch.BatchScriptFile = @"path\to\script.ms"
	if not doesFileExist SMTDWorkflow_3dsMaxBatch.SceneFile do SMTDWorkflow_3dsMaxBatch.SceneFile = @"path\to\maxscene.max" --if you want an external file
	if not doesFileExist SMTDWorkflow_3dsMaxBatch.ListenerLog do SMTDWorkflow_3dsMaxBatch.ListenerLog = @"path\to\listenerlogs.log" -- only if you want it
	SMTDWorkflow_3dsMaxBatch.SubmitSceneMode = 2 --1 for current scene, 2 for external file, 3 for no scene
	
	SMTDWorkflow_3dsMaxBatch.CustomString0Name = "BoboString"
	SMTDWorkflow_3dsMaxBatch.CustomString0 = "Bobo was here"
	--you can modify all 10 custom strings
	
	SMTDWorkflow_3dsMaxBatch.CustomValue0Name = "ObjectPos"
	SMTDWorkflow_3dsMaxBatch.CustomValue0 = [100.0,200.0,0.0]
	--you can modify all 10 custom values
	
	local canSubmitResult = SMTDWorkflow_3dsMaxBatch.canSubmit() --check if submission is allowed
	format "%\n" canSubmitResult[2] --print the result of the test
	if canSubmitResult[1] == true do --if submission is allowed, call the submit function
		SMTDWorkflow_3dsMaxBatch.SubmitJob()
	canSubmitResult[1]
)

This code will work with the next version I am working on right now. The same principles apply to the first version I dropped, except the CustomStringXName and CustomValueXName properties do not exist there.

The script will use some of the SMTDSettings like Pools, Groups, Priority, etc. Basically anything that is shown in the SMTD UI. You can find a full list by looking at the SubmitJob function - I write my own Job files there, so it is a very small subset of SMTDSettings that are being reused. You can set them in your own code before calling the submit function.

2 Likes