Meta Data - Arnold for Cinema4d
Behavior and appearance (e.g. UI) of Arnold nodes and parameters can be adjusted via meta data. Meta data can be defined directly in the code via the AiMetaDataSet API functions, or in .mtd meta data files, which have to be located next to the binary with the same name.
my_custom_shaders.dll
my_custom_shaders.mtdNode entry meta data
| Name | Type | Description | 
|---|---|---|
| label / c4d_label | STRING | Label displayed on the UI. If not defined, a default label is displayed based on the node entry name. | 
| c4d_classification | STRING | Defines the class of shader nodes, which tells which context the shader can be used in. Available values are: 
 | 
| c4d_command | INT | Unique id obtained from Plugin Café. If defined, the plugin registers a command to create the given shader node directly from the Material Browser menu. | 
| c4d_enable_presets | BOOL | Displays the Presets tab on the shader UI that allows users to load, save and delete shader presets. | 
| c4d_helpURL | STRING | Link to the documentation of the given node, displayed when the user clicks Show Help... | 
| c4d_menu | STRING | Defines the path of shader nodes in the Node Editor and Material Browser menu. For instance "math/matrix" will display the shader under the Matrix group under Math in the shader tree of the Node Editor. | 
| c4d_preview_type | STRING | Material preview type of shader nodes: 
 | 
| c4d_preview_scene | STRING | Custom preview scene of shader nodes, without the .c4d extension (e.g. My Preview Scene). The scene file must be located in the library/matpreview folder. | 
| c4d_visible_in_editor | BOOL | If false, the given shader node is not available in the Node Editor (default is true). | 
Parameter meta data
| Name | Type | Description | 
|---|---|---|
| c4d_array_type | STRING | Defines how to export an array type parameter. 
 | 
| c4d_enum_menu | STRING | Available for enum type parameters. Semicolon separated list of values in order to displayed in the combo box. Custom labels can be defined, such as item=label. '-' means a separator. enum1=label1;enum2;-;enum3=label3;enum4 | 
| c4d_exportable | BOOL | If false the parameter will not be exported to Arnold (default is true). | 
| c4d_hide_enum | STRING | Available for enum type parameters. Semicolon separated list of values which should not be displayed in the combo box. | 
| c4d_main_port | BOOL | If true this parameter is defined as the main port for drop insertion in the Node Editor (default is false). | 
| c4d_port_visible_on_new_node | BOOL | If true the parameter is visible on a newly created node in the Node Editor (default is false). | 
| c4d_presets | STRING | List of parameter presets displayed in a popup button. Requires 'preset' widget type. | 
| c4d_visible | BOOL | If false the parameter will not be visible on the UI and will not be exported to Arnold (default is true). | 
| c4d_visible_in_tag | BOOL | If false the parameter will not be visible in the Arnold Parameters tag (default is true). | 
| c4d_widget / widget | STRING | Custom widget displayed on the UI. 
 c4d_presetsmeta data. | 
| default | INT / FLOAT / STRING | Overrides default value of the parameter. | 
| label / c4d_label | STRING | Label displayed on the UI. If not defined, a default label is displayed based on the name of the parameter. | 
| max | INT / FLOAT | Maximum value of the parameter. If both min/softmin and max/sotfmax is defined then a slider is displayed on the UI. | 
| min | INT / FLOAT | Minimum value of the parameter. If both min/softmin and max/sotfmax is defined then a slider is displayed on the UI. | 
| sensitivity / c4d_step | INT / FLOAT | Step size when modifying numbers via slider or arrows on the UI. | 
| softmax / slidermax | INT / FLOAT | Maximum value of the slider displayed on the UI. User can add higher values (up to max) manually. | 
| softmin / slidermin | INT / FLOAT | Minimum value of the slider displayed on the UI. User can add lower values (down to min) manually. | 
| units | STRING | Units displayed on the UI. 
 | 
Example
This example adds sliders to the bias, gain and contrast parameters of the range shader and defines a custom vector/color selection widget as the input parameter.
[node range]
 [attr input]
  c4d_widget STRING "vcolor"
 [attr bias]
  min FLOAT 0
  max FLOAT 1
  c4d_step FLOAT 0.01
 [attr gain]
  min FLOAT 0
  max FLOAT 1
  c4d_step FLOAT 0.01
 [attr contrast]
  softmin FLOAT 0
  softmax FLOAT 2
  c4d_step FLOAT 0.01
Note, that meta data names have been changed in C4DtoA 4.4.0. Older versions use:
c4d.prefix instead ofc4d_, for instancec4d.menuinstead ofc4d_menu
c4d.gui_visibleinstead ofc4d_visible
c4d.tag_visibleinstead ofc4d_visible_in_tag
c4d.gui_typeinstead ofc4d_widgetwith integer values instead of string
slidermin,slidermax,sensitivityandunitsare not supported
