Reports warnings when a material version auto update is applied, notifying the user they should update their source data.

Also improved the MaterialAssetTests UpgradeMaterialAsset() to focus on testing the inputs and outputs of the class rather than the private internal data.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2021-10-20 23:36:53 -07:00
parent 836d018de7
commit 1633ced656
7 changed files with 103 additions and 22 deletions
@@ -51,8 +51,10 @@ namespace AZ
m_toVersion = toVersion;
}
void MaterialVersionUpdate::ApplyVersionUpdates(MaterialAsset& materialAsset) const
bool MaterialVersionUpdate::ApplyVersionUpdates(MaterialAsset& materialAsset) const
{
bool changesWereApplied = false;
for (auto& propertyName : materialAsset.m_propertyNames)
{
for (const auto& action : m_actions)
@@ -60,9 +62,12 @@ namespace AZ
if (propertyName == action.m_fromPropertyId)
{
propertyName = action.m_toPropertyId;
changesWereApplied = true;
}
}
}
return changesWereApplied;
}
const AZ::RPI::MaterialVersionUpdate::Actions& MaterialVersionUpdate::GetActions() const