Here is the Python Module - to use it right click the Deadline ROP, select “Type Properties”, in the dialog go to the scripts tab, select Python Module and replace the contents with this:
import hou
import sys
import traceback
try:
from CallDeadlineCommand import CallDeadlineCommand
except:
pass
def SubmitToDeadline():
if "CallDeadlineCommand" in sys.modules:
# Get the repository path
path = CallDeadlineCommand( [ "-GetRepositoryPath", "submission/Houdini/Main" ] ).strip()
if path != "":
path = path.replace( "\\", "/" )
# Add the path to the system path
if path not in sys.path :
print("Appending \"" + path + "\" to system path to import SubmitDeadlineRop module")
sys.path.append( path )
# Import the script and call the main() function
try:
import SubmitDeadlineRop
SubmitDeadlineRop.SubmitToDeadline()
except:
print( traceback.format_exc() )
print( "The SubmitDeadlineRop.py script could not be found in the Deadline Repository. Please make sure that the Deadline Client has been installed on this machine, that the Deadline Client bin folder is set in the DEADLINE_PATH environment variable, and that the Deadline Client has been configured to point to a valid Repository." )
else:
print( "The SubmitDeadlineRop.py script could not be found in the Deadline Repository. Please make sure that the Deadline Client has been installed on this machine, that the Deadline Client bin folder is set in the DEADLINE_PATH environment variable, and that the Deadline Client has been configured to point to a valid Repository." )
else:
print( "Unable to locate 'CallDeadlineCommand.py', please ensure your Deadline ROP installation is correct." )
hou.ui.displayMessage( "Unable to locate 'CallDeadlineCommand.py', please ensure your Deadline ROP installation is correct.", title="Submit Houdini To Deadline" )
and in PreFirstCreate you also have to fix the prints:
import hou
import json
import sys
try:
from CallDeadlineCommand import CallDeadlineCommand
except:
print( "Unable to locate 'CallDeadlineCommand.py', please ensure your Deadline ROP installation is correct." )
# If 'IS_HOUDINI_RENDERING' is 'TRUE', don't sync file from deadline repository. We don't need these files during rendering time.
if hou.getenv('IS_HOUDINI_RENDERING') != 'TRUE':
if "CallDeadlineCommand" in sys.modules:
subInfo = json.loads( CallDeadlineCommand( [ "-prettyJSON", "-GetSubmissionInfo", "Pools", "Groups", "MaxPriority", "TaskLimit", "UserHomeDir", "RepoDir:submission/Houdini/Main", "RepoDir:submission/Integration/Main", "RepoDirNoCustom:draft", "RepoDirNoCustom:submission/Jigsaw", ] ) )
else:
subInfo = { "result" : { "Pools": ["none"], "Groups":["none"], "MaxPriority": 100, "TaskLimit": 5000, "UserHomeDir":"", "RepoDirs":{ "submission/Houdini/Main":"", "submission/Integration/Main":"", "draft":"", "submission/Jigsawegration/Main":"", "submission/Jigsaw":"" } } }
hou.putenv( "Deadline_Submission_Info", json.dumps( subInfo["result"] ) )
When you are done, you can save the definition by clicking apply or accept.