EditorPythonBindingsModule.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #include <AzCore/Memory/SystemAllocator.h>
  9. #include <AzCore/Module/Module.h>
  10. #include <AzToolsFramework/API/PythonLoader.h>
  11. #include <PythonSystemComponent.h>
  12. #include <PythonReflectionComponent.h>
  13. #include <PythonMarshalComponent.h>
  14. #include <PythonLogSymbolsComponent.h>
  15. namespace EditorPythonBindings
  16. {
  17. class EditorPythonBindingsModule
  18. : public AZ::Module
  19. , public AzToolsFramework::EmbeddedPython::PythonLoader
  20. {
  21. public:
  22. AZ_RTTI(EditorPythonBindingsModule, "{851B9E35-4FD5-49B1-8207-E40D4BBA36CC}", AZ::Module);
  23. AZ_CLASS_ALLOCATOR(EditorPythonBindingsModule, AZ::SystemAllocator);
  24. EditorPythonBindingsModule()
  25. : AZ::Module()
  26. {
  27. m_descriptors.insert(m_descriptors.end(),
  28. {
  29. PythonSystemComponent::CreateDescriptor(),
  30. PythonReflectionComponent::CreateDescriptor(),
  31. PythonMarshalComponent::CreateDescriptor(),
  32. PythonLogSymbolsComponent::CreateDescriptor(),
  33. });
  34. }
  35. /**
  36. * Add required SystemComponents to the SystemEntity.
  37. */
  38. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  39. {
  40. return AZ::ComponentTypeList
  41. {
  42. azrtti_typeid<PythonSystemComponent>(),
  43. azrtti_typeid<PythonReflectionComponent>(),
  44. azrtti_typeid<PythonMarshalComponent>(),
  45. azrtti_typeid<PythonLogSymbolsComponent>()
  46. };
  47. }
  48. };
  49. }
  50. // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
  51. // The first parameter should be GemName_GemIdLower
  52. // The second should be the fully qualified name of the class above
  53. AZ_DECLARE_MODULE_CLASS(Gem_EditorPythonBindings, EditorPythonBindings::EditorPythonBindingsModule)