ai_node_entry.h
Go to the documentation of this file.
1// Copyright 2021 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_ALL 0xFFFF
49/* \}*/
50
54#define AI_NODE_SHAPE_PROCEDURAL 0x0100
55#define AI_NODE_SHAPE_VOLUME 0x0200
56#define AI_NODE_SHAPE_IMPLICIT 0x0400
57/* \}*/
58
66struct AtNodeEntry;
67
72{
73 bool (*PluginInitialize)(void**);
74 void (*PluginCleanup )(void*);
75 void (*Parameters )(AtList*, AtNodeEntry*);
76 void (*Initialize )(AtRenderSession*, AtNode*);
77 void (*Update )(AtRenderSession*, AtNode*);
78 void (*Finish )(AtNode*);
79};
80
85{
87 const void* dmethods;
88};
89
91{
92 AtString name;
93 AtString param;
94 uint8_t type;
95 AtParamValue value;
96};
97
102AI_API AI_PURE const AtNodeEntry* AiNodeEntryLookUp (const AtString name);
103AI_API AI_PURE const char* AiNodeEntryGetName (const AtNodeEntry* nentry);
104AI_API AI_PURE AtString AiNodeEntryGetNameAtString (const AtNodeEntry* nentry);
105AI_API AI_PURE int AiNodeEntryGetType (const AtNodeEntry* nentry);
106AI_API AI_PURE const char* AiNodeEntryGetTypeName (const AtNodeEntry* nentry);
107AI_API AI_PURE int AiNodeEntryGetDerivedType (const AtNodeEntry* nentry);
108AI_API AI_PURE const char* AiNodeEntryGetDerivedTypeName(const AtNodeEntry* nentry);
109AI_API AI_PURE int AiNodeEntryGetOutputType (const AtNodeEntry* nentry);
110AI_API AI_PURE const char* AiNodeEntryGetFilename (const AtNodeEntry* nentry);
111AI_API AI_PURE const char* AiNodeEntryGetVersion (const AtNodeEntry* nentry);
112AI_API AI_PURE int AiNodeEntryGetCount (const AtNodeEntry* nentry);
113AI_API AI_PURE int AiNodeEntryGetNumParams (const AtNodeEntry* nentry);
114AI_API AI_PURE const AtParamEntry* AiNodeEntryGetParameter (const AtNodeEntry* nentry, int i);
115AI_API AI_PURE const AtParamEntry* AiNodeEntryLookUpParameter (const AtNodeEntry* nentry, const AtString param);
116AI_API AI_PURE int AiNodeEntryGetNumOutputs (const AtNodeEntry* nentry);
117AI_API AI_PURE const AtParamEntry* AiNodeEntryGetOutput (const AtNodeEntry* nentry, int i);
118AI_API AI_PURE const AtParamEntry* AiNodeEntryLookUpOutput (const AtNodeEntry* nentry, const AtString param);
119
120#ifdef AI_CPU_COMPILER
121// these are slower than the AtString versions
122inline AI_DEPRECATED const AtNodeEntry* AiNodeEntryLookUp(const char* name) { return AiNodeEntryLookUp(AtString(name)); }
123inline AI_DEPRECATED const AtParamEntry* AiNodeEntryLookUpParameter(const AtNodeEntry* nentry, const char* param) { return AiNodeEntryLookUpParameter(nentry, AtString(param)); }
124#endif
125
126AI_API AtParamIterator* AiNodeEntryGetParamIterator (const AtNodeEntry* nentry);
127AI_API AtMetaDataIterator* AiNodeEntryGetMetaDataIterator(const AtNodeEntry* nentry, const char* param = NULL);
128AI_API void AiNodeEntryInstall (int type, uint8_t output_type, const char* name, const char* filename, const AtNodeMethods* methods, const char* version);
129AI_API void AiNodeEntryUninstall (const char* name);
130/* \}*/
131
136AI_API void AiParamIteratorDestroy(AtParamIterator* iter);
137AI_API const AtParamEntry* AiParamIteratorGetNext(AtParamIterator* iter);
138AI_API bool AiParamIteratorFinished(const AtParamIterator* iter);
139/* \}*/
140
145AI_API void AiMetaDataIteratorDestroy(AtMetaDataIterator* iter);
146AI_API const AtMetaDataEntry* AiMetaDataIteratorGetNext(AtMetaDataIterator* iter);
147AI_API bool AiMetaDataIteratorFinished(const AtMetaDataIterator* iter);
148/* \}*/
149
150/*\}*/
Node parameters.
AtString class for fast comparisons.
Actual parameter value for each supported type.
Definition: ai_params.h:106
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
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:307
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:258
AI_API AI_PURE int AiNodeEntryGetDerivedType(const AtNodeEntry *nentry)
Return the derived type of the given AtNodeEntry.
Definition: ai_nodeentry.cpp:117
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:276
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:350
AI_API AI_PURE int AiNodeEntryGetNumOutputs(const AtNodeEntry *nentry)
Return the number of outputs of a given AtNodeEntry.
Definition: ai_nodeentry.cpp:186
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:198
AI_API AI_PURE int AiNodeEntryGetNumParams(const AtNodeEntry *nentry)
Return the number of parameters of a given AtNodeEntry.
Definition: ai_nodeentry.cpp:163
const AtCommonMethods * cmethods
common methods
Definition: ai_node_entry.h:86
AI_API AI_PURE int AiNodeEntryGetOutputType(const AtNodeEntry *nentry)
Return the output type of the given AtNodeEntry.
Definition: ai_nodeentry.cpp:152
const void * dmethods
derived methods
Definition: ai_node_entry.h:87
AI_API AI_PURE const char * AiNodeEntryGetFilename(const AtNodeEntry *nentry)
Return the filename (so/dll path) of an AtNodeEntry.
Definition: ai_nodeentry.cpp:210
AI_API AI_PURE const AtParamEntry * AiNodeEntryGetParameter(const AtNodeEntry *nentry, int i)
Return the i'th parameter in an AtNodeEntry.
Definition: ai_nodeentry.cpp:175
AI_API void AiNodeEntryUninstall(const char *name)
Uninstall a node from the system.
Definition: ai_nodeentry.cpp:328
AI_API const AtParamEntry * AiParamIteratorGetNext(AtParamIterator *iter)
Returns current param entry and points param iterator to the next one.
Definition: ai_nodeentry.cpp:376
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:130
AI_API AI_PURE int AiNodeEntryGetCount(const AtNodeEntry *nentry)
Return the number of instances of a particular node.
Definition: ai_nodeentry.cpp:240
AI_API bool AiParamIteratorFinished(const AtParamIterator *iter)
Returns true if there are no more parameters to iterate over.
Definition: ai_nodeentry.cpp:390
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:402
AI_API AtParamIterator * AiNodeEntryGetParamIterator(const AtNodeEntry *nentry)
Creates and returns a new AtParamIterator for this node entry.
Definition: ai_nodeentry.cpp:340
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:227
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:72
Definition: ai_node_entry.h:91
This represents a node type in Arnold.
Node methods.
Definition: ai_node_entry.h:85
This represents a node in Arnold.

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