API for writing and reading node metadata. More...
#include "ai_node_entry.h"#include "ai_vector.h"#include "ai_color.h"#include "ai_api.h"#include "ai_string.h"Go to the source code of this file.
Functions | |||||||||||||
Node Metadata Retrieval | |||||||||||||
These functions allow client code to examine metadata attached to specific parameters or to a node. Following on the example above: char* desc;
bool success = AiMetaDataGetStr(entry, "Kd", "description", &desc)
if (success)
printf("\nDescription for parameter Kd: %s", desc);
AI_API AI_PURE const AtNodeEntry * AiNodeEntryLookUp(const AtString name) Look up a node entry from a name string. Definition: ai_nodeentry.cpp:43 This represents a node type in Arnold.
| |||||||||||||
| __attribute__ ((deprecated)) bool AiMetaDataGetBool(const AtNodeEntry *nentry | |||||||||||||
AtMetadataStore Writing | |||||||||||||
These functions allow attaching auxiliary information to a specific metadata store. Here is an example: AiMetadataStoreSetFlt(mds, AtString("temperature"), 21.0f);
Note that you should never pass allocated strings, as they will not be freed.
| |||||||||||||
| void | AiMetadataStoreSetStr (AtMetadataStore *mds, const AtString name, const char *value) | ||||||||||||
| void | AiMetadataStoreParamSetStr (AtMetadataStore *mds, const AtString param, const AtString name, const char *value) | ||||||||||||
AtMetadataStore Retrieval | |||||||||||||
These functions allow client code to get metadata entries within a specific metadata store. Following on the example above: char* author;
bool success = AiMetadataStoreGetStr(mds, "author", &author)
if (success)
printf("\nAuthor: %s", author);
| |||||||||||||
| AI_API AtMetadataStore * | AiMetadataStore () | ||||||||||||
| Creates a new metadata store. More... | |||||||||||||
| AI_API void | AiMetadataStoreDestroy (AtMetadataStore *mds) | ||||||||||||
| Destroys a metadata store object. More... | |||||||||||||
| AI_API bool | AiMetadataStoreLoadFromASS (AtMetadataStore *mds, const char *file) | ||||||||||||
| Load embedded metadata from an .ass file into a metadata store. More... | |||||||||||||
| AI_API AtMetaDataIterator * | AiMetadataStoreGetIterator (const AtMetadataStore *mds) | ||||||||||||
| Creates a new metadata iterator that traverses all global metadata. More... | |||||||||||||
| AI_API AtMetaDataIterator * | AiMetadataStoreGetIteratorRecursive (const AtMetadataStore *mds, const char *param, bool recursive) | ||||||||||||
| Creates a new metadata iterator pointing at the first matching entry. More... | |||||||||||||
| AI_API bool | AiMetaDataLoadFile (const char *filename) | ||||||||||||
| Load a metadata file. More... | |||||||||||||
Node metadata writing | |||||||||
These functions allow attaching auxiliary information about specific parameters or the node itself. This information is stored within the AtNodeEntry. These methods may only be called within the node_parameters function where the parameters are declared. Here is an example: {
AiParameterFlt("Kd", 0.7f);
// create a lower-case synonym for parameter Kd
AiMetaDataSetStr(nentry, "Kd", "_synonym", "kd");
// describe the parameter
AiMetaDataSetStr(nentry, "Kd", "description",
"Diffuse coefficient");
// describe the node itself
AiMetaDataSetStr(nentry, NULL, "description",
"This is a simple lambert shader for illustration purposes");
}
Note that you should never pass allocated strings, as they will not be freed.
| |||||||||
| const AtString | param | ||||||||
| const AtString const AtString | name | ||||||||
| const AtString const AtString bool | value { return AiMetaDataGetBool (nentry, AtString(param), AtString(name), value) | ||||||||
| __attribute__ ((visibility("default"))) void AiMetaDataSetBool(AtNodeEntry *nentry | |||||||||
| void | AiMetaDataSetBool (AtNodeEntry *nentry, const char *param, const char *name, bool value) | ||||||||
| void | AiMetaDataSetInt (AtNodeEntry *nentry, const char *param, const char *name, int value) | ||||||||
| void | AiMetaDataSetFlt (AtNodeEntry *nentry, const char *param, const char *name, float value) | ||||||||
| void | AiMetaDataSetRGB (AtNodeEntry *nentry, const char *param, const char *name, AtRGB value) | ||||||||
| void | AiMetaDataSetRGBA (AtNodeEntry *nentry, const char *param, const char *name, AtRGBA value) | ||||||||
| void | AiMetaDataSetVec (AtNodeEntry *nentry, const char *param, const char *name, AtVector value) | ||||||||
| void | AiMetaDataSetVec2 (AtNodeEntry *nentry, const char *param, const char *name, AtVector2 value) | ||||||||
| void | AiMetaDataSetStr (AtNodeEntry *nentry, const char *param, const char *name, AtString value) | ||||||||
| void | AiMetaDataSetStr (AtNodeEntry *nentry, const char *param, const char *name, const char *value) | ||||||||
API for writing and reading node metadata.