Maya:Python:如何在脚本编辑器中打开 arnoldRenderView

Maya: Python: How to open arnoldRenderView in the script editor

我卡在 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”?

谨致问候, 里克

编辑: 我在 maya (Python) 中为 arnold 找到了两个有用的脚本链接: 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\mtoadeploy18\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 时的状态与您上次关闭时的状态相同。