Minor code cleanup.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
@@ -32,8 +32,7 @@ namespace AZ
|
||||
{
|
||||
Empty, //! No image was actually requested, the path was empty
|
||||
Found, //! The requested asset was found
|
||||
Missing, //! The requested asset was not found, and a placeholder asset was used instead
|
||||
MissingNoFallback //! The requested asset was not found, and a placeholder asset was not found either
|
||||
Missing //! The requested asset was not found, and a placeholder asset was used instead
|
||||
};
|
||||
|
||||
//! Finds an ImageAsset referenced by a material file (or a placeholder)
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace AZ
|
||||
|
||||
if (!imageAssetId.IsSuccess())
|
||||
{
|
||||
// When the AssetId cannot be found, we don't want to outright fail, because the runtime has mechanisms for displaying fallback textures which gives the
|
||||
// user a better recovery workflow. On the other hand we can't just provide an empty/invalid Asset<ImageAsset> because that would be interpreted as simply
|
||||
// no value was present and result in using no texture, and this would amount to a silent failure.
|
||||
// So we use a randomly generated (well except for the "BADA55E7" bit ;) UUID which the runtime and tools will interpret as a missing asset and represent
|
||||
// it as such.
|
||||
static const Uuid InvalidAssetPlaceholderId = "{BADA55E7-1A1D-4940-B655-9D08679BD62F}";
|
||||
imageAsset = Data::Asset<ImageAsset>{InvalidAssetPlaceholderId, azrtti_typeid<StreamingImageAsset>(), imageFilePath};
|
||||
return GetImageAssetResult::Missing;
|
||||
|
||||
Reference in New Issue
Block a user