修改默认的Mtoa渲染设置及Drivers

Maya79 字

修改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()函数获取包含defaultArnoldRenderOptionspymel.PyNode对象。 setupDriver()获取aiAOVDriver的pynode,并将AOV的名字作为一个字符串。

例如:

import pymel.core as pm
driver = pm.PyNode('defaultArnoldDriver')
 
print driver
print driver.aiTranslator.get()
print driver.mergeAOVs.get()
admin
博学之,审问之,慎思之,明辨之,笃行之。
OωO
开启隐私评论,您的评论仅作者和评论双方可见