diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp index 78681f3b4b..59bb8d940b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Thumbnails/FolderThumbnail.cpp @@ -50,8 +50,8 @@ namespace AzToolsFramework ////////////////////////////////////////////////////////////////////////// // FolderThumbnail ////////////////////////////////////////////////////////////////////////// - static constexpr const char* FolderIconPath = "Icons/AssetBrowser/Folder_16.svg"; - static constexpr const char* GemIconPath = "Icons/AssetBrowser/GemFolder_16.svg"; + static constexpr const char* FolderIconPath = "Assets/Editor/Icons/AssetBrowser/Folder_16.svg"; + static constexpr const char* GemIconPath = "Assets/Editor/Icons/AssetBrowser/GemFolder_16.svg"; FolderThumbnail::FolderThumbnail(SharedThumbnailKey key) : Thumbnail(key) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp index fb9d156b20..f6578ad9d2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp @@ -23,7 +23,7 @@ namespace AzToolsFramework ////////////////////////////////////////////////////////////////////////// // LoadingThumbnail ////////////////////////////////////////////////////////////////////////// - static const char* LoadingIconPath = "Icons/AssetBrowser/in_progress.gif"; + static const char* LoadingIconPath = "Assets/Editor/Icons/AssetBrowser/in_progress.gif"; LoadingThumbnail::LoadingThumbnail() : Thumbnail(MAKE_TKEY(ThumbnailKey)) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp index 270a5b113f..7a7c98f764 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp @@ -10,18 +10,26 @@ * */ +#include +#include #include namespace AzToolsFramework { namespace Thumbnailer { - static const char* MISSING_ICON_PATH = "Icons/AssetBrowser/Default_16.svg"; + static const char* MissingIconPath = "Assets/Editor/Icons/AssetBrowser/Default_16.svg"; MissingThumbnail::MissingThumbnail() : Thumbnail(MAKE_TKEY(ThumbnailKey)) { - m_pixmap.load(MISSING_ICON_PATH); + const char* engineRoot = nullptr; + AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot); + AZ_Assert(engineRoot, "Engine Root not initialized"); + AZStd::string absoluteIconPath; + AZ::StringFunc::Path::Join(engineRoot, MissingIconPath, absoluteIconPath); + + m_pixmap.load(absoluteIconPath.c_str()); m_state = m_pixmap.isNull() ? State::Failed : State::Ready; } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.cpp index 14f125c283..1af6563577 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.cpp @@ -129,7 +129,7 @@ namespace ImageProcessingAtom { AZStd::string fullPath; AZ::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), fullPath); - if (RenerThumbnailFromImage(thumbnailKey, thumbnailSize, IImageObjectPtr(LoadImageFromFile(fullPath)))) + if (RenderThumbnailFromImage(thumbnailKey, thumbnailSize, IImageObjectPtr(LoadImageFromFile(fullPath)))) { return; } @@ -139,7 +139,7 @@ namespace ImageProcessingAtom auto productKey = azrtti_cast(thumbnailKey.data()); if (productKey) { - if (RenerThumbnailFromImage(thumbnailKey, thumbnailSize, Utils::LoadImageFromImageAsset(productKey->GetAssetId()))) + if (RenderThumbnailFromImage(thumbnailKey, thumbnailSize, Utils::LoadImageFromImageAsset(productKey->GetAssetId()))) { return; } @@ -149,7 +149,7 @@ namespace ImageProcessingAtom thumbnailKey, &AzToolsFramework::Thumbnailer::ThumbnailerRendererNotifications::ThumbnailFailedToRender); } - bool ImageThumbnailSystemComponent::RenerThumbnailFromImage( + bool ImageThumbnailSystemComponent::RenderThumbnailFromImage( AzToolsFramework::Thumbnailer::SharedThumbnailKey thumbnailKey, int thumbnailSize, IImageObjectPtr previewImage) const { if (!previewImage) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.h index 943857fd35..ca2453b532 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnailSystemComponent.h @@ -52,7 +52,7 @@ namespace ImageProcessingAtom bool Installed() const override; void RenderThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey thumbnailKey, int thumbnailSize) override; - bool RenerThumbnailFromImage( + bool RenderThumbnailFromImage( AzToolsFramework::Thumbnailer::SharedThumbnailKey thumbnailKey, int thumbnailSize, IImageObjectPtr previewImage) const; }; } // namespace Thumbnails diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp index f3c74629c2..16baf16886 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/CaptureStep.cpp @@ -37,6 +37,15 @@ namespace AZ void CaptureStep::Start() { + if (!m_context->GetData()->m_materialAsset || + !m_context->GetData()->m_modelAsset) + { + AzToolsFramework::Thumbnailer::ThumbnailerRendererNotificationBus::Event( + m_context->GetData()->m_thumbnailKeyRendered, + &AzToolsFramework::Thumbnailer::ThumbnailerRendererNotifications::ThumbnailFailedToRender); + m_context->SetStep(Step::FindThumbnailToRender); + return; + } Render::MaterialComponentRequestBus::Event( m_context->GetData()->m_modelEntity->GetId(), &Render::MaterialComponentRequestBus::Events::SetDefaultMaterialOverride, diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/InitializeStep.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/InitializeStep.cpp index 100b0f61cd..322c765f1b 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/InitializeStep.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/InitializeStep.cpp @@ -189,6 +189,7 @@ namespace AZ m_context->GetData()->DefaultModelPath, RPI::ModelAsset::RTTI_Type(), false); + AZ_Error("ThumbnailRenderer", defaultModelAssetId.IsValid(), "Default model asset is invalid. Verify the asset %s exists.", m_context->GetData()->DefaultModelPath); if (m_context->GetData()->m_assetsToLoad.emplace(defaultModelAssetId).second) { data->m_defaultModelAsset.Create(defaultModelAssetId); @@ -203,6 +204,7 @@ namespace AZ m_context->GetData()->DefaultMaterialPath, RPI::MaterialAsset::RTTI_Type(), false); + AZ_Error("ThumbnailRenderer", defaultMaterialAssetId.IsValid(), "Default material asset is invalid. Verify the asset %s exists.", m_context->GetData()->DefaultMaterialPath); if (m_context->GetData()->m_assetsToLoad.emplace(defaultMaterialAssetId).second) { data->m_defaultMaterialAsset.Create(defaultMaterialAssetId);