Skip to main content
 首页 » 编程设计

python之Maya 到截止日期作业提交 python 命令

2024年10月24日8findumars

我正在尝试通过 Deadline Software 将 Maya 渲染发送到渲染农场.

用于将作业手动提交到截止日期的 Maya 的 Python 命令。

import sys 
import subprocess 
import maya.cmds as cmds 
 
deadline = "C:\\Program Files\\Thinkbox\\Deadline\\bin\\deadlinecommand.exe" 
maya_exe = "C:\\Program Files\\Autodesk\\Maya2015\\bin\\render.exe" 
 
file_path = cmds.file(q=True, location=True) 
 
command = '%s ' \ 
          '-SubmitCommandLineJob ' \ 
          '-executable "%s" ' \ 
          '-name "File Name" ' \ 
          '"%s" ' % (deadline, maya_exe, file_path) 
process = subprocess.Popen(command, stdout=subprocess.PIPE) 
lines_iterator = iter(process.stdout.readline, b"") 
for line in lines_iterator: 
    print(line) 
    sys.stdout.flush() 

是否有任何 Python 方法可以将 Maya 渲染器添加到截止日期......?

请您参考如下方法:

我在 Maya 中编写了一个用于 nuke 作业的导出器。它也应该与 maya 一起工作(即使我不理解你你没有使用截止日期脚本 - 请注意 nuke 的截止日期在 .py 中有一个提交者):

我正在用 xml 编辑两部分文件: nuke_submit_info.job nuke_plugin_info.job 为 Maya 找到相同的文件,它应该可以解决问题

然后用'deadlinecommand'提交它们

def sumbit2deadline(): 
    FileName = "nuke_submit_info" 
    JobInfo = PathSaveFiles + FileName + ".job" 
    FileName = "nuke_plugin_info" 
    JobPlugIn = PathSaveFiles + FileName + ".job" 
    FileName = "NukeTemplate" 
    JobFile = PathSaveFiles + FileName + ".nk" 
    command = "deadlinecommand" + " " + JobInfo + " " + JobPlugIn + " " + JobFile 
    subprocess.Popen(command)