M MY Multiplayer: Wiki
Side
Kind

engineGetModelMaterials

Client

Lists the loaded model's materials, in the order the model keeps them.

table|false engineGetModelMaterials(string|element model)

Parameters

NameTypeDescription
modelstring|elementThe model's name or a model element.

Returns

A list where each material has index (from 1), name, texture, shader and cutout. false when the model is not loaded.

The index and the name are what engineSetModelMaterial and the other material functions take to pick a material.

Example

local materials = engineGetModelMaterials("infernus")
if materials then
    for _, material in ipairs(materials) do
        outputDebugString(material.index .. " " .. material.name .. " " .. material.texture)
    end
end
NoteA name that is not a model is an error.

See also