ai_node_entry.h
Go to the documentation of this file.
1// Copyright 2025 Autodesk, Inc. All rights reserved.
2//
3// Use of this software is subject to the terms of the Autodesk license
4// agreement provided at the time of installation or download, or which
5// otherwise accompanies this software in either electronic or hard copy form.
6
12#pragma once
13#include "ai_params.h"
14#include "ai_string.h"
15
16// forward declarations
17class AtRenderSession;
18struct AtNode;
19struct AtList;
20struct AtParamIterator;
21struct AtMetaDataIterator;
22
37#define AI_NODE_UNDEFINED 0x0000
38#define AI_NODE_OPTIONS 0x0001
39#define AI_NODE_CAMERA 0x0002
40#define AI_NODE_LIGHT 0x0004
41#define AI_NODE_SHAPE 0x0008
42#define AI_NODE_SHADER 0x0010
43#define AI_NODE_OVERRIDE 0x0020
44#define AI_NODE_DRIVER 0x0040
45#define AI_NODE_FILTER 0x0080
46#define AI_NODE_COLOR_MANAGER 0x0800
47#define AI_NODE_OPERATOR 0x1000
48#define AI_NODE_IMAGER 0x2000
49#define AI_NODE_RENDER_OUTPUT 0x4000
50#define AI_NODE_ALL 0xFFFF
51/* \}*/
52
56#define AI_NODE_SHAPE_PROCEDURAL 0x0100
57#define AI_NODE_SHAPE_VOLUME 0x0200
58#define AI_NODE_SHAPE_IMPLICIT 0x0400
59/* \}*/
60
68struct AtNodeEntry;
69
74{
75 bool (*PluginInitialize)(void**);
76 void (*PluginCleanup )(void*);
77 void (*Parameters )(AtList*, AtNodeEntry*);
78 void (*Initialize )(AtRenderSession*, AtNode*);
79 void (*Update )(AtRenderSession*, AtNode*);
80 void (*Finish )(AtNode*);
81};
82
87{
89 const void* dmethods;
90};
91
93{
94 AtString name;
95 AtString param;
96 uint8_t type;
97 AtParamValue value;
98};
99
104AI_API AI_PURE const AtNodeEntry* AiNodeEntryLookUp (const AtString name);
105AI_API AI_PURE const char* AiNodeEntryGetName (const AtNodeEntry* nentry);
106AI_API AI_PURE AtString AiNodeEntryGetNameAtString (const AtNodeEntry* nentry);
107AI_API AI_PURE int AiNodeEntryGetType (const AtNodeEntry* nentry);
108AI_API AI_PURE const char* AiNodeEntryGetTypeName (const AtNodeEntry* nentry);
109AI_API AI_PURE int AiNodeEntryGetDerivedType (const AtNodeEntry* nentry);
110AI_API AI_PURE const char* AiNodeEntryGetDerivedTypeName(const AtNodeEntry* nentry);
111AI_API AI_PURE int AiNodeEntryGetOutputType (const AtNodeEntry* nentry);
112AI_API AI_PURE const char* AiNodeEntryGetFilename (const AtNodeEntry* nentry);
113AI_API AI_PURE const char* AiNodeEntryGetVersion (const AtNodeEntry* nentry);
114AI_API AI_PURE int AiNodeEntryGetCount (const AtNodeEntry* nentry);
115AI_API AI_PURE int AiNodeEntryGetNumParams (const AtNodeEntry* nentry);
116AI_API AI_PURE const AtParamEntry* AiNodeEntryGetParameter (const AtNodeEntry* nentry, int i);
117AI_API AI_PURE const AtParamEntry* AiNodeEntryLookUpParameter (const AtNodeEntry* nentry, const AtString param);
118AI_API AI_PURE int AiNodeEntryGetNumOutputs (const AtNodeEntry* nentry);
119AI_API AI_PURE const AtParamEntry* AiNodeEntryGetOutput (const AtNodeEntry* nentry, int i);
120AI_API AI_PURE const AtParamEntry* AiNodeEntryLookUpOutput (const AtNodeEntry* nentry, const AtString param);
121
122#ifdef AI_CPU_COMPILER
123// these are slower than the AtString versions
124inline AI_DEPRECATED const AtNodeEntry* AiNodeEntryLookUp(const char* name) { return AiNodeEntryLookUp(AtString(name)); }
125inline AI_DEPRECATED const AtParamEntry* AiNodeEntryLookUpParameter(const AtNodeEntry* nentry, const char* param) { return AiNodeEntryLookUpParameter(nentry, AtString(param)); }
126#endif
127
128AI_API AtParamIterator* AiNodeEntryGetParamIterator (const AtNodeEntry* nentry);
129AI_API AtMetaDataIterator* AiNodeEntryGetMetaDataIterator(const AtNodeEntry* nentry, const char* param = NULL);
130AI_API void AiNodeEntryInstall (int type, uint8_t output_type, const char* name, const char* filename, const AtNodeMethods* methods, const char* version);
131AI_API void AiNodeEntryUninstall (const char* name);
132/* \}*/
133
138AI_API void AiParamIteratorDestroy(AtParamIterator* iter);
139AI_API const AtParamEntry* AiParamIteratorGetNext(AtParamIterator* iter);
140AI_API bool AiParamIteratorFinished(const AtParamIterator* iter);
141/* \}*/
142
147AI_API void AiMetaDataIteratorDestroy(AtMetaDataIterator* iter);
148AI_API const AtMetaDataEntry* AiMetaDataIteratorGetNext(AtMetaDataIterator* iter);
149AI_API bool AiMetaDataIteratorFinished(const AtMetaDataIterator* iter);
150/* \}*/
151
152/*\}*/
Node parameters.
AtString class for fast comparisons.
Actual parameter value for each supported type.
Definition: ai_params.h:107
Arnold String allows for fast string comparisons.
Definition: ai_string.h:54
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.
Definition: ai_nodeentry.cpp:309
AI_API AI_PURE int AiNodeEntryGetType(const AtNodeEntry *nentry)
Return the type of the given AtNodeEntry.
Definition: ai_nodeentry.cpp:76
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.
Definition: ai_nodeentry.cpp:260
AI_API AI_PURE int AiNodeEntryGetDerivedType(const AtNodeEntry *nentry)
Return the derived type of the given AtNodeEntry.
Definition: ai_nodeentry.cpp:119
AI_API AI_PURE const AtParamEntry * AiNodeEntryLookUpOutput(const AtNodeEntry *nentry, const AtString param)
Look up an output parameter in a node entry from a name string.
Definition: ai_nodeentry.cpp:278
AI_API bool AiMetaDataIteratorFinished(const AtMetaDataIterator *iter)
Returns true if there is no more metadata to iterate over.
Definition: ai_metadata.cpp:176
AI_API void AiParamIteratorDestroy(AtParamIterator *iter)
Destroys a param iterator when it is no longer needed.
Definition: ai_nodeentry.cpp:352
AI_API AI_PURE int AiNodeEntryGetNumOutputs(const AtNodeEntry *nentry)
Return the number of outputs of a given AtNodeEntry.
Definition: ai_nodeentry.cpp:188
AI_API AI_PURE const AtParamEntry * AiNodeEntryGetOutput(const AtNodeEntry *nentry, int i)
Return the i'th output AtParamEntry in an AtNodeEntry.
Definition: ai_nodeentry.cpp:200
AI_API AI_PURE int AiNodeEntryGetNumParams(const AtNodeEntry *nentry)
Return the number of parameters of a given AtNodeEntry.
Definition: ai_nodeentry.cpp:165
const AtCommonMethods * cmethods
common methods
Definition: ai_node_entry.h:88
AI_API AI_PURE int AiNodeEntryGetOutputType(const AtNodeEntry *nentry)
Return the output type of the given AtNodeEntry.
Definition: ai_nodeentry.cpp:154
const void * dmethods
derived methods
Definition: ai_node_entry.h:89
AI_API AI_PURE const char * AiNodeEntryGetFilename(const AtNodeEntry *nentry)
Return the filename (so/dll path) of an AtNodeEntry.
Definition: ai_nodeentry.cpp:212
AI_API AI_PURE const AtParamEntry * AiNodeEntryGetParameter(const AtNodeEntry *nentry, int i)
Return the i'th parameter in an AtNodeEntry.
Definition: ai_nodeentry.cpp:177
AI_API void AiNodeEntryUninstall(const char *name)
Uninstall a node from the system.
Definition: ai_nodeentry.cpp:330
AI_API const AtParamEntry * AiParamIteratorGetNext(AtParamIterator *iter)
Returns current param entry and points param iterator to the next one.
Definition: ai_nodeentry.cpp:378
AI_API AI_PURE const char * AiNodeEntryGetName(const AtNodeEntry *nentry)
Return the name of the given AtNodeEntry.
Definition: ai_nodeentry.cpp:54
AI_API AI_PURE const char * AiNodeEntryGetDerivedTypeName(const AtNodeEntry *nentry)
Return the derived type of the given AtNodeEntry as a string, if applicable.
Definition: ai_nodeentry.cpp:132
AI_API AI_PURE int AiNodeEntryGetCount(const AtNodeEntry *nentry)
Return the number of instances of a particular node.
Definition: ai_nodeentry.cpp:242
AI_API bool AiParamIteratorFinished(const AtParamIterator *iter)
Returns true if there are no more parameters to iterate over.
Definition: ai_nodeentry.cpp:392
AI_API AI_PURE const AtNodeEntry * AiNodeEntryLookUp(const AtString name)
Look up a node entry from a name string.
Definition: ai_nodeentry.cpp:43
AI_API AtMetaDataIterator * AiNodeEntryGetMetaDataIterator(const AtNodeEntry *nentry, const char *param=NULL)
Creates and returns a new AtMetaDataIterator for this node entry.
Definition: ai_nodeentry.cpp:404
AI_API AtParamIterator * AiNodeEntryGetParamIterator(const AtNodeEntry *nentry)
Creates and returns a new AtParamIterator for this node entry.
Definition: ai_nodeentry.cpp:342
AI_API AI_PURE const char * AiNodeEntryGetTypeName(const AtNodeEntry *nentry)
Return the type of the given AtNodeEntry as a string.
Definition: ai_nodeentry.cpp:89
AI_API AI_PURE const char * AiNodeEntryGetVersion(const AtNodeEntry *nentry)
Return the version that this node was linked with.
Definition: ai_nodeentry.cpp:229
AI_API const AtMetaDataEntry * AiMetaDataIteratorGetNext(AtMetaDataIterator *iter)
Returns current metadata entry and points metadata iterator to the next one.
Definition: ai_metadata.cpp:165
AI_API AI_PURE AtString AiNodeEntryGetNameAtString(const AtNodeEntry *nentry)
Return the name of the given AtNodeEntry as an AtString.
Definition: ai_nodeentry.cpp:65
AI_API void AiMetaDataIteratorDestroy(AtMetaDataIterator *iter)
Destroys a metadata iterator when it is no longer needed.
Definition: ai_metadata.cpp:139
Methods common to all nodes.
Definition: ai_node_entry.h:74
Definition: ai_node_entry.h:93
This represents a node type in Arnold.
Node methods.
Definition: ai_node_entry.h:87
This represents a node in Arnold.

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