Quantcast
Channel: MTOA – Arnold Support Corner
Viewing all articles
Browse latest Browse all 107

[MtoA] [Scripting] Setting the output image format

$
0
0

Settings like the image format and compression come from the defaultArnoldDriver node, so to set them through scripting, you need to set defaultArnoldDriver attributes.
ImageFormat_ai_translator

The image format corresponds to the ai_translator attribute.

# Python
import maya.cmds as cmds
cmds.setAttr( 'defaultArnoldDriver.ai_translator', 'exr', type='string' )
# PyMel
import pymel.core as pm
d = pm.PyNode( 'defaultArnoldDriver' )
d.ai_translator.set( 'exr )
// Mel
setAttr "defaultArnoldDriver.ai_translator" -type "string" "jpeg";

The rest of the attributes are named a little… better ;) Here’s a Python snippet to list the driver attributes and their values:



from maya.cmds import *
sn = cmds.attributeInfo( inherited=False, short=True, type="aiAOVDriver" )
for s in sn:
    print "defaultArnoldDriver.%s = %s" %( s, cmds.getAttr( "defaultArnoldDriver.%s" % s ) )

Viewing all articles
Browse latest Browse all 107

Trending Articles