From 90e34e86496ff5540fad191da102bd2b8ea3f743 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 28 Jan 2022 13:51:42 -0800 Subject: [PATCH] Fixed a couple places where we had variables called 'propertyNameContext' instead of 'propertyIdContext' which was inconsistent Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialTypeSourceData.h | 4 +-- .../Material/MaterialTypeSourceData.cpp | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index 40f82c8ec7..df8b7c4997 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -320,13 +320,13 @@ namespace AZ //! Recursively populates a material asset with properties from the tree of material property groups. //! @param materialTypeSourceFilePath path to the material type file that is being processed, used to look up relative paths - //! @param propertyNameContext the accumulated prefix that should be applied to any property names encountered in the current @propertyGroup + //! @param propertyIdContext the accumulated prefix that should be applied to any property names encountered in the current @propertyGroup //! @param propertyGroup the current PropertyGroup that is being processed //! @return false if errors are detected and processing should abort bool BuildPropertyList( const AZStd::string& materialTypeSourceFilePath, MaterialTypeAssetCreator& materialTypeAssetCreator, - AZStd::vector& propertyNameContext, + AZStd::vector& propertyIdContext, const MaterialTypeSourceData::PropertyGroup* propertyGroup) const; //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index b9a5754732..b7808abf17 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -376,18 +376,18 @@ namespace AZ return parts; } - bool MaterialTypeSourceData::EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertyGroupList) const + bool MaterialTypeSourceData::EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertyGroupList) const { for (auto& propertyGroup : inPropertyGroupList) { - if (!callback(propertyNameContext, propertyGroup.get())) + if (!callback(propertyIdContext, propertyGroup.get())) { return false; // Stop processing } - const AZStd::string propertyNameContext2 = propertyNameContext + propertyGroup->m_name + "."; + const AZStd::string propertyIdContext2 = propertyIdContext + propertyGroup->m_name + "."; - if (!EnumeratePropertyGroups(callback, propertyNameContext2, propertyGroup->m_propertyGroups)) + if (!EnumeratePropertyGroups(callback, propertyIdContext2, propertyGroup->m_propertyGroups)) { return false; // Stop processing } @@ -406,22 +406,22 @@ namespace AZ return EnumeratePropertyGroups(callback, {}, m_propertyLayout.m_propertyGroups); } - bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyNameContext, const AZStd::vector>& inPropertyGroupList) const + bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback, AZStd::string propertyIdContext, const AZStd::vector>& inPropertyGroupList) const { for (auto& propertyGroup : inPropertyGroupList) { - const AZStd::string propertyNameContext2 = propertyNameContext + propertyGroup->m_name + "."; + const AZStd::string propertyIdContext2 = propertyIdContext + propertyGroup->m_name + "."; for (auto& property : propertyGroup->m_properties) { - if (!callback(propertyNameContext2, property.get())) + if (!callback(propertyIdContext2, property.get())) { return false; // Stop processing } } - if (!EnumerateProperties(callback, propertyNameContext2, propertyGroup->m_propertyGroups)) + if (!EnumerateProperties(callback, propertyIdContext2, propertyGroup->m_propertyGroups)) { return false; // Stop processing } @@ -532,14 +532,14 @@ namespace AZ bool MaterialTypeSourceData::BuildPropertyList( const AZStd::string& materialTypeSourceFilePath, MaterialTypeAssetCreator& materialTypeAssetCreator, - AZStd::vector& propertyNameContext, + AZStd::vector& propertyIdContext, const MaterialTypeSourceData::PropertyGroup* propertyGroup) const { for (const AZStd::unique_ptr& property : propertyGroup->m_properties) { // Register the property... - MaterialPropertyId propertyId{propertyNameContext, property->GetName()}; + MaterialPropertyId propertyId{propertyIdContext, property->GetName()}; if (!propertyId.IsValid()) { @@ -652,15 +652,15 @@ namespace AZ for (const AZStd::unique_ptr& propertySubset : propertyGroup->m_propertyGroups) { - propertyNameContext.push_back(propertySubset->m_name); + propertyIdContext.push_back(propertySubset->m_name); bool success = BuildPropertyList( materialTypeSourceFilePath, materialTypeAssetCreator, - propertyNameContext, + propertyIdContext, propertySubset.get()); - propertyNameContext.pop_back(); + propertyIdContext.pop_back(); if (!success) { @@ -797,9 +797,9 @@ namespace AZ for (const AZStd::unique_ptr& propertyGroup : m_propertyLayout.m_propertyGroups) { - AZStd::vector propertyNameContext; - propertyNameContext.push_back(propertyGroup->m_name); - bool success = BuildPropertyList(materialTypeSourceFilePath, materialTypeAssetCreator, propertyNameContext, propertyGroup.get()); + AZStd::vector propertyIdContext; + propertyIdContext.push_back(propertyGroup->m_name); + bool success = BuildPropertyList(materialTypeSourceFilePath, materialTypeAssetCreator, propertyIdContext, propertyGroup.get()); if (!success) {