SceneImporter.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/smart_ptr/unique_ptr.h>
  10. #include <AzCore/std/smart_ptr/shared_ptr.h>
  11. #include <SceneAPI/SceneCore/Components/LoadingComponent.h>
  12. #include <SceneAPI/SceneCore/Containers/SceneGraph.h>
  13. #include <SceneAPI/SceneCore/Events/ImportEventContext.h>
  14. #include <SceneAPI/SceneCore/Import/SceneImportSettings.h>
  15. #include <SceneAPI/SceneBuilder/SceneSystem.h>
  16. #include <SceneAPI/SDKWrapper/SceneWrapper.h>
  17. namespace AZ
  18. {
  19. namespace SceneAPI
  20. {
  21. namespace Containers
  22. {
  23. class Scene;
  24. }
  25. namespace SceneBuilder
  26. {
  27. class SceneImporter
  28. : public SceneCore::LoadingComponent
  29. {
  30. public:
  31. AZ_COMPONENT(SceneImporter, "{D5EE21B6-8B73-45BF-B711-31346E0BEDB3}", SceneCore::LoadingComponent);
  32. SceneImporter();
  33. ~SceneImporter() override = default;
  34. static void Reflect(ReflectContext* context);
  35. Events::ProcessingResult ImportProcessing(Events::ImportEventContext& context);
  36. protected:
  37. SceneAPI::SceneImportSettings GetSceneImportSettings(const AZStd::string& sourceAssetPath) const;
  38. bool ConvertScene(Containers::Scene& scene) const;
  39. void SanitizeNodeName(AZStd::string& nodeName) const;
  40. AZStd::unique_ptr<SDKScene::SceneWrapperBase> m_sceneWrapper;
  41. AZStd::shared_ptr<SceneSystem> m_sceneSystem;
  42. };
  43. } // namespace SceneBuilder
  44. } // namespace SceneAPI
  45. } // namespace AZ