The AiUniverse API provides access to global information about the scene. There is only one universe at any given time.
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
-
cache | a 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_mask | bitmask 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_mask | bitmask 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 |
( |
| ) |
|
AI_API void AiNodeIteratorDestroy |
( |
AtNodeIterator * |
iter | ) |
|
Destroys a node iterator when it is no longer needed.
- Parameters
-
iter | node 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:
- Parameters
-
- 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
-
- 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
-
iter | node 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:
- Parameters
-
iter | a 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
-
iter | a 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
-
iter | AOV 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:
- Parameters
-
- 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
-
- Returns
- true if the AOV iterator has moved past the last AOV