Functions
ASS file related API

Functions

AI_API int AiASSWrite (const char *filename, int mask=AI_NODE_ALL, bool open_procs=false, bool binary=true)
 Write all nodes in the scene to an .ass file. More...
 
AI_API int AiASSLoad (const char *filename, int mask=AI_NODE_ALL)
 Load all nodes from an .ass file into Arnold. More...
 

Detailed Description

Arnold has built-in support for writing scene data to a file and later reading the file in. Although not required, the extension for these files is usually .ass, which stands for Arnold Scene Source. The file format is a straightforward mapping from Arnold AtNode's to human-readable ASCII. For example, a sphere node is written as:

sphere // this is the node class
{ // any number of param/value pairs enclosed in curly braces
center 0 0 0 // parameter "center" of type AtPoint is set to value (0,0,0)
radius 2.0 // parameter "radius" of type float is set to value 2.0
} // end of node block

Function Documentation

AI_API int AiASSWrite ( const char *  filename,
int  mask,
bool  open_procs,
bool  binary 
)

Write all nodes in the scene to an .ass file.

This function can selectively write all nodes of a given type to an .ass file. For example, to write light nodes and camera nodes only, use:

AiASSWrite("lightsncams.ass", AI_NODE_LIGHT + AI_NODE_CAMERA, false);

To write all nodes of all types, use:

AiASSWrite("everything.ass", AI_NODE_ALL, false);

Just like AiASSLoad(), this function has built-in gzip compression. If filename ends in ".gz", the generated file will be automatically compressed.

Warning
Because nodes are partially-released (their array-parameters are released), we can NO LONGER RENDER after a call to AiASSWrite().
Parameters
filenameoutput filename
maskonly write the desired types of nodes
open_procsif set, then all procedurals will be recursively expanded
binaryallow binary encoding in .ass files
Returns
0 if the file was written succesfully, -1 if error
AI_API int AiASSLoad ( const char *  filename,
int  mask 
)

Load all nodes from an .ass file into Arnold.

This function automatically recognizes gzip-compressed files; first, it tries to load filename and, if not found, it will add the suffix ".gz" and try again before finally giving up.

If the filename is "-", it reads data from stdin.

Any forward references due to linked nodes will be automatically resolved at the end of the file. The order in which nodes appear in the file is irrelevant.

Parameters
filenameinput filename
maskonly read nodes with types included in the mask (default is AI_NODE_ALL)
Returns
0 if the file was read successfully, -1 if error

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com