AWS Thinkbox Discussion Forums

Submit 3dsMax render from python API

I’m trying to submit 3dsMax files for render via python but can’t figure out how to make it work.

This is what I got so far, nothing really happens when I run this, no render job and no errors:

import Deadline.DeadlineConnect as Connect
import json

if name == ‘main’:

connectionObject = Connect.DeadlineCon('00.11.23.456, 8082)

JobInfo = {
    "Name": "Submitted via Python",
    "UserName": "myUserName",
    "RenderOutput": r"\PATH\TO\myFile.png"
    "Plugin": "3dsmax"
    "Whitelist": "COMSEELM-DW0150,COMSEELM-DW0151,COMSEELM-DW0152,COMSEELM-DW0153"

}

PluginInfo = {

“Version”: “Max2017”
}

myMAXFile = r"\\Path\to\my\maxfile.max"
myAuxFiles = [myMAXFile]
newJob = connectionObject.Jobs.SubmitJob(JobInfo, PluginInfo, myAuxFiles)

Missing an end-quote here? I doubt it as it looks like it was just a typo while anonymizing things.

    connectionObject = Connect.DeadlineCon('00.11.23.456, 8082)

How are you running that? It should have thrown an error there.

Your plugin info is also pretty sparse, so I’m not expecting the job to actually pick up and render error-free, but it should have been created. After playing around, there were a few missing commas and things as well. Here’s the fixed up version that worked:

import Deadline.DeadlineConnect as Connect
import json

if __name__ == '__main__':
    connectionObject = Connect.DeadlineCon('localhost', 8082)

    JobInfo = {
        "Name": "Submitted via Python",
        "UserName": "myUserName",
        "RenderOutput": r"\PATH\TO\myFile.png",
        "Plugin": "3dsmax",
        "Whitelist": "COMSEELM-DW0150,COMSEELM-DW0151,COMSEELM-DW0152,COMSEELM-DW0153"
    }

    PluginInfo = {
        "Version": "Max2017"
    }

    myMAXFile = r"\\Path\to\my\maxfile.max"
    myAuxFiles = [myMAXFile]
    newJob = connectionObject.Jobs.SubmitJob(JobInfo, PluginInfo, myAuxFiles)

I ran it like so:

c:\Python27\python.exe c:\path\to\script.py
Privacy | Site terms | Cookie preferences