AiUniverse API

Methods

AI_API bool AiUniverseIsActive ()
 Check whether the universe is active or not. More...
 
AI_API bool AiUniverseCacheFlush (int cache_flags)
 Flush one or several caches in the current universe. More...
 
AI_API AtNodeAiUniverseGetOptions ()
 Fetches the global options node. More...
 
AI_API AtNodeAiUniverseGetCamera ()
 Fetches the currently active camera node. More...
 
AI_API AtBBox AiUniverseGetSceneBounds ()
 Returns the bounding box of the scene. More...
 
AI_API AtNodeIterator * AiUniverseGetNodeIterator (unsigned int node_mask)
 Creates a new node iterator and resets it to the first node in the scene. More...
 
AI_API AtNodeEntryIterator * AiUniverseGetNodeEntryIterator (unsigned int node_mask)
 Creates a new node entry iterator and resets it to the first installed node entry. More...
 
AI_API AtAOVIterator * AiUniverseGetAOVIterator ()
 Creates a new AOV iterator and resets it to the first entry. More...
 

Node Iterator API

AI_API void AiNodeIteratorDestroy (AtNodeIterator *iter)
 Destroys a node iterator when it is no longer needed. More...
 
AI_API AtNodeAiNodeIteratorGetNext (AtNodeIterator *iter)
 Returns current node and points node iterator to the next node. More...
 
AI_API bool AiNodeIteratorFinished (const AtNodeIterator *iter)
 Returns true if there are no more nodes to iterate over. More...
 

Node Entry Iterator API

AI_API void AiNodeEntryIteratorDestroy (AtNodeEntryIterator *iter)
 Destroys a node entry iterator when it is no longer needed. More...
 
AI_API AtNodeEntryAiNodeEntryIteratorGetNext (AtNodeEntryIterator *iter)
 Returns current node entry and points node entry iterator to the next node entry. More...
 
AI_API bool AiNodeEntryIteratorFinished (const AtNodeEntryIterator *iter)
 Returns true if there are no more node entries to iterate over. More...
 

AOV Iterator API

AI_API void AiAOVIteratorDestroy (AtAOVIterator *iter)
 Destroys a AOV iterator when it is no longer needed. More...
 
AI_API const AtAOVEntryAiAOVIteratorGetNext (AtAOVIterator *iter)
 Returns current AOV entry and points AOV iterator to the next AOV. More...
 
AI_API bool AiAOVIteratorFinished (const AtAOVIterator *iter)
 Returns true if there are no more AOV entries to iterate over. More...
 

Cache Types

#define AI_CACHE_TEXTURE   0x0001
 Flushes all texturemaps.
 
#define AI_CACHE_HAIR_DIFFUSE   0x0004
 Flushes hair diffuse cache.
 
#define AI_CACHE_BACKGROUND   0x0008
 Flushes all skydome importance tables for background.
 
#define AI_CACHE_QUAD   0x0010
 Flushes all quad lights importance tables.
 
#define AI_CACHE_ALL   0xFFFF
 Flushes all cache types simultaneously.
 

Detailed Description

The AiUniverse API provides access to global information about the scene. There is only one universe at any given time.

Function Documentation

AI_API bool AiUniverseIsActive ( )

Check whether the universe is active or not.

This function is typically used to detect whether we are inside an AiBegin() / AiEnd() block.

Returns
true if there is an active universe. This can only be false if called outside of an AiBegin() / AiEnd() block.
AI_API bool AiUniverseCacheFlush ( int  cache)

Flush one or several caches in the current universe.

This function will release all memory associated with a cached resource. The next time that the resource is accessed, it will get reloaded or recomputed. This is useful in interactive rendering; occasionally, a texture map would need to be modified or updated in the middle of a relighting session.

Parameters
cachea bitmask specifying the cache types to be flushed
Returns
true if the cache was flushed succesfully, false if rendering is still in progress
AI_API AtNode* AiUniverseGetOptions ( )

Fetches the global options node.

Will return NULL if the scene does not exist yet.

Returns
pointer to the global options node
AI_API AtNode* AiUniverseGetCamera ( )

Fetches the currently active camera node.

Will return NULL if the scene does not exist, if the camera has not been set or if the linked node is not a camera.

Returns
pointer to the active camera node
AI_API AtBBox AiUniverseGetSceneBounds ( )

Returns the bounding box of the scene.

Note that this box may be conservative in the presence of "infinite" primitives or procedurals. If the scene has not been created yet, this will return an empty box containing the origin.

Returns
scene bounding box
AI_API AtNodeIterator* AiUniverseGetNodeIterator ( unsigned int  node_mask)

Creates a new node iterator and resets it to the first node in the scene.

Parameters
node_maskbitmask of node types, e.g AI_NODE_ALL, AI_NODE_LIGHT | AI_NODE_SHADER, etc.
Returns
a node iterator over the given type of nodes
See Also
AiNodeIteratorDestroy, AiNodeIteratorGetNext
AI_API AtNodeEntryIterator* AiUniverseGetNodeEntryIterator ( unsigned int  node_mask)

Creates a new node entry iterator and resets it to the first installed node entry.

Parameters
node_maskbitmask of node types, e.g AI_NODE_ALL, AI_NODE_LIGHT | AI_NODE_SHADER, etc.
Returns
a node entry iterator over the given type of nodes
See Also
AiNodeEntryIteratorDestroy, AiNodeEntryIteratorGetNext
AI_API AtAOVIterator* AiUniverseGetAOVIterator ( )

Creates a new AOV iterator and resets it to the first entry.

Returns
a AOV iterator over all registered AOVs
See Also
AiAOVIteratorDestroy, AiAOVIteratorGetNext
AI_API void AiNodeIteratorDestroy ( AtNodeIterator *  iter)

Destroys a node iterator when it is no longer needed.

Parameters
iternode iterator that will be deallocated
AI_API AtNode* AiNodeIteratorGetNext ( AtNodeIterator *  iter)

Returns current node and points node iterator to the next node.

This function is designed to be used inside a loop, as illustrated by the following example:

AtNodeIterator *iter = AiUniverseGetNodeIterator(AI_NODE_ALL);
while (!AiNodeIteratorFinished(iter))
{
// do something with node ...
}
Parameters
itera node iterator
Returns
the node pointed by the iterator, or NULL if there are no more nodes to iterate over
AI_API bool AiNodeIteratorFinished ( const AtNodeIterator *  iter)

Returns true if there are no more nodes to iterate over.

Parameters
itera node iterator
Returns
true if the node iterator has moved past the last node
AI_API void AiNodeEntryIteratorDestroy ( AtNodeEntryIterator *  iter)

Destroys a node entry iterator when it is no longer needed.

Parameters
iternode entry iterator that will be deallocated
AI_API AtNodeEntry* AiNodeEntryIteratorGetNext ( AtNodeEntryIterator *  iter)

Returns current node entry and points node entry iterator to the next node entry.

This function is designed to be used inside a loop, as illustrated by the following example:

AtNodeEntryIterator *iter = AiUniverseGetNodeEntryIterator(AI_NODE_ALL);
{
// do something with node_entry ...
}
Parameters
itera node entry iterator
Returns
the node entry pointed by the iterator, or NULL if there are no more node entries to iterate over
AI_API bool AiNodeEntryIteratorFinished ( const AtNodeEntryIterator *  iter)

Returns true if there are no more node entries to iterate over.

Parameters
itera node entry iterator
Returns
true if the node entry iterator has moved past the last node entry
AI_API void AiAOVIteratorDestroy ( AtAOVIterator *  iter)

Destroys a AOV iterator when it is no longer needed.

Parameters
iterAOV iterator that will be deallocated
AI_API const AtAOVEntry* AiAOVIteratorGetNext ( AtAOVIterator *  iter)

Returns current AOV entry and points AOV iterator to the next AOV.

This function is designed to be used inside a loop, as illustrated by the following example:

AtAOVIterator* iter = AiUniverseGetAOVIterator();
while (!AiAOVIteratorFinished(iter))
{
AtAOVEntry* aov_entry = AiAOVIteratorGetNext(iter);
// do something with aov_entry ...
}
Parameters
iterAOV iterator
Returns
the AOV pointed by the iterator, or NULL if there are no more AOV entries to iterate over
AI_API bool AiAOVIteratorFinished ( const AtAOVIterator *  iter)

Returns true if there are no more AOV entries to iterate over.

Parameters
itera AOV iterator
Returns
true if the AOV iterator has moved past the last AOV

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