Graphics/Model: Fix material copy for good

This commit is contained in:
Lynix 2018-07-01 20:36:42 +02:00
parent eeaaebb15c
commit ea57252081
1 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,14 @@ namespace Nz
InstancedRenderable(model)
{
SetMesh(model.m_mesh);
// Since SetMesh does reset materials, we need reapply them
SetSkinCount(model.GetSkinCount());
for (std::size_t skin = 0; skin < model.GetSkinCount(); ++skin)
{
for (std::size_t matIndex = 0; matIndex < model.GetMaterialCount(); ++matIndex)
SetMaterial(skin, matIndex, model.GetMaterial(skin, matIndex));
}
}
/*!