EditorCommonFeaturesSystemComponent.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Asset/AssetCommon.h>
  10. #include <AzCore/Component/Component.h>
  11. #include <AzFramework/Application/Application.h>
  12. #include <AzToolsFramework/API/EditorLevelNotificationBus.h>
  13. #include <AzToolsFramework/AssetBrowser/Previewer/PreviewerBus.h>
  14. #include <SharedPreview/SharedPreviewerFactory.h>
  15. #include <SharedPreview/SharedThumbnailRenderer.h>
  16. namespace AZ
  17. {
  18. namespace Render
  19. {
  20. class SkinnedMeshDebugDisplay;
  21. //! This is the editor-counterpart to this gem's main CommonSystemComponent class.
  22. class EditorCommonFeaturesSystemComponent
  23. : public AZ::Component
  24. , public AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler
  25. , public AzFramework::ApplicationLifecycleEvents::Bus::Handler
  26. {
  27. public:
  28. AZ_COMPONENT(EditorCommonFeaturesSystemComponent, "{D73D77CF-D5AF-428B-909B-324E96D3DEF5}");
  29. EditorCommonFeaturesSystemComponent();
  30. ~EditorCommonFeaturesSystemComponent();
  31. static void Reflect(AZ::ReflectContext* context);
  32. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  33. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  34. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  35. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  36. protected:
  37. // AZ::Component interface implementation
  38. void Init() override;
  39. void Activate() override;
  40. void Deactivate() override;
  41. // AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler overrides...
  42. const AzToolsFramework::AssetBrowser::PreviewerFactory* GetPreviewerFactory(
  43. const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) const override;
  44. // AzFramework::ApplicationLifecycleEvents overrides...
  45. void OnApplicationAboutToStop() override;
  46. void SetupThumbnails();
  47. void TeardownThumbnails();
  48. private:
  49. AZStd::unique_ptr<SkinnedMeshDebugDisplay> m_skinnedMeshDebugDisplay;
  50. AZ::Data::AssetId m_levelDefaultSliceAssetId;
  51. AZStd::string m_atomLevelDefaultAssetPath{ "LevelAssets/default.slice" };
  52. float m_envProbeHeight{ 200.0f };
  53. AZStd::unique_ptr<AZ::LyIntegration::SharedThumbnailRenderer> m_thumbnailRenderer;
  54. AZStd::unique_ptr<LyIntegration::SharedPreviewerFactory> m_previewerFactory;
  55. AZ::SettingsRegistryInterface::NotifyEventHandler m_criticalAssetsHandler;
  56. };
  57. } // namespace Render
  58. } // namespace AZ