diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h index 5b3c0488cb..fd63494f30 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyId.h @@ -41,8 +41,14 @@ namespace AZ operator const Name&() const; //! Returns a pointer to the full name ("[groupName].[propertyName]"). + //! Same as Name::GetCStr() //! This is included for convenience so it can be used for error messages in the same way an AZ::Name is used. const char* GetCStr() const; + + //! Returns a string_view of the full name ("[groupName].[propertyName]"). + //! Same as Name::GetStringView() + //! This is included for convenience so it can be used for string comparison in the same way an AZ::Name is used. + AZStd::string_view GetStringView() const; //! Returns a hash of the full name. This is needed for compatibility with NameIdReflectionMap. Name::Hash GetHash() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp index a1fee51d0a..4880de33fe 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyId.cpp @@ -111,6 +111,11 @@ namespace AZ { return m_fullName.GetCStr(); } + + AZStd::string_view MaterialPropertyId::GetStringView() const + { + return m_fullName.GetStringView(); + } Name::Hash MaterialPropertyId::GetHash() const {