First phase of refactoring atom thumbnail and preview rendering into a reusable system that can be used for additional thumbnail types and capturing preview images for other purposes. Our

• Removed classes for initialization and teardown steps of the renderer
• Moved initialization and teardown logic back to the renderer constructor and destructor
• Combined thumbnail render context and data with the main renderer class
• Made all render data private and instead implemented a public interface
• Remaining steps were simplified and updated to work directly with the new public interface
• Changed the waiting for assets to load state to poll asset status on tick because we were timing out there anyway
• Unified redundant camera configuration variables and made sure they were used consistently when initializing and updating the scene and camera
• Changed interface for custom feature processor request API to build a set instead of returning a vector
• Moved initialization of the thumbnail renderer and preview factory after asset catalog has loaded

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
Guthrie Adams
2021-10-07 11:58:01 -05:00
parent d1947c68c9
commit 3c50fdc671
19 changed files with 466 additions and 737 deletions
@@ -82,12 +82,11 @@ namespace AZ
void EditorCommonFeaturesSystemComponent::Activate()
{
m_renderer = AZStd::make_unique<AZ::LyIntegration::Thumbnails::CommonThumbnailRenderer>();
m_previewerFactory = AZStd::make_unique <LyIntegration::CommonPreviewerFactory>();
m_skinnedMeshDebugDisplay = AZStd::make_unique<SkinnedMeshDebugDisplay>();
AzToolsFramework::EditorLevelNotificationBus::Handler::BusConnect();
AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler::BusConnect();
AzFramework::AssetCatalogEventBus::Handler::BusConnect();
AzFramework::ApplicationLifecycleEvents::Bus::Handler::BusConnect();
}
@@ -95,6 +94,7 @@ namespace AZ
{
AzToolsFramework::EditorLevelNotificationBus::Handler::BusDisconnect();
AzFramework::ApplicationLifecycleEvents::Bus::Handler::BusDisconnect();
AzFramework::AssetCatalogEventBus::Handler::BusDisconnect();
AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler::BusDisconnect();
m_skinnedMeshDebugDisplay.reset();
@@ -191,6 +191,14 @@ namespace AZ
}
}
void EditorCommonFeaturesSystemComponent::OnCatalogLoaded([[maybe_unused]] const char* catalogFile)
{
AZ::TickBus::QueueFunction([this](){
m_renderer = AZStd::make_unique<AZ::LyIntegration::Thumbnails::CommonThumbnailRenderer>();
m_previewerFactory = AZStd::make_unique<LyIntegration::CommonPreviewerFactory>();
});
}
const AzToolsFramework::AssetBrowser::PreviewerFactory* EditorCommonFeaturesSystemComponent::GetPreviewerFactory(
const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) const
{