Skip to content

pyio.list_materials

fabian-flassig edited this page Jul 8, 2026 · 1 revision

Lists all materials contained in a material file and returns them as material element handles.

pyio.list_materials(material_file)

Parameter | Type | Description ---|--- material_file | path handle | A path handle that refers to a material file (.pymat), for example returned by pyux.select_material

Return value

Type Description
{material_handle, ...} A Lua array containing element handles of all materials found in the material file. The array is empty if the file contains no matching materials.

Note:

Only materials whose stored material path matches the given file are returned. If the material file cannot be loaded, no value is returned.

The returned handles can be passed to pytha.set_element_material like any other material handle.

See also:

pyio, Path Handles, pyux.select_material, pytha.set_element_material

Clone this wiki locally