Functions
ASS File API

Loading and writing of .ass (Arnold Scene Source) scene files. More...

Functions

AI_API AI_DEPRECATED int AiASSWrite (AtUniverse *universe, const char *filename, int mask=AI_NODE_ALL, bool open_procs=false, bool binary=true)
 Write all nodes in the given universe to an .ass file. More...
 
AI_API AI_DEPRECATED int AiASSWriteWithMetadata (AtUniverse *universe, const char *filename, int mask=AI_NODE_ALL, bool open_procs=false, bool binary=true, const AtMetadataStore *mds=NULL)
 Write all nodes in a given universe to an .ass file, including metadata. More...
 
AI_API AI_DEPRECATED int AiASSLoad (AtUniverse *universe, const char *filename, int mask=AI_NODE_ALL)
 Load all nodes from an .ass file into a specific Arnold universe. More...
 
AI_DEPRECATED int AiASSWrite (const char *filename, int mask=AI_NODE_ALL, bool open_procs=false, bool binary=true)
 Write all nodes in the default universe to an .ass file. More...
 
AI_DEPRECATED int AiASSWriteWithMetadata (const char *filename, int mask=AI_NODE_ALL, bool open_procs=false, bool binary=true, const AtMetadataStore *mds=NULL)
 Write all nodes in the default universe to an .ass file, including metadata. More...
 
AI_DEPRECATED int AiASSLoad (const char *filename, int mask=AI_NODE_ALL)
 Load all nodes from an .ass file into the default Arnold universe. More...
 

Detailed Description

Loading and writing of .ass (Arnold Scene Source) scene files.

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 AtVector 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 AI_DEPRECATED int AiASSWrite ( AtUniverse universe,
const char *  filename,
int  mask,
bool  open_procs,
bool  binary 
)

Write all nodes in the given universe 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:

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

To write all nodes of all types, use:

1 AiASSWrite(universe, "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.

Parameters
universeuniverse whose contents will be written to .ass (NULL for default universe)
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 AI_DEPRECATED int AiASSWriteWithMetadata ( AtUniverse universe,
const char *  filename,
int  mask,
bool  open_procs,
bool  binary,
const AtMetadataStore mds 
)

Write all nodes in a given universe to an .ass file, including metadata.

See AiASSWrite

Parameters
universeuniverse whose contents will be written to .ass (NULL for default universe)
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
mdsoptional metadata store for writing metadata into the file
Returns
0 if the file was written succesfully, -1 if error
AI_API AI_DEPRECATED int AiASSLoad ( AtUniverse universe,
const char *  filename,
int  mask 
)

Load all nodes from an .ass file into a specific Arnold universe.

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
universeuniverse where the nodes will be created (NULL for default universe)
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
AI_API int AiASSWrite ( const char *  filename,
int  mask = AI_NODE_ALL,
bool  open_procs = false,
bool  binary = true 
)
inline

Write all nodes in the default universe to an .ass file.

To write the contents of another universe, use:

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

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:

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

To write all nodes of all types, use:

1 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.

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 AiASSWriteWithMetadata ( const char *  filename,
int  mask = AI_NODE_ALL,
bool  open_procs = false,
bool  binary = true,
const AtMetadataStore mds = NULL 
)
inline

Write all nodes in the default universe to an .ass file, including metadata.

See 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
mdsoptional metadata store for writing metadata into the file
Returns
0 if the file was written succesfully, -1 if error
AI_API int AiASSLoad ( const char *  filename,
int  mask = AI_NODE_ALL 
)
inline

Load all nodes from an .ass file into the default Arnold universe.

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

© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com