LoadingTrackingProcessor.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <SceneAPI/SceneCore/Components/LoadingComponent.h>
  10. #include <SceneAPI/SceneCore/Events/AssetImportRequest.h>
  11. namespace SceneLoggingExample
  12. {
  13. // The LoadingTrackingProcessor class demonstrates how to listen to EBus events that start
  14. // and finalize the loading of scene files (such as .fbx files) and the manifest (.assetinfo
  15. // file). It also shows the Call Processor events that can be fired during loading.
  16. class LoadingTrackingProcessor
  17. : public AZ::SceneAPI::SceneCore::LoadingComponent
  18. , public AZ::SceneAPI::Events::AssetImportRequestBus::Handler
  19. {
  20. public:
  21. AZ_COMPONENT(LoadingTrackingProcessor, "{E5E65E21-0BCD-4874-84B8-22E10CCAEE94}", AZ::SceneAPI::SceneCore::LoadingComponent);
  22. LoadingTrackingProcessor();
  23. ~LoadingTrackingProcessor() override = default;
  24. void Activate() override;
  25. void Deactivate() override;
  26. static void Reflect(AZ::ReflectContext* context);
  27. AZ::SceneAPI::Events::ProcessingResult PrepareForAssetLoading(AZ::SceneAPI::Containers::Scene& scene,
  28. RequestingApplication requester) override;
  29. AZ::SceneAPI::Events::LoadingResult LoadAsset(AZ::SceneAPI::Containers::Scene& scene,
  30. const AZStd::string& path, const AZ::Uuid& guid, RequestingApplication requester) override;
  31. void FinalizeAssetLoading(AZ::SceneAPI::Containers::Scene& scene, RequestingApplication requester) override;
  32. AZ::SceneAPI::Events::ProcessingResult UpdateManifest(AZ::SceneAPI::Containers::Scene& scene, ManifestAction action,
  33. RequestingApplication requester) override;
  34. void GetPolicyName(AZStd::string& result) const override
  35. {
  36. result = "LoadingTrackingProcessor";
  37. }
  38. uint8_t GetPriority() const override;
  39. AZ::SceneAPI::Events::ProcessingResult ContextCallback(AZ::SceneAPI::Events::ICallContext& context);
  40. };
  41. } // namespace SceneLoggingExample