Getting job info

I’m wondering if it’s possible to grab job info from a Python script. What I’m trying to do is write my own Quicktime Gen script that will run after my Modo jobs complete. it looks like the example I found on the Thinkbox website only works for Nuke…please tell me if I’m wrong there.

When I open the job properties window there is a Scene Filename attribute in the Modo Settings section. If I were some how able to access that there are a number of things I could do with that info.

What would be even better is if I could pass along global variables some how when a job is submitted.

I’ve been looking through the scripting reference but it hasn’t helped me so far.

James

The reason that script only works for Nuke is because of this line:

if movieSettings == "" or job.JobPlugin != "Nuke":

If you simply remove the check for Nuke, it can work for any plugin. If you want to get the job’s scene file location, it depends on if the scene file was submitted with the job or not. If it was, you could use this:

from System.IO import *
from Deadline.Scripting import *
...
auxiliaryFolder = RepositoryUtils.GetJobAuxiliaryPath( job )
modoSceneFile = Path.Combine( auxiliaryFolder, job.JobAuxiliarySubmissionFileNames[0] )

If the modo scene file isn’t submitted with the job, you could use this:

modoSceneFile = job.GetJobPluginInfoKeyValue( "SceneFile" )

If you don’t know if the scene is submitted or not, you could do this:

from System.IO import *
from Deadline.Scripting import *
...
modoSceneFile = job.GetJobPluginInfoKeyValue( "SceneFile" )
if modoSceneFile == "":
    auxiliaryFolder = RepositoryUtils.GetJobAuxiliaryPath( job )
    modoSceneFile = Path.Combine( auxiliaryFolder, job.JobAuxiliarySubmissionFileNames[0] )

Hope that helps!

  • Ryan

Yes, that does help thanks! I realized later in the evening that I could remove that Nuke line lol. As for the code you provided, is that documented in the reference PDF?

Yup, all those functions should be defined in the scripting reference documentation:
thinkboxsoftware.com/deadlin … ne-4-2013/