Graphics/Model: Fix material copy for good
This commit is contained in:
parent
eeaaebb15c
commit
ea57252081
|
|
@ -25,6 +25,14 @@ namespace Nz
|
||||||
InstancedRenderable(model)
|
InstancedRenderable(model)
|
||||||
{
|
{
|
||||||
SetMesh(model.m_mesh);
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue