最后,我得到了发送玛雅方式将作业呈现到截止日期渲染农场软件。 我们需要做的就是写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变量。使用将覆盖渲染器的图层。

python如何提交作业_玛雅截稿作业提交python命令相关推荐

  1. python新手入门教程思路-Python新手入门教程_教你怎么用Python做数据分析

    Python新手入门教程_教你怎么用Python做数据分析 跟大家讲了这么多期的Python教程,有小伙伴在学Python新手教程的时候说学Python比较复杂的地方就是资料太多了,比较复杂.很多网上 ...

  2. HTML5期末大作业:商城网站设计——仿天猫商城(9页) HTML+CSS大作业_ 网页制作作业_疫情防控网页设计...

    HTML5期末大作业:商城网站设计--仿天猫商城(9页) HTML+CSS大作业: 网页制作作业_疫情防控网页设计- 常见网页设计作业题材有 个人. 美食. 公司. 学校. 旅游. 电商. 宠物. 电 ...

  3. html大作业_杜绝家长作业 关键是如何监督

    风评 杜绝家长作业 关键是如何监督 中国青年报 ( 2020年11月19日 04 版) 晨雾 / 转帖 张学炬 近日,武汉市教育局发出<关于开展杜绝"家长作业"进一步减轻中小 ...

  4. python executemany执行延迟_运维架构师-Python 自动化运维开发-031

    *运维架构师-Python 自动化运维开发-031 十九.Python3 操作数据库 1.Python3 操作 MySQL 1.基本介绍 Python3 操作 MySQL 数据库 可以使用的模块是 p ...

  5. python队列线程池_实例详解:python高级编程之消息队列(Queue)与进程池(Pool)

    今天为大家带来的内容是:python高级编程之消息队列(Queue)与进程池(Pool),结合了实例的形式详细分析了Python消息队列与进程池的相关原理.使用技巧与操作注意事项!!! Queue消息 ...

  6. 阿里云python自测答案_阿里云技能测试python初级中级高级

    简介 偶尔发现,阿里云-开发者社区,里竟然有技能测试平台 覆盖知识面也较多 初级(65) 涉及知识点:Python语言的基本特性.编程环境.语法基础.数据结构,了解Python的网络编程与Web开发, ...

  7. python代码编写工具_编写更好的Python代码的终极指南

    python代码编写工具 Despite its 尽管它 downsides, Python remains the king of today's programming world. Its ve ...

  8. python商业爬虫教程_廖雪峰老师的Python商业爬虫课程 Python网络爬虫实战教程 体会不一样的Python爬虫课程...

    廖雪峰老师的Python商业爬虫课程 Python网络爬虫实战教程 体会不一样的Python爬虫课程 1.JPG (53.51 KB, 下载次数: 1) 2019-8-9 08:15 上传 2.JPG ...

  9. python动态执行代码_第6.6节 Python动态执行小结

    一.    Python动态执行支持通过输入数据流或文件传入Python源代码串,进行编译后执行,可以通过这种方式扩展Python程序的功能: 二.    动态执行方法可能导致恶意攻击,因此使用时需要 ...

最新文章

  1. 监听器使用spring的bean
  2. sql添加,修改数据及删除表,表约束、字段及数据
  3. OSError: Could not find kaggle.json
  4. java语言的科学与艺术-编程练习10.4
  5. 流水过亿的《海盗来了》被指抄袭 微信小游戏为何抄袭事件频出?
  6. 十大顶级大数据可视化工具
  7. 一则“亿万富翁给妻子捐5亿美元科研经费”的八卦,引发科研筹钱难的思考
  8. 蓝牙定位听说过的你,知道蓝牙定位信标的存在吗-新导智能
  9. AcWing 105. 七夕祭(糖果传递小变种)
  10. python 选座位助手
  11. python将图片拼接为视频
  12. 服务器验收性能标准,云服务器 验收
  13. 英语单词常见前后缀总结
  14. C# 面向对象(多态)
  15. STM32HAL库微秒延时(μs)
  16. MySQL 到 ClickHouse 实时数据同步实操分享
  17. 【呆子谈营销】:从街旁网的倒闭开始谈起
  18. Android查看Jpg图片出现颠倒的问题
  19. 【刷题】BZOJ 3252 攻略
  20. 后端总结(分布式架构设计)

热门文章

  1. FFmpeg 源代码:avcodec_find_encoder()和avcodec_find_encoder_by_name()
  2. 关于centos docker版本过低导致 is not a valid repository/tag: invalid reference format
  3. 使用 pyenv 管理 Python 版本
  4. python 第三方库
  5. FLV封装格式分析器
  6. 大剑无锋之研发笔试题(一)
  7. 看动画学算法之:二叉堆Binary Heap
  8. 什么?注释里面的代码居然能够执行
  9. CentOS下Hive2.0.0单机模式安装详解
  10. 用与非门设计血型配对电路_电路板中与非门集成电路的控制原理