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

Detailed Description

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

This is deprecated in favor of ai_scene.h and its AiScene* methods.

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

◆ AiASSWrite()

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:

AiASSWrite(universe, "lightsncams.ass", AI_NODE_LIGHT + AI_NODE_CAMERA, false);
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.
Definition: ai_dotass.cpp:32
#define AI_NODE_CAMERA
Camera nodes (persp_camera, fisheye_camera, etc)
Definition: ai_node_entry.h:39
#define AI_NODE_LIGHT
Light source nodes (spot_light, etc)
Definition: ai_node_entry.h:40

To write all nodes of all types, use:

AiASSWrite(universe, "everything.ass", AI_NODE_ALL, false);
#define AI_NODE_ALL
Bitmask including all node types, used by AiASSWrite()
Definition: ai_node_entry.h:49

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

◆ AiASSWriteWithMetadata()

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

◆ AiASSLoad()

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

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