Commit Graph

7 Commits (c6b209ace0d24ff6fa1bc1d2f4a5c4ce04fbd90b)

Author SHA1 Message Date
santorac c6b209ace0 Made material property auto-rename procedure apply to Material Component at runtime. This ensures that an material property overrides and any gameplay scripts that work with property overrides can get the benefit of the material type version update procedure.
I added an ApplyPropertyRenames function to MaterialTypeAsset very similar to the one in MaterialTypeSourceData.
Updated the MaterialAssignment class to apply any property renames when it discovers the old name doesn't work. This will be written to disk when the level or prefab is saved.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac a4321baecc Hopefully fix a Jenkins build failure about "function cannot access 'AZ::RPI::MaterialVersionUpdate::RenamePropertyAction::m_fromPropertyId'"
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 46061eb302 Simplified the code around MaterialAsset::ApplyVersionUpdates()
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 1633ced656 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>
4 years ago
santorac 836d018de7 Simplified MaterialVersionUpdate code to focus just on renaming, since that's the only operation we currently support. We shouldn't add more complexity until additional operations need to be supported.
Also rearranged some logic to simplify the code that loops over rename actions, avoiding making unnecessary additional maps.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Robin 2607b3471a Resolve PR comments. Add unit tests.
Signed-off-by: Robin <rbarrand@amazon.com>
4 years ago
rbarrand 59031d2f17 Enable material version updates.
Signed-off-by: Robin <rbarrand@amazon.com>
4 years ago