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 507652b9fa..ee2a464290 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 @@ -324,7 +324,7 @@ namespace AZ PropertyDefinition* FindProperty(AZStd::span parsedPropertyId, AZStd::span> inPropertyGroupList); // Function overloads for recursion, returns false to indicate that recursion should end. - bool EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, PropertyGroupStack* propertyGroupStack, const AZStd::vector>& inPropertyGroupList) const; + bool EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, PropertyGroupStack& propertyGroupStack, const AZStd::vector>& inPropertyGroupList) const; bool EnumerateProperties(const EnumeratePropertiesCallback& callback, MaterialNameContext nameContext, const AZStd::vector>& inPropertyGroupList) const; static void ExtendNameContext(MaterialNameContext& nameContext, const MaterialTypeSourceData::PropertyGroup& propertyGroup); 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 9153120732..3d40e5551e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -427,13 +427,13 @@ namespace AZ return parts; } - bool MaterialTypeSourceData::EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, PropertyGroupStack* propertyGroupStack, const AZStd::vector>& inPropertyGroupList) const + bool MaterialTypeSourceData::EnumeratePropertyGroups(const EnumeratePropertyGroupsCallback& callback, PropertyGroupStack& propertyGroupStack, const AZStd::vector>& inPropertyGroupList) const { for (auto& propertyGroup : inPropertyGroupList) { - propertyGroupStack->push_back(propertyGroup.get()); + propertyGroupStack.push_back(propertyGroup.get()); - if (!callback(*propertyGroupStack)) + if (!callback(propertyGroupStack)) { return false; // Stop processing } @@ -443,7 +443,7 @@ namespace AZ return false; // Stop processing } - propertyGroupStack->pop_back(); + propertyGroupStack.pop_back(); } return true; @@ -457,7 +457,7 @@ namespace AZ } PropertyGroupStack propertyGroupStack; - return EnumeratePropertyGroups(callback, &propertyGroupStack, m_propertyLayout.m_propertyGroups); + return EnumeratePropertyGroups(callback, propertyGroupStack, m_propertyLayout.m_propertyGroups); } bool MaterialTypeSourceData::EnumerateProperties(const EnumeratePropertiesCallback& callback, MaterialNameContext nameContext, const AZStd::vector>& inPropertyGroupList) const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index 1c6410f8c3..37ca44fa43 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -275,7 +275,7 @@ namespace AZ void MaterialPropertyInspector::AddPropertiesGroup() { - // Copy all of the properties from the material asset to the source data that will be exported + // Copy all of the properties from the material asset to the populate the inspector m_editData.m_materialTypeSourceData.EnumeratePropertyGroups( [this](const AZ::RPI::MaterialTypeSourceData::PropertyGroupStack& propertyGroupStack) { @@ -290,10 +290,10 @@ namespace AZ AZStd::vector groupNameVector; AZStd::vector groupDisplayNameVector; - for (auto& group : propertyGroupStack) + for (auto& nextGroup : propertyGroupStack) { - groupNameVector.push_back(group->GetName()); - groupDisplayNameVector.push_back(!group->GetDisplayName().empty() ? group->GetDisplayName() : group->GetName()); + groupNameVector.push_back(nextGroup->GetName()); + groupDisplayNameVector.push_back(!nextGroup->GetDisplayName().empty() ? nextGroup->GetDisplayName() : nextGroup->GetName()); } AZStd::string groupId;