Fix opening projects with PostFx material assigned in Graphics Settings

#1993
This commit is contained in:
Wojtek Figat
2024-02-21 20:21:45 +01:00
parent f3e6b74043
commit d7dbc0fbdc
4 changed files with 43 additions and 6 deletions

View File

@@ -207,12 +207,11 @@ void PostFxMaterialsSettings::BlendWith(PostFxMaterialsSettings& other, float we
if (isHalf)
{
int32 indexSrc = 0;
const AssetReference<MaterialBase>* materialsSrc = other.Materials.Get();
const SoftAssetReference<MaterialBase>* materialsSrc = other.Materials.Get();
while (Materials.Count() != POST_PROCESS_SETTINGS_MAX_MATERIALS && indexSrc < other.Materials.Count())
{
MaterialBase* mat = materialsSrc[indexSrc].Get();
if (mat && !Materials.Contains(mat))
Materials.Add(mat);
if (!Materials.Contains(materialsSrc[indexSrc].GetID()))
Materials.Add(materialsSrc[indexSrc]);
indexSrc++;
}
}