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
83struct AtMetadataStore;
84
122#define AiCreateFuncs(_name, _type) \
123AI_API void AiMetaDataSet##_name (AtNodeEntry* nentry, const AtString param, const AtString name, _type value); \
124inline void AiMetaDataSet##_name (AtNodeEntry* nentry, const char* param, const char* name, _type value) \
125{ \
126 AiMetaDataSet##_name(nentry, AtString(param), AtString(name), value); \
127} \
128
129AiCreateFuncs(Bool, bool)
130AiCreateFuncs(Int, int)
131AiCreateFuncs(Flt, float)
132AiCreateFuncs(RGB, AtRGB)
133AiCreateFuncs(RGBA, AtRGBA)
134AiCreateFuncs(Vec, AtVector)
135AiCreateFuncs(Vec2, AtVector2)
136AiCreateFuncs(Str, AtString)
137#undef AiCreateFuncs
138
139inline void AiMetaDataSetStr(AtNodeEntry* nentry, const char* param, const char* name, const char* value)
140{
141 AiMetaDataSetStr(nentry, param, name, AtString(value));
142}
143
144/* \} */
145
172#define AiCreateFuncs(_name, _type) \
173AI_API bool AiMetaDataGet##_name(const AtNodeEntry* nentry, const AtString param, const AtString name, _type* value);\
174inline AI_DEPRECATED bool AiMetaDataGet##_name(const AtNodeEntry* nentry, const char* param, const char* name, _type* value) \
175{ \
176 return AiMetaDataGet##_name(nentry, AtString(param), AtString(name), value); \
177}
178
179AiCreateFuncs(Bool, bool)
180AiCreateFuncs(Int, int)
181AiCreateFuncs(Flt, float)
182AiCreateFuncs(RGB, AtRGB)
183AiCreateFuncs(RGBA, AtRGBA)
184AiCreateFuncs(Vec, AtVector)
185AiCreateFuncs(Vec2, AtVector2)
186AiCreateFuncs(Str, AtString)
187#undef AiCreateFuncs
188
189/* \} */
190
212#define AiCreateFuncs(_name, _type) \
213AI_API void AiMetadataStoreSet##_name(AtMetadataStore* mds, const AtString name, _type value); \
214AI_API void AiMetadataStoreParamSet##_name(AtMetadataStore* mds, const AtString param, const AtString name, _type value);
215
216AiCreateFuncs(Bool, bool)
217AiCreateFuncs(Int, int)
218AiCreateFuncs(Flt, float)
219AiCreateFuncs(RGB, AtRGB)
220AiCreateFuncs(Vec, AtVector)
221AiCreateFuncs(Vec2, AtVector2)
222AiCreateFuncs(Str, AtString)
223#undef AiCreateFuncs
224
225inline void AiMetadataStoreSetStr(AtMetadataStore* mds, const AtString name, const char* value)
226{
227 AiMetadataStoreSetStr(mds, name, AtString(value));
228}
229
230inline void AiMetadataStoreParamSetStr(AtMetadataStore* mds, const AtString param, const AtString name, const char* value)
231{
232 AiMetadataStoreParamSetStr(mds, param, name, AtString(value));
233}
234
235/* \} */
236
259#define AiCreateFuncs(_name, _type) \
260AI_API bool AiMetadataStoreGet##_name(const AtMetadataStore* mds, const AtString name, _type* value); \
261AI_API bool AiMetadataStoreParamGet##_name(const AtMetadataStore* mds, const AtString param, const AtString name, _type* value);
262
263AiCreateFuncs(Bool, bool)
264AiCreateFuncs(Int, int)
265AiCreateFuncs(Flt, float)
266AiCreateFuncs(RGB, AtRGB)
267AiCreateFuncs(Vec, AtVector)
268AiCreateFuncs(Vec2, AtVector2)
269AiCreateFuncs(Str, AtString)
270#undef AiCreateFuncs
271
272/* \} */
273
280
287
294AI_API bool AiMetadataStoreLoadFromASS(AtMetadataStore* mds, const char* file);
295
302AI_API AtMetaDataIterator* AiMetadataStoreGetIterator(const AtMetadataStore* mds);
303
312AI_API AtMetaDataIterator* AiMetadataStoreGetIteratorRecursive(const AtMetadataStore* mds, const char* param, bool recursive);
313
332AI_API bool AiMetaDataLoadFile(const char* filename);
333
334/* \} */
335
336#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:54
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

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