Data Structures
AtNodeEntry API

AtNodeEntry methods. More...

Data Structures

struct  AtCommonMethods
 Methods common to all nodes. More...
 
struct  AtNodeMethods
 Node methods. More...
 
struct  AtMetaDataEntry
 
struct  AtNodeEntry
 This represents a node type in Arnold. More...
 

Node Types

#define AI_NODE_UNDEFINED   0x0000
 Undefined type.
 
#define AI_NODE_OPTIONS   0x0001
 Options node (following the "singleton" pattern, there is only one options node)
 
#define AI_NODE_CAMERA   0x0002
 Camera nodes (persp_camera, fisheye_camera, etc)
 
#define AI_NODE_LIGHT   0x0004
 Light source nodes (spot_light, etc)
 
#define AI_NODE_SHAPE   0x0008
 Geometry nodes (sphere, polymesh, etc)
 
#define AI_NODE_SHADER   0x0010
 Shader nodes (lambert, etc)
 
#define AI_NODE_OVERRIDE   0x0020
 EXPERIMENTAL: override nodes support "delayed parameter overrides" for procedural nodes.
 
#define AI_NODE_DRIVER   0x0040
 Output driver nodes (driver_tiff, etc)
 
#define AI_NODE_FILTER   0x0080
 Pixel sample filter nodes (box_filter, etc.
 
#define AI_NODE_COLOR_MANAGER   0x0800
 Color manager nodes (Syncolor, OCIO, etc)
 
#define AI_NODE_OPERATOR   0x1000
 Operator plug-in nodes.
 
#define AI_NODE_ALL   0xFFFF
 Bitmask including all node types, used by AiASSWrite()
 

Derived Node Types

#define AI_NODE_SHAPE_PROCEDURAL   0x0100
 Procedural shape node.
 
#define AI_NODE_SHAPE_VOLUME   0x0200
 Volume shape node.
 
#define AI_NODE_SHAPE_IMPLICIT   0x0400
 Implicit shape node.
 

AtNodeEntry Methods

AI_API AI_PURE const AtNodeEntryAiNodeEntryLookUp (const AtString name)
 Look up a node entry from a name string. More...
 
AI_API AI_PURE const char * AiNodeEntryGetName (const AtNodeEntry *nentry)
 Return the name of the given AtNodeEntry. More...
 
AI_API AI_PURE AtString AiNodeEntryGetNameAtString (const AtNodeEntry *nentry)
 Return the name of the given AtNodeEntry as an AtString. More...
 
AI_API AI_PURE int AiNodeEntryGetType (const AtNodeEntry *nentry)
 Return the type of the given AtNodeEntry. More...
 
AI_API AI_PURE const char * AiNodeEntryGetTypeName (const AtNodeEntry *nentry)
 Return the type of the given AtNodeEntry as a string. More...
 
AI_API AI_PURE int AiNodeEntryGetDerivedType (const AtNodeEntry *nentry)
 Return the derived type of the given AtNodeEntry. More...
 
AI_API AI_PURE const char * AiNodeEntryGetDerivedTypeName (const AtNodeEntry *nentry)
 Return the derived type of the given AtNodeEntry as a string, if applicable. More...
 
AI_API AI_PURE int AiNodeEntryGetOutputType (const AtNodeEntry *nentry)
 Return the output type of the given AtNodeEntry. More...
 
AI_API AI_PURE const char * AiNodeEntryGetFilename (const AtNodeEntry *nentry)
 Return the filename (so/dll path) of an AtNodeEntry. More...
 
AI_API AI_PURE const char * AiNodeEntryGetVersion (const AtNodeEntry *nentry)
 Return the version that this node was linked with. More...
 
AI_API AI_PURE int AiNodeEntryGetCount (const AtNodeEntry *nentry)
 Return the number of instances of a particular node. More...
 
AI_API AI_PURE int AiNodeEntryGetNumParams (const AtNodeEntry *nentry)
 Return the number of parameters of a given AtNodeEntry. More...
 
AI_API AI_PURE const AtParamEntry * AiNodeEntryGetParameter (const AtNodeEntry *nentry, int i)
 Return the i'th parameter in an AtNodeEntry. More...
 
AI_API AI_PURE const AtParamEntry * AiNodeEntryLookUpParameter (const AtNodeEntry *nentry, const AtString param)
 Look up a parameter in a node entry from a name string. More...
 
AI_DEPRECATED const AtNodeEntryAiNodeEntryLookUp (const char *name)
 
AI_DEPRECATED const AtParamEntry * AiNodeEntryLookUpParameter (const AtNodeEntry *nentry, const char *param)
 
AI_API AtParamIterator * AiNodeEntryGetParamIterator (const AtNodeEntry *nentry)
 Creates and returns a new AtParamIterator for this node entry. More...
 
AI_API AtMetaDataIterator * AiNodeEntryGetMetaDataIterator (const AtNodeEntry *nentry, const char *param=NULL)
 Creates and returns a new AtMetaDataIterator for this node entry. More...
 
AI_API void AiNodeEntryInstall (int type, uint8_t output_type, const char *name, const char *filename, const AtNodeMethods *methods, const char *version)
 Install a new node in the system. More...
 
AI_API void AiNodeEntryUninstall (const char *name)
 Uninstall a node from the system. More...
 

AtParamIterator Methods

AI_API void AiParamIteratorDestroy (AtParamIterator *iter)
 Destroys a param iterator when it is no longer needed. More...
 
AI_API const AtParamEntry * AiParamIteratorGetNext (AtParamIterator *iter)
 Returns current param entry and points param iterator to the next one. More...
 
AI_API bool AiParamIteratorFinished (const AtParamIterator *iter)
 Returns true if there are no more parameters to iterate over. More...
 

AtMetaDataIterator Methods

AI_API void AiMetaDataIteratorDestroy (AtMetaDataIterator *iter)
 Destroys a metadata iterator when it is no longer needed. More...
 
AI_API const AtMetaDataEntryAiMetaDataIteratorGetNext (AtMetaDataIterator *iter)
 Returns current metadata entry and points metadata iterator to the next one. More...
 
AI_API bool AiMetaDataIteratorFinished (const AtMetaDataIterator *iter)
 Returns true if there is no more metadata to iterate over. More...
 

Detailed Description

AtNodeEntry methods.

Arnold AtNodeEntry class provides information about the structure of a given node type. For a discussion of Arnold's object-oriented system of pluggable nodes, please refer to AtNode API.

Function Documentation

AI_API AI_PURE const AtNodeEntry* AiNodeEntryLookUp ( const AtString  name)

Look up a node entry from a name string.

Search all installed node entries for a given node name. If found, return a pointer to the node entry.

Parameters
nameinput node name (such as "lambert")
Returns
pointer to the AtNodeEntry that matches the input name
AI_API AI_PURE const char* AiNodeEntryGetName ( const AtNodeEntry nentry)

Return the name of the given AtNodeEntry.

Parameters
nentryinput node entry
Returns
name string, or NULL if nentry is NULL
AI_API AI_PURE AtString AiNodeEntryGetNameAtString ( const AtNodeEntry nentry)

Return the name of the given AtNodeEntry as an AtString.

Parameters
nentryinput node entry
Returns
AtString name string, or NULL AtString if nentry is NULL
AI_API AI_PURE int AiNodeEntryGetType ( const AtNodeEntry nentry)

Return the type of the given AtNodeEntry.

Parameters
nentryinput node entry
Returns
type of node (AI_NODE_SHADER, etc), or 0 if nentry is NULL
AI_API AI_PURE const char* AiNodeEntryGetTypeName ( const AtNodeEntry nentry)

Return the type of the given AtNodeEntry as a string.

For example, a node of type AI_NODE_LIGHT would return "light"

Parameters
nentryinput node entry
Returns
type string, or NULL if nentry is NULL
AI_API AI_PURE int AiNodeEntryGetDerivedType ( const AtNodeEntry nentry)

Return the derived type of the given AtNodeEntry.

Parameters
nentryinput node entry
Returns
derived type of node (AI_NODE_SHAPE_VOLUME, etc), or 0 if nentry is either NULL or a non-derived type
AI_API AI_PURE const char* AiNodeEntryGetDerivedTypeName ( const AtNodeEntry nentry)

Return the derived type of the given AtNodeEntry as a string, if applicable.

For example, a node of type AI_NODE_SHAPE_VOLUME would return "volume"

Parameters
nentryinput node entry
Returns
type string, or NULL if nentry is NULL or not a derived type
AI_API AI_PURE int AiNodeEntryGetOutputType ( const AtNodeEntry nentry)

Return the output type of the given AtNodeEntry.

Parameters
nentryinput node entry
Returns
output type (AI_TYPE_RGB, etc)
AI_API AI_PURE const char* AiNodeEntryGetFilename ( const AtNodeEntry nentry)

Return the filename (so/dll path) of an AtNodeEntry.

Parameters
nentryinput node entry
Returns
string with the path ot the dynamic library where this node was installed from, NULL if this is a built-in node
AI_API AI_PURE const char* AiNodeEntryGetVersion ( const AtNodeEntry nentry)

Return the version that this node was linked with.

There are restrictions as to what previously-compiled plug-in nodes can function with a given Arnold library. For example, a plug-in node compiled and linked with Arnold 3.1.x can't be loaded (installed) on Arnold 3.2.x.

Parameters
nentryinput node entry
Returns
string containing the Arnold version that this node was linked with.
AI_API AI_PURE int AiNodeEntryGetCount ( const AtNodeEntry nentry)

Return the number of instances of a particular node.

Parameters
nentryinput node entry
Returns
number of nodes of this type that have been created so far (for example, how many "sphere" nodes exist in memory), or 0 if nentry is NULL
AI_API AI_PURE int AiNodeEntryGetNumParams ( const AtNodeEntry nentry)

Return the number of parameters of a given AtNodeEntry.

Parameters
nentryinput node entry
Returns
number of parameters in the node, or 0 if nentry is NULL
AI_API AI_PURE const AtParamEntry* AiNodeEntryGetParameter ( const AtNodeEntry nentry,
int  i 
)

Return the i'th parameter in an AtNodeEntry.

Parameters
nentryinput node entry
iparameter index, in 0..num_params-1
Returns
the i'th parameter entry in this node
AI_API AI_PURE const AtParamEntry* AiNodeEntryLookUpParameter ( const AtNodeEntry nentry,
const AtString  name 
)

Look up a parameter in a node entry from a name string.

Searches the parameter entries of a given node looking for a parameter that matches the name string. If found, returns a pointer to the parameter entry.

Parameters
nentryinput node entry
nameparameter name that we are looking for (such as "samples")
Returns
pointer to the AtParamEntry that matches the parameter name, or NULL if either nentry is NULL or the parameter is not found
AI_API AtParamIterator* AiNodeEntryGetParamIterator ( const AtNodeEntry nentry)

Creates and returns a new AtParamIterator for this node entry.

Parameters
nentrynode entry whose parameters will be iterated over
Returns
an iterator over all built-in parameters on this node entry
AI_API AtMetaDataIterator* AiNodeEntryGetMetaDataIterator ( const AtNodeEntry nentry,
const char *  param 
)

Creates and returns a new AtMetaDataIterator for this node entry.

Parameters
nentrynode entry whose metadata will be iterated over
paramselects a specific parameter to get its metadata or NULL for node metadata
Returns
an iterator over metadata on this node entry
AI_API void AiNodeEntryInstall ( int  type,
uint8_t  output_type,
const char *  name,
const char *  filename,
const AtNodeMethods methods,
const char *  version 
)

Install a new node in the system.

An Arnold-based app can use this function to extend the renderer with custom types of nodes, such as new shaders or cameras. The user must provide the node type, name, and methods. Successive calls to AiNode() can create nodes of this type.

Examples:

1 AiNodeEntryInstall(AI_NODE_SHAPE, AI_TYPE_UNDEFINED, "sphere", "<built-in>", SphMethods, AI_VERSION);
2 AiNodeEntryInstall(AI_NODE_SHADER, AI_TYPE_FLOAT, "fBm_noise", "./shaders/fBm_noise.so", fBmMethods, AI_VERSION);
Parameters
typetype of node (AI_NODE_CAMERA, AI_NODE_SHADER, etc)
output_typefor shader nodes, which can link their output to the input of another shader, this is the output type (AI_TYPE_RGB, etc)
namename string of the newly created node type
filenamestring identifier that hints at how this node was created, usually the path of the dynamic library where it was loaded from but, in general, it should be set to whatever makes sense for the app that's installing the node
methodspointer to the node methods
versionArnold version string that this node is linked with
AI_API void AiNodeEntryUninstall ( const char *  name)

Uninstall a node from the system.

Remove the node with the given name from the system. Successive calls to AiNode() using this node name will fail.

Parameters
namename of the node to be removed from the system
AI_API void AiParamIteratorDestroy ( AtParamIterator *  iter)

Destroys a param iterator when it is no longer needed.

Parameters
iterparam iterator that will be deallocated
AI_API const AtParamEntry* AiParamIteratorGetNext ( AtParamIterator *  iter)

Returns current param entry and points param iterator to the next one.

This function is designed to be used inside a loop, as illustrated by the following example, which prints all the built-in parameters of a given AtNodeEntry:

1 AtParamIterator *iter = AiNodeEntryGetParamIterator(nentry);
2 while (!AiParamIteratorFinished(iter))
3 {
4  AtParamEntry *pentry = AiParamIteratorGetNext(iter);
5  printf("%s\n", AiParamGetName(pentry));
6 }
7 AiParamIteratorDestroy(iter);
Parameters
itera param iterator
Returns
the current param entry pointed by the iterator, or NULL if there are no more parameters to iterate over
AI_API bool AiParamIteratorFinished ( const AtParamIterator *  iter)

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

Parameters
itera param iterator
Returns
true if the param iterator has moved past the last parameter
AI_API void AiMetaDataIteratorDestroy ( AtMetaDataIterator *  iter)

Destroys a metadata iterator when it is no longer needed.

Parameters
itermetadata iterator that will be deallocated
AI_API const AtMetaDataEntry* AiMetaDataIteratorGetNext ( AtMetaDataIterator *  iter)

Returns current metadata entry and points metadata iterator to the next one.

This function is designed to be used inside a loop, as illustrated by the following example, which prints all the metadata of a given AtNodeEntry:

1 AtMetaDataIterator *iter = AiNodeEntryGetMetaDataIterator(nentry);
2 while (!AiMetaDataIteratorFinished(iter))
3 {
4  const AtMetaDataEntry *entry = AiMetaDataIteratorGetNext(iter);
5  printf("%s\n", entry->name);
6 }
7 AiMetaDataIteratorDestroy(iter);
Parameters
itera metadata iterator
Returns
the current metadata entry pointed by the iterator, or NULL if there is no more metadata to iterate over
AI_API bool AiMetaDataIteratorFinished ( const AtMetaDataIterator *  iter)

Returns true if there is no more metadata to iterate over.

Parameters
itera metadata iterator
Returns
true if the metadata iterator has moved past the last entry

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