Syntax
- setMaterial(material)
Parameters
- material—string[]A string array containing key-value pairs in the form of [ attr-name0, value0, attr-name1, value1, ... ]. The names of the material attributes are without the "material." prefix.
Description
The setMaterial operation sets the material attributes of the current shape's material according to material. This operation allows for setting of multiple (all) material attributes in one operation.
The result will be the same as using set() to set each material attribute individually.
Related
Example 1
Using setMaterial() to set a number of material attributes in one operation.
|
Example 2: Loading a .cgamat file
Using setMaterial() and readMaterial() to load a .cgamat material description (including textures) from disk.
Note:The CityEngine CGA Material Encoder allows for writing cgamat files via model export. |
Example 3: Using a CSV file to define a material
Material descriptions in CSV files can be used via readStringTable().
|