Metadata Files - Arnold Developer Guide
Arnold includes support for specification of nodes and attributes metadata using separate text files.
Each library implementing Arnold nodes could have an associated metadata file, with the same name of the library and the extension ".mtd". For example, a library called mtoa_shaders.dll would have a corresponding mtoa_shaders.mtd. This metadata files will be automatically loaded when the library is first loaded. As a special case, for built-in Arnold nodes, the name of the metadata file is arnold.mtd, as this library has different names on different platforms.
Also, there could be additional metadata files, which can be loaded on demand, by using the API function provided in ai_metadata.h (or ai_metadata.py for Python):
AI_API bool AiMetaDataLoadFile(const char* filename);
This file could be used for example to override values or add additional metadata to built-in nodes, such as MtoA does for Arnold built-ins.
Finally, third-party plugin developers could include a metadata file with their library, in a file with the same name as the library, but ".mtd" extension. In this metadata file, they could include information for all plugins (MtoA for now), so that the same file would work for all of them.
File Format
The format of the metadata files is like this:
# Arnold test metaData file
[node wireframe]
desc STRING "This shader can be used to display the edge structure of a geometry."
[attr line_width] min INT -3
max INT 100
softmin INT 0
softmax INT 1
desc STRING "Sets width of the lines used to display edges."
[attr fill_color] desc STRING "Color used for the faces."
[attr line_color] desc STRING "Color used for the lines used to display edges."
[attr raster_space] desc STRING "Uses screen space to measure line width."
[attr edge_type] desc STRING "Selects base geometry element for edge display."
[attr example] maya.test1 FLOAT -0.63
maya.test2 BOOL true
maya.test3 BOOL 0
maya.test4 RGB 0 1 0
maya.test5 POINT2 -1 489
maya.test6 INT 0x09ABCDEF
There could be any number of nodes in the file. There can also be multiple node sections for the same node (metadata will be applied in the order they are found in the file).
As a convention, we are using metadata names starting with "maya." for Maya specific metadata, and "xsi." for XSI specific metadata. There are some other conventions for standard metadata elements that would be published on a separate document.
Maya
For MtoA specific metadata, see Creating a Shader for Maya.