修改Mtoa默认渲染选项,或更改AOVs,可以使用\solidangle\mtoadeploy\[version]\scripts\mtoa\hooks.py
提供的钩子函数。可以重写默认的钩子函数来执行自定义设置。
例如,你可以把这个Python放到你的userSetup.py:
import mtoa.hooks
#
# Set some defaults for the defaultArnoldRenderOptions node
#
def setupOptions(options):
options.AASamples.set(2)
options.display_gamma.set(1)
options.light_gamma.set(2.2)
options.shader_gamma.set(2.2)
options.texture_gamma.set(2.2)
options.GITotalDepth.set(6)
mtoa.hooks.setupOptions = setupOptions
#
# Enable Merge AOVs for the defaultArnoldDriver and
# any other drivers created later by the user
#
def setupDriver(driver, aovName=None):
driver.mergeAOVs.set(1)
mtoa.hooks.setupDriver = setupDriver
setupOptions()
函数获取包含defaultArnoldRenderOptions
的pymel.PyNode
对象。 setupDriver()
获取aiAOVDriver的pynode
,并将AOV的名字作为一个字符串。
例如:
import pymel.core as pm
driver = pm.PyNode('defaultArnoldDriver')
print driver
print driver.aiTranslator.get()
print driver.mergeAOVs.get()