Updating code comments.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2022-01-13 12:49:35 -08:00
parent aafd34679a
commit 8084775d7a
3 changed files with 14 additions and 4 deletions
@@ -34,8 +34,6 @@ namespace AZ
class MaterialAssetHandler;
//! MaterialAsset defines a single material, which can be used to create a Material instance for rendering at runtime.
//! It fetches MaterialTypeSourceData from the MaterialTypeAsset it owned.
//!
//! Use a MaterialAssetCreator to create a MaterialAsset.
class MaterialAsset
: public AZ::Data::AssetData
@@ -46,7 +44,6 @@ namespace AZ
friend class MaterialVersionUpdate;
friend class MaterialAssetCreator;
friend class MaterialAssetHandler;
friend class MaterialAssetCreatorCommon;
friend class UnitTest::MaterialTests;
friend class UnitTest::MaterialAssetTests;
@@ -117,8 +114,18 @@ namespace AZ
//!
//! Note that even though material source data files contain only override values and inherit the rest from
//! their parent material, they all get flattened at build time so every MaterialAsset has the full set of values.
//!
//! Calling GetPropertyValues() will automatically finalize the material asset if it isn't finalized already. The
//! MaterialTypeAsset must be loaded and ready.
const AZStd::vector<MaterialPropertyValue>& GetPropertyValues() const;
//! Returns the list of raw values for all properties in this material, as listed in the source .material file(s), before the material asset was Finalized.
//!
//! The MaterialAsset can be created in a "half-baked" state (see MaterialUtils::BuildersShouldFinalizeMaterialAssets) where
//! minimal processing has been done because it did not yet have access to the MaterialTypeAsset. In that case, the list will
//! be populated with values copied from the source .material file with little or no validation or other processing. It includes
//! all parent .material files, with properties listed in low-to-high priority order.
//! This list will be empty however if the asset was finalized at build-time.
const AZStd::vector<AZStd::pair<Name, MaterialPropertyValue>>& GetRawPropertyValues() const;
private:
@@ -312,6 +312,9 @@ namespace AZ
{
materialAssetCreator.ReportWarning("Source data for material property value is invalid.");
}
// If the source value type is a string, there are two possible property types: Image and Enum. If there is a "." in
// the string (for the extension) we assume it's an Image and look up the referenced Asset. Otherwise, we can assume
// it's an Enum value and just preserve the original string.
else if (property.second.m_value.Is<AZStd::string>() && AzFramework::StringFunc::Contains(property.second.m_value.GetValue<AZStd::string>(), "."))
{
Data::Asset<ImageAsset> imageAsset;
@@ -304,7 +304,7 @@ namespace AZ
m_materialTypeAsset = newMaterialTypeAsset;
// If the material asset was not finalized on disk, then we clear the previously finalized property values to force re-finalize.
// This
// This is necessary in case the property layout changed in some way.
if (!m_wasPreFinalized)
{
m_isFinalized = false;