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>
"Material property '%s' has been renamed to '%s', and a material override references the old name. Save the level or prefab to permanently apply this change.",
propertyPair.first.GetCStr(),
propertyId.GetCStr());
}
}
if(!materialPropertyIndex.IsNull())
{
m_materialInstance->SetPropertyValue(
@ -150,6 +172,15 @@ namespace AZ
}
}
// Now that we're done looping over all the overrides, it's safe to apply any renames that were scheduled