engineSetModelMaterial
Client
Replaces the chosen materials of every instance of a model with a material.
bool engineSetModelMaterial(string|element model, int|string selector, material material [, int priority = 0])
Parameters
| Name | Type | Description |
|---|---|---|
| model | string|element | The model's name or a model element. |
| selector | int|string | Which material: its index from 1 or its name, as engineGetModelMaterials lists them. The name ignores case and takes the * and ? wildcards. |
| material | material | The material drawn in their place. |
| priority | int | When several resources pick the same material, the highest priority wins; between equals, the newest.default 0 |
Returns
true when it was applied.
Example
local chrome = engineCreateMaterial("surface")
engineSetMaterialValue(chrome, "metallicFactor", 1)
engineSetMaterialValue(chrome, "roughnessFactor", 0.05)
engineSetModelMaterial("infernus", "*chrome*", chrome)NoteA name that is not a model is an error.