Hello,
I’ve hacked the below together from the cookbook and forum but I’m having a problem with the function getdeadlinejobproperties(). I note that there are no *.job files in the deadline job directory (or any job directory). Specifically I want to get a list of output directories and output filenames for the 3DsMax job that the draft job is launched from (currently using the right-click scripts submission technique).
Also, I would like to get the repository directory dynamically rather than hard coding it into my script but I haven’t worked out how. Any ideas?
Thanks in advance,
Josh.
import Draft
import sys
import os
from DraftParamParser import *
deadlineRepository = r"\\server\projects\DeadlineRepository6" #Deadline repository, why can't I get the property dynamically?
# The argument name/types we're expecting from the command line arguments or Deadline.
expectedTypes = dict()
expectedTypes['deadlineJobID'] = '<string>'
# Parse the command line arguments.
params = ParseCommandLine( expectedTypes, sys.argv ) # params now contains a dictionary of the parameters initialized to values from the command line arguments.
deadlineJobID = params["deadlineJobID"] #contains the original Job's ID
jobProps = GetDeadlineJobProperties( deadlineRepository, deadlineJobID )
returns;
0: Task timeout is disabled.
0: Loaded job: test2014 [DRAFT] (54b3f9cbc4afc90fe0a45e4b)
0: INFO: Executing plugin script C:\Users\joshua\AppData\Local\Thinkbox\Deadline6\slave\ODIN06\plugins\54b3f9cbc4afc90fe0a45e4b\Draft.py
0: INFO: Found Draft python module at: ‘C:\Users\joshua\AppData\Local\Thinkbox\Deadline6\slave\ODIN06\Draft\Draft.pyd’
0: INFO: About: Draft Plugin for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 1
0: INFO: Draft job starting…
0: INFO: Stdout Handling Enabled: True
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Looking for bundled python at: ‘C:\Program Files\Thinkbox\Deadline6\bin\dpython.exe’
0: INFO: Executable: “C:\Program Files\Thinkbox\Deadline6\bin\dpython.exe”
0: INFO: Argument: -u “P:\THESYSTEM\02-CreateLayeredEXR\Draft\EXRlayering-A05.py” username=“joshua” entity=“test2014 " version=”" inFile="\horus\projects\TEST\R3\deadline_test-####.jpg" outFolder="\horus\projects\TEST\R3\Draft" outFile="\horus\projects\TEST\R3\Draft" startFrame=1 endFrame=1 frameList=“1” deadlineJobID=54b3b4bac4afc90fe0a45e30 deadlineRepository="\server\projects\DeadlineRepository6" taskStartFrame=1 taskEndFrame=1
0: INFO: Startup Directory: “C:\Users\joshua\AppData\Local\Thinkbox\Deadline6\slave\ODIN06\Draft”
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: Checking for license at @ISIS
0: STDOUT: Draft 1.1.1.55749
0: STDOUT: Command line args:
0: STDOUT: username=joshua
0: STDOUT: entity=test2014
0: STDOUT: version=
0: STDOUT: inFile=\server\projects\TEST\R3\deadline_test-####.jpg
0: STDOUT: outFolder=\server\projects\TEST\R3\Draft
0: STDOUT: outFile=\server\projects\TEST\R3\Draft
0: STDOUT: startFrame=1
0: STDOUT: endFrame=1
0: STDOUT: frameList=1
0: STDOUT: deadlineJobID=54b3b4bac4afc90fe0a45e30
0: STDOUT: deadlineRepository=\server\projects\DeadlineRepository6
0: STDOUT: taskStartFrame=1
0: STDOUT: taskEndFrame=1
0: STDOUT: ERROR: Could not find the Job File at path: ‘\server\projects\DeadlineRepository6\jobs\54b3b4bac4afc90fe0a45e30\54b3b4bac4afc90fe0a45e30.job’.
0: INFO: Process exit code: 0
0: INFO: Draft job complete!