ai_metadata.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_node_entry.h"
14#include "ai_vector.h"
15#include "ai_color.h"
16#include "ai_api.h"
17#include "ai_string.h"
18#ifdef AI_CPU_COMPILER
19
71struct AtMetadataStore;
72
110#define AiCreateFuncs(_name, _type) \
111AI_API void AiMetaDataSet##_name (AtNodeEntry* nentry, const AtString param, const AtString name, _type value); \
112inline void AiMetaDataSet##_name (AtNodeEntry* nentry, const char* param, const char* name, _type value) \
113{ \
114 AiMetaDataSet##_name(nentry, AtString(param), AtString(name), value); \
115} \
116
117AiCreateFuncs(Bool, bool)
118AiCreateFuncs(Int, int)
119AiCreateFuncs(Flt, float)
120AiCreateFuncs(RGB, AtRGB)
121AiCreateFuncs(RGBA, AtRGBA)
122AiCreateFuncs(Vec, AtVector)
123AiCreateFuncs(Vec2, AtVector2)
124AiCreateFuncs(Str, AtString)
125#undef AiCreateFuncs
126
127inline void AiMetaDataSetStr(AtNodeEntry* nentry, const char* param, const char* name, const char* value)
128{
129 AiMetaDataSetStr(nentry, param, name, AtString(value));
130}
131
132/* \} */
133
160#define AiCreateFuncs(_name, _type) \
161AI_API bool AiMetaDataGet##_name(const AtNodeEntry* nentry, const AtString param, const AtString name, _type* value);\
162inline AI_DEPRECATED bool AiMetaDataGet##_name(const AtNodeEntry* nentry, const char* param, const char* name, _type* value) \
163{ \
164 return AiMetaDataGet##_name(nentry, AtString(param), AtString(name), value); \
165}
166
167AiCreateFuncs(Bool, bool)
168AiCreateFuncs(Int, int)
169AiCreateFuncs(Flt, float)
170AiCreateFuncs(RGB, AtRGB)
171AiCreateFuncs(RGBA, AtRGBA)
172AiCreateFuncs(Vec, AtVector)
173AiCreateFuncs(Vec2, AtVector2)
174AiCreateFuncs(Str, AtString)
175#undef AiCreateFuncs
176
177/* \} */
178
200#define AiCreateFuncs(_name, _type) \
201AI_API void AiMetadataStoreSet##_name(AtMetadataStore* mds, const AtString name, _type value); \
202AI_API void AiMetadataStoreParamSet##_name(AtMetadataStore* mds, const AtString param, const AtString name, _type value);
203
204AiCreateFuncs(Bool, bool)
205AiCreateFuncs(Int, int)
206AiCreateFuncs(Flt, float)
207AiCreateFuncs(RGB, AtRGB)
208AiCreateFuncs(Vec, AtVector)
209AiCreateFuncs(Vec2, AtVector2)
210AiCreateFuncs(Str, AtString)
211#undef AiCreateFuncs
212
213inline void AiMetadataStoreSetStr(AtMetadataStore* mds, const AtString name, const char* value)
214{
215 AiMetadataStoreSetStr(mds, name, AtString(value));
216}
217
218inline void AiMetadataStoreParamSetStr(AtMetadataStore* mds, const AtString param, const AtString name, const char* value)
219{
220 AiMetadataStoreParamSetStr(mds, param, name, AtString(value));
221}
222
223/* \} */
224
247#define AiCreateFuncs(_name, _type) \
248AI_API bool AiMetadataStoreGet##_name(const AtMetadataStore* mds, const AtString name, _type* value); \
249AI_API bool AiMetadataStoreParamGet##_name(const AtMetadataStore* mds, const AtString param, const AtString name, _type* value);
250
251AiCreateFuncs(Bool, bool)
252AiCreateFuncs(Int, int)
253AiCreateFuncs(Flt, float)
254AiCreateFuncs(RGB, AtRGB)
255AiCreateFuncs(Vec, AtVector)
256AiCreateFuncs(Vec2, AtVector2)
257AiCreateFuncs(Str, AtString)
258#undef AiCreateFuncs
259
260/* \} */
261
268
275
282AI_API bool AiMetadataStoreLoadFromASS(AtMetadataStore* mds, const char* file);
283
290AI_API AtMetaDataIterator* AiMetadataStoreGetIterator(const AtMetadataStore* mds);
291
300AI_API AtMetaDataIterator* AiMetadataStoreGetIteratorRecursive(const AtMetadataStore* mds, const char* param, bool recursive);
301
320AI_API bool AiMetaDataLoadFile(const char* filename);
321
322/* \} */
323
324#endif // AI_CPU_COMPILER
DLL export prefix for API functions (necessary for multi-platform development)
Color types and utilities.
AtNodeEntry type and methods.
AtString class for fast comparisons.
Vector math types, operators and utilities.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
AI_API bool AiMetaDataLoadFile(const char *filename)
Load a metadata file.
Definition: ai_metadata.cpp:44
AI_API AtMetaDataIterator * AiMetadataStoreGetIterator(const AtMetadataStore *mds)
Creates a new metadata iterator that traverses all global metadata.
Definition: ai_metadata.cpp:112
AI_API bool AiMetadataStoreLoadFromASS(AtMetadataStore *mds, const char *file)
Load embedded metadata from an .ass file into a metadata store.
Definition: ai_metadata.cpp:128
AI_API void AiMetadataStoreDestroy(AtMetadataStore *mds)
Destroys a metadata store object.
Definition: ai_metadata.cpp:107
AI_API AtMetadataStore * AiMetadataStore()
Creates a new metadata store.
Definition: ai_metadata.cpp:102
AI_API AtMetaDataIterator * AiMetadataStoreGetIteratorRecursive(const AtMetadataStore *mds, const char *param, bool recursive)
Creates a new metadata iterator pointing at the first matching entry.
Definition: ai_metadata.cpp:120
This structure holds a generic list of metadata items, each of which could optionally be associated t...
This represents a node type in Arnold.
RGB color + alpha.
Definition: ai_color.h:267
RGB color.
Definition: ai_color.h:32
2D point
Definition: ai_vector.h:255
3D point (single precision)
Definition: ai_vector.h:30

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