Mdl_arguments Class Reference
[Utility]
Description
Arguments of an MDL material or function
Functions
- Object all()
- Returns all attributes defined on this element. More...
- attach( String name, Mdl_function_callMdl_attached_function attach_function, String field_name)
- Explicitly attach a function to the named argument. More...
- attached( String name)
- Returns whether the given argument is attached to another MDL function. More...
- bool exists( String name)
- Whether an argument exists on this element or not. More...
- varying get( String name)
- Returns the value of the named argument. More...
- String get_type( String name)
- Returns the type of the named argument. More...
- set( String name, varying value)
- Sets the value of the named argument. More...
Functions
- Object Mdl_arguments.all()
-
Returns all attributes defined on this element.
Returns
object containing all attributes.
- Mdl_arguments.attach( String name, Mdl_function_callMdl_attached_function attach_function, String field_name)
-
Explicitly attach a function to the named argument. If field_name is provided then the it is assumed that the function returns a structure and the given output field will be connected to the function
Parameters
- name
- the name of the argument to attach to.
- attach_function
- the function to attach
- field_name
- the field on the function's output structure to attach, optional.
- Mdl_arguments.attached( String name)
-
Returns whether the given argument is attached to another MDL function.
Parameters
- name
- the name of the argument
- bool Mdl_arguments.exists( String name)
-
Whether an argument exists on this element or not.
Parameters
- name
- the name of the argument
Returns
true if it exists, false otherwise.
- varying Mdl_arguments.get( String name)
-
Returns the value of the named argument.
Parameters
- name
- the name of the argument to get.
Returns
the value of the argument or undefined if it doesn't exist.
- String Mdl_arguments.get_type( String name)
-
Returns the type of the named argument.
Parameters
- name
- the name of the argument whose type should be returned.
Returns
the typename of the argument or undefined if the argument does not exist.
- Mdl_arguments.set( String name, varying value)
-
Sets the value of the named argument. If value does not match the type of the existing argument this function will throw.
Parameters
- name
- the name of the argument to set.
- value
- the value of the argument. Material arguments can be set by passing either an Mdl_material_instance or the name of the material. To attach functions to an argument use the attach function or pass an instance of Mdl_attached_function or Mdl_function_call as value.