22struct AtUserParamEntry;
23struct AtUserParamIterator;
71#define node_parameters \
72static void Parameters(AtList* params, AtNodeEntry* nentry)
75#define node_plugin_initialize \
76static bool PluginInitialize(void** plugin_data); \
77AI_OPTIONAL_METHOD_INSTALL(ai_common_mtds, PluginInitialize) \
78static bool PluginInitialize(void** plugin_data)
81#define node_plugin_cleanup \
82static void PluginCleanup(void* plugin_data); \
83AI_OPTIONAL_METHOD_INSTALL(ai_common_mtds, PluginCleanup) \
84static void PluginCleanup(void* plugin_data)
87#define node_initialize \
88static void Initialize(AtRenderSession* render_session, AtNode* node)
92static void Update(AtRenderSession* render_session, AtNode* node)
96static void Finish(AtNode* node)
100AI_EXPORT_LIB bool NodeLoader(int i, AtNodeLib* node)
104#define AI_INSTANCE_COMMON_METHODS \
109static AtCommonMethods ai_common_mtds = { \
119#define AI_INSTANCE_COMMON_SHAPE_METHODS \
121static AtCommonMethods ai_common_mtds = { \
161#ifdef AI_CPU_COMPILER
184AI_API
void AiNodeSetByte (
AtNode* node,
const AtString param, uint8_t val);
186AI_API
void AiNodeSetUInt (
AtNode* node,
const AtString param,
unsigned int val);
187AI_API
void AiNodeSetBool (
AtNode* node,
const AtString param,
bool val);
188AI_API
void AiNodeSetFlt (
AtNode* node,
const AtString param,
float val);
189AI_API
void AiNodeSetPtr (
AtNode* node,
const AtString param,
void* val);
193AI_API
void AiNodeSetRGB (
AtNode* node,
const AtString param,
float r,
float g,
float b);
194AI_API
void AiNodeSetRGBA (
AtNode* node,
const AtString param,
float r,
float g,
float b,
float a);
195AI_API
void AiNodeSetVec (
AtNode* node,
const AtString param,
float x,
float y,
float z);
196AI_API
void AiNodeSetVec2 (
AtNode* node,
const AtString param,
float x,
float y);
198#ifdef AI_CPU_COMPILER
200inline AI_DEPRECATED
void AiNodeSetByte (
AtNode* node,
const char* param, uint8_t val) { AiNodeSetByte (node,
AtString(param), val); }
202inline AI_DEPRECATED
void AiNodeSetUInt (
AtNode* node,
const char* param,
unsigned int val) { AiNodeSetUInt (node,
AtString(param), val); }
203inline AI_DEPRECATED
void AiNodeSetBool (
AtNode* node,
const char* param,
bool val) { AiNodeSetBool (node,
AtString(param), val); }
204inline AI_DEPRECATED
void AiNodeSetFlt (
AtNode* node,
const char* param,
float val) { AiNodeSetFlt (node,
AtString(param), val); }
205inline AI_DEPRECATED
void AiNodeSetPtr (
AtNode* node,
const char* param,
void* val) { AiNodeSetPtr (node,
AtString(param), val); }
207inline AI_DEPRECATED
void AiNodeSetMatrix(
AtNode* node,
const char* param,
AtMatrix val) { AiNodeSetMatrix(node,
AtString(param), val); }
208inline AI_DEPRECATED
void AiNodeSetStr (
AtNode* node,
const char* param,
const char* str) { AiNodeSetStr (node,
AtString(param),
AtString(str)); }
209inline AI_DEPRECATED
void AiNodeSetRGB (
AtNode* node,
const char* param,
float r,
float g,
float b) { AiNodeSetRGB (node,
AtString(param), r, g, b); }
210inline AI_DEPRECATED
void AiNodeSetRGBA (
AtNode* node,
const char* param,
float r,
float g,
float b,
float a) { AiNodeSetRGBA (node,
AtString(param), r, g, b, a); }
211inline AI_DEPRECATED
void AiNodeSetVec (
AtNode* node,
const char* param,
float x,
float y,
float z) { AiNodeSetVec (node,
AtString(param), x, y, z); }
212inline AI_DEPRECATED
void AiNodeSetVec2 (
AtNode* node,
const char* param,
float x,
float y) { AiNodeSetVec2 (node,
AtString(param), x, y); }
222AI_API uint8_t AiNodeGetByte (
const AtNode* node,
const AtString param);
224AI_API
unsigned int AiNodeGetUInt (
const AtNode* node,
const AtString param);
225AI_API
bool AiNodeGetBool (
const AtNode* node,
const AtString param);
226AI_API
float AiNodeGetFlt (
const AtNode* node,
const AtString param);
232AI_API
void* AiNodeGetPtr (
const AtNode* node,
const AtString param);
233AI_API AtArray* AiNodeGetArray (
const AtNode* node,
const AtString param);
236#ifdef AI_CPU_COMPILER
238inline AI_DEPRECATED uint8_t AiNodeGetByte (
const AtNode* node,
const char* param) {
return AiNodeGetByte (node,
AtString(param)); }
240inline AI_DEPRECATED
unsigned int AiNodeGetUInt (
const AtNode* node,
const char* param) {
return AiNodeGetUInt (node,
AtString(param)); }
241inline AI_DEPRECATED
bool AiNodeGetBool (
const AtNode* node,
const char* param) {
return AiNodeGetBool (node,
AtString(param)); }
242inline AI_DEPRECATED
float AiNodeGetFlt (
const AtNode* node,
const char* param) {
return AiNodeGetFlt (node,
AtString(param)); }
243inline AI_DEPRECATED
AtRGB AiNodeGetRGB (
const AtNode* node,
const char* param) {
return AiNodeGetRGB (node,
AtString(param)); }
244inline AI_DEPRECATED
AtRGBA AiNodeGetRGBA (
const AtNode* node,
const char* param) {
return AiNodeGetRGBA (node,
AtString(param)); }
245inline AI_DEPRECATED
AtVector AiNodeGetVec (
const AtNode* node,
const char* param) {
return AiNodeGetVec (node,
AtString(param)); }
246inline AI_DEPRECATED
AtVector2 AiNodeGetVec2 (
const AtNode* node,
const char* param) {
return AiNodeGetVec2 (node,
AtString(param)); }
247inline AI_DEPRECATED
AtString AiNodeGetStr (
const AtNode* node,
const char* param) {
return AiNodeGetStr (node,
AtString(param)); }
248inline AI_DEPRECATED
void* AiNodeGetPtr (
const AtNode* node,
const char* param) {
return AiNodeGetPtr (node,
AtString(param)); }
249inline AI_DEPRECATED AtArray* AiNodeGetArray (
const AtNode* node,
const char* param) {
return AiNodeGetArray (node,
AtString(param)); }
250inline AI_DEPRECATED
AtMatrix AiNodeGetMatrix(
const AtNode* node,
const char* param) {
return AiNodeGetMatrix(node,
AtString(param)); }
256#define AiNodeDeclareGPULocalData(type) namespace {}
DLL export prefix for API functions (necessary for multi-platform development)
AtNodeEntry type and methods.
AtString class for fast comparisons.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
AI_API AtNode * AiNode(AtUniverse *universe, const AtString nentry_name, const AtString name=AtString(), const AtNode *parent=NULL)
Create a fresh instantiation of a node in a specific Arnold universe.
Definition: ai_nodes.cpp:317
AI_API void AiNodeSetLocalData(AtNode *node, void *data)
Sets local data pointer in the node.
Definition: ai_nodes.cpp:268
AI_API AtNode * AiNodeGetLinkOutput(const AtNode *node, const char *input, int &output_param, int &output_comp)
Returns the node, node output, and output component connected to a given node input parameter.
Definition: ai_nodes.cpp:551
AI_API AI_PURE AtNode * AiNodeGetParent(const AtNode *node)
Returns the procedural parent of a node.
Definition: ai_nodes.cpp:1028
AI_API bool AiNodeUnlink(AtNode *node, const char *input)
Removes a connection from a node input parameter.
Definition: ai_nodes.cpp:469
AI_API AI_PURE const char * AiNodeGetName(const AtNode *node)
Return the node's name.
Definition: ai_nodes.cpp:227
AI_API const AtUserParamEntry * AiUserParamIteratorGetNext(AtUserParamIterator *iter)
Returns current user param entry and points user param iterator to the next one.
Definition: ai_nodes.cpp:200
AI_API AI_PURE bool AiNodeIs(const AtNode *node, AtString str)
Compare the node type against a string.
Definition: ai_nodes.cpp:578
AI_API bool AiNodeLink(AtNode *src, const char *input, AtNode *target)
Creates a connection between two shader nodes.
Definition: ai_nodes.cpp:385
AI_API AtNode * AiNodeGetLink(const AtNode *node, const char *input, int *comp=NULL)
Returns the node connected to a given node input parameter.
Definition: ai_nodes.cpp:521
AI_API AI_PURE bool AiNodeIsDisabled(const AtNode *node)
Check if a node has been disabled or not.
Definition: ai_nodes.cpp:1009
AI_API bool AiUserParamIteratorFinished(const AtUserParamIterator *iter)
Returns true if there are no more user parameters to iterate over.
Definition: ai_nodes.cpp:211
AI_API AI_PURE bool AiNodeIsLinked(const AtNode *node, const char *input)
Returns true if the input parameter is linked.
Definition: ai_nodes.cpp:496
AI_API AtUserParamIterator * AiNodeGetUserParamIterator(const AtNode *node)
Creates and returns a new AtUserParamIterator for this node.
Definition: ai_nodes.cpp:159
AI_API AI_PURE AtUniverse * AiNodeGetUniverse(const AtNode *node)
Returns the universe a node belongs to.
Definition: ai_nodes.cpp:1041
AI_API void AiNodeSetArray(AtNode *node, const AtString param, AtArray *val)
Set the value of an array parameter.
Definition: ai_nodes.cpp:913
AI_API void AiNodeSetAttributes(AtNode *node, const char *attributes)
Set the parameters of a node through an attributes string.
Definition: ai_nodes.cpp:977
AI_API void AiNodeReplace(AtNode *old_node, AtNode *new_node, bool remove)
Replace an existing node with another, updating all references to that node.
Definition: ai_nodes.cpp:700
AI_API AI_PURE AtNode * AiNodeLookUpByName(const AtUniverse *universe, const AtString name, const AtNode *parent=NULL)
Search for a specific node in the given universe using the specified name string (which can be a simp...
Definition: ai_nodes.cpp:92
AI_API int AiNodeGetInt(const AtNode *node, const AtString param)
Return the value of an integer parameter.
Definition: ai_nodes.cpp:794
AI_API void AiUserParamIteratorDestroy(AtUserParamIterator *iter)
Destroys a user param iterator when it is no longer needed.
Definition: ai_nodes.cpp:169
AI_API AI_PURE void * AiNodeGetLocalData(const AtNode *node)
Returns a pointer to the local data in the node.
Definition: ai_nodes.cpp:249
AI_API AI_PURE const AtUserParamEntry * AiNodeLookUpUserParameter(const AtNode *node, const AtString param)
Return the user-defined parameter entry that matches a given name.
Definition: ai_nodes.cpp:147
AI_API AtNode * AiNodeClone(const AtNode *node, const AtString new_name=AtString(), const AtNode *parent=NULL)
Return an exact clone of a source node.
Definition: ai_nodes.cpp:652
AI_API AI_PURE void * AiNodeGetPluginData(const AtNode *node)
Returns a pointer to the per plugin data for the node type, as created in the node_plugin_initialize ...
Definition: ai_nodes.cpp:286
AI_API bool AiNodeDeclare(AtNode *node, const AtString param, const char *declaration)
Declare a user-defined parameter for this node.
Definition: ai_nodes.cpp:756
AI_API bool AiNodeDestroy(AtNode *node)
Destroy an existing node.
Definition: ai_nodes.cpp:676
AI_API AI_PURE const AtNodeEntry * AiNodeGetNodeEntry(const AtNode *node)
Return the node entry for this node.
Definition: ai_nodes.cpp:238
AI_API void AiNodeResetParameter(AtNode *node, const char *param)
Reset a node parameter to its default value and remove any links to that parameter.
Definition: ai_nodes.cpp:614
AI_API bool AiNodeLinkOutput(AtNode *src, const char *output, AtNode *target, const char *input)
Creates a connection between two shader nodes.
Definition: ai_nodes.cpp:444
AI_API void AiNodeReset(AtNode *node)
Reset all node parameters to their default values and remove any input links.
Definition: ai_nodes.cpp:593
AI_API void AiNodeSetDisabled(AtNode *node, bool disabled)
Disable or enable any node in the scene.
Definition: ai_nodes.cpp:997
AI_API void AiNodeSetInt(AtNode *node, const AtString param, int val)
Set the value of an integer parameter.
Definition: ai_nodes.cpp:782
Definition: ai_matrix.h:30
This represents a node type in Arnold.
This represents a node in Arnold.
RGB color + alpha.
Definition: ai_color.h:267
RGB color.
Definition: ai_color.h:32
This represents a universe in Arnold.
2D point
Definition: ai_vector.h:255
3D point (single precision)
Definition: ai_vector.h:30