From e97f5de94a072f1942efea32ccc14b1a81c62d53 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Thu, 18 Nov 2021 15:48:47 -0600 Subject: [PATCH 1/2] Updated material version warning messages to include the affected asset Signed-off-by: Guthrie Adams --- .../Code/Source/RPI.Edit/Material/MaterialSourceData.cpp | 7 ++++--- .../Code/Source/RPI.Reflect/Material/MaterialAsset.cpp | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index d6308ec655..dce27f3136 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -116,10 +116,11 @@ namespace AZ { m_properties = AZStd::move(newPropertyGroups); - AZ_Warning("MaterialSourceData", false, + AZ_Warning( + "MaterialSourceData", false, "This material is based on version '%u' of '%s', but the material type is now at version '%u'. " - "Automatic updates are available. Consider updating the .material source file.", - m_materialTypeVersion, m_materialType.c_str(), materialTypeSourceData.m_version); + "Automatic updates are available. Consider updating '%s'.", + m_materialTypeVersion, materialTypeFullPath.c_str(), materialTypeSourceData.m_version, materialSourceFilePath); } m_materialTypeVersion = materialTypeSourceData.m_version; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index ac90333842..3c6947b83d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -226,10 +226,12 @@ namespace AZ if (changesWereApplied) { - AZ_Warning("MaterialAsset", false, + AZ_Warning( + "MaterialAsset", false, "This material is based on version '%u' of %s, but the material type is now at version '%u'. " - "Automatic updates are available. Consider updating the .material source file.", - originalVersion, m_materialTypeAsset.ToString().c_str(), m_materialTypeAsset->GetVersion()); + "Automatic updates are available. Consider updating the .material source file for '%s'.", + originalVersion, m_materialTypeAsset.ToString().c_str(), m_materialTypeAsset->GetVersion(), + GetId().ToString().c_str()); } m_materialTypeVersion = m_materialTypeAsset->GetVersion(); From b89f5ee0c473a28d2023a970c50b7622acca4a61 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Thu, 18 Nov 2021 18:52:33 -0600 Subject: [PATCH 2/2] fixed tests Signed-off-by: Guthrie Adams --- .../RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index dce27f3136..fd073bbae4 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -119,8 +119,8 @@ namespace AZ AZ_Warning( "MaterialSourceData", false, "This material is based on version '%u' of '%s', but the material type is now at version '%u'. " - "Automatic updates are available. Consider updating '%s'.", - m_materialTypeVersion, materialTypeFullPath.c_str(), materialTypeSourceData.m_version, materialSourceFilePath); + "Automatic updates are available. Consider updating the .material source file: '%s'.", + m_materialTypeVersion, materialTypeFullPath.c_str(), materialTypeSourceData.m_version, materialSourceFilePath.data()); } m_materialTypeVersion = materialTypeSourceData.m_version;