mdl_create_variants
Creates a new MDL module containing variants.
arguments
- "module_name" : String
The fully-qualified MDL name of the new module (including package names, starts with "::"). Note that if the module already exists then the command will not replace it.
- "variant_data" : Array
A array of maps containing variant data in a similar format described in the documentation for mi::neuraylib::IMdl_factory::create_variants(). However module_name is replaced with element_name since this command allows creation of variants from both definitions of materials and functions as well as instances of materials and function calls. The format of the defaults property follows that of the arguments parameter for the create_material_instance_from_definition and create_function_call_from_definition commands. Note that the annotations property currently only supports the ::anno::description(string), ::anno::key_words(string[N]), ::anno::display_name(string), ::anno::author(string) and ::anno::copyright_notice(string) annotations.
Example:[ { "variant_name": "example_green", "element_name": "mdl::nvidia::core_definitions::flex_material", "defaults": { "reflectivity": 0.1, "is_metal": { "value": true }, "base_color": { "call": { "name": "example_func_call", "field": "tint" } } }, "annotations": { "::anno::description(string)": { "description": "A green example variant" }, "::anno::key_words(string[N])": { "words": [ "example", "variant" ] }, "::anno::display_name(string)": { "name": "Example Green" }, "::anno::author(string)": { "name": "migenius" }, "::anno::copyright_notice(string)": { "copyright": "migenius 2020" } } } ]