日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python如何提交作业_玛雅截稿作业提交python命令

發布時間:2024/1/23 python 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python如何提交作业_玛雅截稿作业提交python命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最后,我得到了發送瑪雅方式將作業呈現到截止日期渲染農場軟件。 我們需要做的就是寫2個工作文件的截止日期。 1. maya_deadline_job.job 2. maya_deadline_info.job

和deadlinecommand.exe 例如通過將這些文件作為參數:

deadlinecommand.exe "maya_deadline_info.job" "maya_deadline_info.job"

這里是我的Python代碼

"""

This script will submit current file to deadline for render

"""

import os

import sys

import subprocess

import maya.cmds as cmds

def maya_deadline_job():

"""

this function will collect scene file information and write a job file

:return:

"""

renderer_name = 'File'

version = cmds.about(version=True)

project_path = cmds.workspace(q=True, directory=True)

width = cmds.getAttr("defaultResolution.width")

height = cmds.getAttr("defaultResolution.height")

output_file_path = cmds.workspace(expandName="images")

output_file_prefix = cmds.getAttr("defaultRenderGlobals.imageFilePrefix")

scene_file = cmds.file(q=True, location=True)

info_txt = 'Animation=1\n' \

'Renderer={}\n' \

'UsingRenderLayers=0\n' \

'RenderLayer=\n' \

'RenderHalfFrames=0\n' \

'LocalRendering=0\n' \

'StrictErrorChecking=1\n' \

'MaxProcessors=0\n' \

'AntiAliasing=low\n' \

'Version={}\n' \

'Build=64bit\n' \

'ProjectPath={}\n' \

'ImageWidth={}\n' \

'ImageHeight={}\n' \

'OutputFilePath={}\n' \

'OutputFilePrefix={}\n' \

'Camera=\n' \

'Camera0=\n' \

'Camera1=RENDERShape\n' \

'Camera2=frontShape\n' \

'Camera3=perspShape\n' \

'Camera4=sideShape\n' \

'Camera5=topShape\n' \

'SceneFile={}\n' \

'IgnoreError211=0'.format(renderer_name

version,

project_path,

width,

height,

output_file_path,

output_file_prefix,

scene_file)

maya_deadline_job_file = r'{}\maya_deadline_job.job'.format(os.getenv('TEMP'))

with open(maya_deadline_job_file, 'w') as job_file:

job_file.write(info_txt)

return maya_deadline_job_file

def maya_deadline_info():

"""

this function will collect maya deadline information and write a job file

:return:

"""

info_txt = 'Plugin=MayaBatch\n' \

'Name=MY_FILE_NAME\n' \

'Comment=Render Launch by Python\n' \

'Pool=none\n' \

'MachineLimit=0\n' \

'Priority=50\n' \

'OnJobComplete=Nothing\n' \

'TaskTimeoutMinutes=0\n' \

'MinRenderTimeMinutes=0\n' \

'ConcurrentTasks=1\n' \

'Department=\n' \

'Group=none\n' \

'LimitGroups=\n' \

'JobDependencies=\n' \

'InitialStatus=Suspended\n' \

'OutputFilename0=C:/Users/raijv/Documents/maya/projects/default/images/masterLayer_2.iff.????\n' \

'Frames=1-10\n' \

'ChunkSize=1'

maya_deadline_info_file = r'{}\maya_deadline_info.job'.format(os.getenv('TEMP'))

with open(maya_deadline_info_file, 'w') as job_file:

job_file.write(info_txt)

return maya_deadline_info_file

def submit_to_deadline():

"""

this function will send current scene to deadline for rendering

:return:

"""

deadline_cmd = r"C:\Program Files\Thinkbox\Deadline\bin\deadlinecommand.exe"

job_file = maya_deadline_job()

info_file = maya_deadline_info()

command = '{deadline_cmd} "{job_file}" "{info_file}"'.format(**vars())

process = subprocess.Popen(command, stdout=subprocess.PIPE)

lines_iterator = iter(process.stdout.readline, b"")

# Lets print the output log to see the Error/Success

for line in lines_iterator:

print(line)

sys.stdout.flush()

submit_to_deadline()

編輯info -

請勿在渲染器中使用cmds.getAttr(“defaultRenderGlobals.currentRenderer” _name變量。使用將覆蓋渲染器的圖層。

超強干貨來襲 云風專訪:近40年碼齡,通宵達旦的技術人生

總結

以上是生活随笔為你收集整理的python如何提交作业_玛雅截稿作业提交python命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。