[Arnold] [Python] Changing Arnold options in Python

The global render settings are stored in the options node, which you can get with AiUniverseGetOptions(). If the universe isn’t active (you are not inside an AiBegin() / AiEnd() block so the scene doesn’t exist yet), AiUniverseGetOptions() returns None.

Once you have the options node, you can load options from an ASS file, or you can update it with the node parameter setters such as AiNodeSetInt(). The way kick, and pykick, work is that they load the ASS file first, with its options, and then update the options node with the values from the command line.

from arnold import *
import os



# Get the default options
options = AiUniverseGetOptions()

AiLoadPlugins( os.getenv( 'ARNOLD_PLUGIN_PATH' ) )

AiASSLoad("C:/Users/Support/project/scenes/test_640x480.ass", AI_NODE_ALL)

# Render using options loaded from the ASS file

# Change options and render with the changes
AiNodeSetInt(options, 'xres', 320)

# Load options and use them to render
AiASSLoad("C:/Users/Support/project/scenes/test_960x540.ass.gz", AI_NODE_OPTIONS)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s