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 f2a9efd896..92fded1d5d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -109,6 +109,9 @@ namespace AZ return m_wasPreFinalized; } + //! Attempts to convert a numeric MaterialPropertyValue to another numeric type @T, + //! since MaterialPropertyValue itself does not support any kind of casting. + //! If the original MaterialPropertyValue is not a numeric type, the original value is returned. template MaterialPropertyValue CastNumericMaterialPropertyValue(const MaterialPropertyValue& value) { @@ -135,7 +138,10 @@ namespace AZ return value; } } - + + //! Attempts to convert an AZ::Vector[2-4] MaterialPropertyValue to another AZ::Vector[2-4] type @T. + //! Any extra elements will be dropped or set to 0.0 as needed. + //! If the original MaterialPropertyValue is not a Vector type, the original value is returned. template MaterialPropertyValue CastVectorMaterialPropertyValue(const MaterialPropertyValue& value) {