ent_mtlset (ENTITY*, MATERIAL* material, var skin);

Replaces skin lighting and skin effect of a model.

Parameters:

ENTITY* Target entity pointer (models or nonchunked terrain only).
material Source material pointer. If the entity skin contains no material, it gets the light parameters from the source material. If it already contains a material, its light parameters are replaced by the source material lighting. If the source material contains an effect or shader, it replaces the skin effect.
skin Number of the skin.

Returns:

NULL if the skin material was not found, otherwise nonzero.

Modifies:

entity - the model skin light parameters and skin effect are modified. Affects all entities sharing that model file unless ent_clone or ent_cloneskin was called before. Material parameters that do not belong to a skin - for instance material skills or matrices - are not modified.

Speed:

Medium

Example:

ent_mtlset(me,mtl_new,1); // replaces the material of the first entity skin

See also:

Skin Parameters, Materials, ent_cloneskin