python - Maya:Python:如何在脚本编辑器中打开 arnoldRenderView
问题描述
我被困在 Arnold 的 Python 命令列表中。对于当前的练习,我需要在 Maya中制作一个光绘器(例如https://evermotion.org/articles/show/8837/light-painter-1-0 )。
我需要让 ArnoldRenderView 自动打开。我一直在寻找这个很长一段时间了。我所能找到的只是:“ from mtoa.cmds.arnoldRenderView import arnoldRenderView
”。
在哪里可以找到可以用来打开 ArnoldRenderView(通过单击按钮)的标志?
或者有没有更简单的方法来打开 ArnoldRenderView 而无需访问“ mtoa.cmds.arnoldRenderView
”?
亲切的问候,瑞克。
编辑: 我发现了两个有用的关于 Arnold 在 Maya (Python) 中编写脚本的链接: https ://arnoldsupport.com/2015/03/04/arnold-getting-started-with-the-arnold-python-api/ 和https ://trac.solidangle.com/arnoldpedia/chrome/site/Arnold-4.1.3.3/doc/api/index.html
解决方案
我找到了我的问题的答案。
# import libraries (Maya Commands Library and mtoa Core Library)
import maya.cmds as cmds
import mtoa.core as core
就像 haggi krey 说的,你会在arnoldmenu.py
文件中找到必要的函数
#Copy paste both functions from the arnoldmenu.py Script (filepath: "C:\solidangle\mtoadeploy\2018\scripts\mtoa\ui\arnoldmenu.py")
def arnoldOpenMtoARenderView():
core.createOptions()
cmds.arnoldRenderView(mode ="open")
def arnoldMtoARenderView():
# core.ACTIVE_CAMERA is not set, anything we could do here ?
#if core.ACTIVE_CAMERA != None:
# cmds.arnoldRenderView(cam=core.ACTIVE_CAMERA)
# so instead we're calling it without any argument
core.createOptions()
cmds.arnoldRenderView()
#execute both functions
arnoldOpenMtoARenderView()
arnoldMtoARenderView()
此脚本以与您上次关闭时相同的状态打开 arnoldRenderView。
推荐阅读
- c# - 在回发时,我如何检查哪个 html 按钮在后面的代码中导致回发
- firebase - 在 FireStore 中排序数据
- windows - 用于软件安装的单独 Windows 帐户
- react-native - geolib 函数没有返回值
- php - 列出所有图像尺寸,包括自定义 (WordPress)
- python - Python TypeError:升级到 Django 2.1 后,“用户”类型的对象不是 JSON 可序列化的
- android - Android 无法连接到 openfire 服务器 org.jivesoftware.smack.SmackException$ConnectionException
- flutter - GridView出现动画
- javascript - 如何对对象内的对象属性求和?
- javascript - How can I use the column check box and row selection function together?