Fixed the MaterialAssignmentId version converter to properly handle the default material assignment slot.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
Chris Santora
2021-07-20 13:43:24 -07:00
committed by santorac
parent 3daf3f7d7a
commit a71ee7eb3a
@@ -33,7 +33,14 @@ namespace AZ
// No need to early-return, the object will still load successfully, it will just report more errors about the unrecognized element.
}
classElement.AddElementWithData(context, "materialSlotStableId", materialAssetId.m_subId);
if (materialAssetId.IsValid())
{
classElement.AddElementWithData(context, "materialSlotStableId", materialAssetId.m_subId);
}
else
{
classElement.AddElementWithData(context, "materialSlotStableId", RPI::ModelMaterialSlot::InvalidStableId);
}
}
return true;