natiny_model_set_part_material

C
void natiny_model_set_part_material(NatinyModel model, uint32_t part, NatinyMaterial material);

Overrides the material of one part of the model.

Parameters

Name Type Description
model NatinyModel Model handle
part uint32_t Zero-based part index
material NatinyMaterial Material handle, or 0 to inherit the model's again

Example

C
natiny_model_set_part_material(house, 3, glass);

Notes

  • 0 clears an override.
  • This does not change which passes draw the model: tags are read from the
  • Overrides are cleared by natiny_model_set_mesh, because they were indexed by the old mesh's parts.
  • An index past the last part is stored but never reached.