readMaterial function

Syntax

string[] readMaterial(filePath)

Parameters

filePath—string is the name of the material file to read. See Asset Search for information about search locations. Supported extensions are .cgamat and .mtl.

Note:

CityEngine CGA Material Encoder allows you to write cgamat files via model export.

Returns

It returns the decoded material in filePath as 2D string array of cga material attributes.

Description

The readMaterial functions reads the material file filePath into a 2D array of material attributes, similar to the one returned from getMaterial(). Referenced textures are resolved. The returned array can be used to set the current shape's material with the setMaterial() operation.

Related

See the following related topics:


In this topic