Share

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.mtd

Node 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:

  • generic (default): the shader can be used in any contexts.
  • surface: shades the surface of a shape.
  • environment: defines a scene background (options.background).
  • atmosphere: defines light scattering effect in the scene (options.atmosphere).
  • light_filter: modifies output of a light source.
  • displacement: defines displacement effect of a polymesh.
  • texture: image or procedural texture shader.
  • volume: shades a volumetric object.
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:

  • surface
  • texture
  • hair
  • volume
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.

  • standard: Standard array parameter, not motion blur dependent (default).
  • motion_blur: Motion blur dependent array containing a scalar value per each motion key.
  • motion_blur_array: Motion blur dependent array containing multiple values per each motion key.
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.

  • filename: File selection.
  • directory: Directory selection.
  • save: File selection to save a file.
  • texture: File selection of texture inputs.
  • search_path: Text field to input a list of folders.
  • shader_link: Cinema 4D BaseShader link GUI.
  • material_link: Input field to link a material node.
  • object_link: Input field to link an object node.
  • camera_link: Input field to link a camera node.
  • additional_material_link: Original input with an additional child material link input.
  • arnold_shader_link: Arnold shader link GUI (color / texture / material link).
  • curve_editor: Spline GUI.
  • visibility: Checkbox per ray visibility flags.
  • vcolor: Input field with an option to switch between vector and color type.
  • save_path: Text field with an option to use the native Save path or specify a custom path.
  • color_space: Color space (all custom options).
  • color_space_no_options: Color space (no custom options).
  • color_space_auto: Color space (only 'auto' custom option).
  • filter_list: Filter combo box exported to a string parameter.
  • material_list: Input field to link multiple material nodes.
  • object_list: Input field to link multiple object nodes.
  • camera_list: Input field to link multiple camera nodes.
  • multiline: Multiline text editor.
  • param_name: String exported as an Arnold parameter name (e.g. special characters are replaced, etc.).
  • float_per_channel: Separate input for each color or vector component (R/G/B/A).
  • checkbox: Displays a checkbox widget over a numeric parameter, which is exported to 0 or 1. Note, that string type parameters are currently not supported, only numeric.
  • mapper: Displays a combo box with the key:value pairs defined in the options meta data. Works for integer and string type parameters.
[attr myparam]

widget STRING "mapper"

options STRING "item1:1|item2:2|item100:100"
  • popup: Displays a combo box of the values defined in the options meta data. Works for integer and string type parameters. In case of integers, the exported value is generated by a hash function from the label. To specify exact ids, use the "mapper" widget instead.
  • [attr myparam]

    widget STRING "popup"

    options STRING "item1|item2|item100"
  • preset: Displays presets in a popup button next to the parameter input. Presets are defined via the c4d_presets meta data.
  • null: The parameter is not displayed on the UI. Same as c4d_visible = false.
  • 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.

    • meter: Distant unit type. The actual unit depends on the Cinema 4D project settings.
    • degree: Angle type parameter displayed and exported as degrees.
    • radian: Angle type parameter displayed as degrees but exported as radians.
    • percent: Value displayed as a percentage (e.g. 0.1 = 10%).

    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 of c4d_, for instance c4d.menu instead of c4d_menu
    • c4d.gui_visible instead of c4d_visible
    • c4d.tag_visible instead of c4d_visible_in_tag
    • c4d.gui_type instead of c4d_widget with integer values instead of string
    • slidermin, slidermax, sensitivity and units are not supported

    Was this information helpful?