ExportTrackingProcessor.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/std/string/string.h>
  10. #include <SceneAPI/SceneCore/Components/ExportingComponent.h>
  11. #include <SceneAPI/SceneCore/Events/ExportEventContext.h>
  12. namespace AZ
  13. {
  14. namespace SceneAPI
  15. {
  16. namespace Containers
  17. {
  18. class Scene;
  19. class SceneGraph;
  20. class SceneManifest;
  21. }
  22. }
  23. }
  24. namespace SceneLoggingExample
  25. {
  26. // The ExportTrackingProcessor class demonstrates how to use the ExportingComponent to listen to scene export events.
  27. // It also shows how to collect data from a graph by traversing the graph in a hierarchical way.
  28. class ExportTrackingProcessor
  29. : public AZ::SceneAPI::SceneCore::ExportingComponent
  30. {
  31. public:
  32. AZ_COMPONENT(ExportTrackingProcessor, "{EAD9C07A-60D5-4E48-8465-72034D326368}", AZ::SceneAPI::SceneCore::ExportingComponent);
  33. ExportTrackingProcessor();
  34. ~ExportTrackingProcessor() override = default;
  35. static void Reflect(AZ::ReflectContext* context);
  36. protected:
  37. AZ::SceneAPI::Events::ProcessingResult PrepareForExport(AZ::SceneAPI::Events::PreExportEventContext& context);
  38. AZ::SceneAPI::Events::ProcessingResult ContextCallback(AZ::SceneAPI::Events::ICallContext& context);
  39. uint8_t GetPriority() const override;
  40. void LogGraph(const AZ::SceneAPI::Containers::SceneGraph& graph, const AZStd::string& nodePath) const;
  41. const AZ::SceneAPI::Containers::SceneManifest* m_manifest = nullptr;
  42. };
  43. } // namespace SceneLoggingExample