diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.cpp index 86a9c36c56..64f7f2dd97 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.cpp @@ -11,32 +11,29 @@ #include -namespace AZ +namespace AZ::EMotionFXAtom { - namespace EMotionFXAtom + void EditorSystemComponent::Reflect(ReflectContext* context) { - void EditorSystemComponent::Reflect(ReflectContext* context) + if (SerializeContext* serialize = azrtti_cast(context)) { - if (SerializeContext* serialize = azrtti_cast(context)) - { - serialize->Class()->Version(0); - } - } - - void EditorSystemComponent::Activate() - { - EMotionFX::Integration::SystemNotificationBus::Handler::BusConnect(); - } - - void EditorSystemComponent::Deactivate() - { - EMotionFX::Integration::SystemNotificationBus::Handler::BusDisconnect(); - } - - void EditorSystemComponent::OnRegisterPlugin() - { - EMStudio::PluginManager* pluginManager = EMStudio::EMStudioManager::GetInstance()->GetPluginManager(); - pluginManager->RegisterPlugin(new EMStudio::AtomRenderPlugin()); + serialize->Class()->Version(0); } } -} // namespace AZ + + void EditorSystemComponent::Activate() + { + EMotionFX::Integration::SystemNotificationBus::Handler::BusConnect(); + } + + void EditorSystemComponent::Deactivate() + { + EMotionFX::Integration::SystemNotificationBus::Handler::BusDisconnect(); + } + + void EditorSystemComponent::OnRegisterPlugin() + { + EMStudio::PluginManager* pluginManager = EMStudio::EMStudioManager::GetInstance()->GetPluginManager(); + pluginManager->RegisterPlugin(new EMStudio::AtomRenderPlugin()); + } +} // namespace AZ::EMotionFXAtom diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.h index 6121912481..9da98bcf42 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/Editor/EditorSystemComponent.h @@ -10,26 +10,23 @@ #include #include -namespace AZ +namespace AZ::EMotionFXAtom { - namespace EMotionFXAtom + class EditorSystemComponent + : public Component + , private EMotionFX::Integration::SystemNotificationBus::Handler { - class EditorSystemComponent - : public Component - , private EMotionFX::Integration::SystemNotificationBus::Handler - { - public: - AZ_COMPONENT(EditorSystemComponent, "{1FAEC046-255D-4664-8F12-D16503C34431}"); + public: + AZ_COMPONENT(EditorSystemComponent, "{1FAEC046-255D-4664-8F12-D16503C34431}"); - static void Reflect(ReflectContext* context); + static void Reflect(ReflectContext* context); - protected: - // AZ::Component - void Activate() override; - void Deactivate() override; + protected: + // AZ::Component + void Activate() override; + void Deactivate() override; - // SystemNotificationBus::OnRegisterPlugin - void OnRegisterPlugin() override; - }; - } // namespace EMotionFXAtom -} // namespace AZ + // SystemNotificationBus::OnRegisterPlugin + void OnRegisterPlugin() override; + }; +} // namespace AZ::EMotionFXAtom diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp index f7da1d19a9..c7e2178366 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.cpp @@ -21,6 +21,51 @@ namespace EMStudio } + const char* AtomRenderPlugin::GetName() const + { + return "Atom Render Window"; + } + + uint32 AtomRenderPlugin::GetClassID() const + { + return static_cast(AtomRenderPlugin::CLASS_ID); + } + + const char* AtomRenderPlugin::GetCreatorName() const + { + return "O3DE"; + } + + float AtomRenderPlugin::GetVersion() const + { + return 1.0f; + } + + bool AtomRenderPlugin::GetIsClosable() const + { + return true; + } + + bool AtomRenderPlugin::GetIsFloatable() const + { + return true; + } + + bool AtomRenderPlugin::GetIsVertical() const + { + return false; + } + + EMStudioPlugin* AtomRenderPlugin::Clone() + { + return new AtomRenderPlugin(); + } + + EMStudioPlugin::EPluginType AtomRenderPlugin::GetPluginType() const + { + return EMStudioPlugin::PLUGINTYPE_RENDERING; + } + bool AtomRenderPlugin::Init() { m_innerWidget = new QWidget(); diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.h index b3e47df91c..0fb1443a96 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AtomRenderPlugin.h @@ -28,48 +28,16 @@ namespace EMStudio ~AtomRenderPlugin(); // Plugin information - const char* GetCompileDate() const override - { - return MCORE_DATE; - } - const char* GetName() const override - { - return "Atom Render Window"; - } - uint32 GetClassID() const override - { - return static_cast(AtomRenderPlugin::CLASS_ID); - } - const char* GetCreatorName() const override - { - return "O3DE"; - } - float GetVersion() const override - { - return 1.0f; - } - bool GetIsClosable() const override - { - return true; - } - bool GetIsFloatable() const override - { - return true; - } - bool GetIsVertical() const override - { - return false; - } - + const char* GetName() const override; + uint32 GetClassID() const override; + const char* GetCreatorName() const override; + float GetVersion() const override; + bool GetIsClosable() const override; + bool GetIsFloatable() const override; + bool GetIsVertical() const override; bool Init() override; - EMStudioPlugin* Clone() - { - return new AtomRenderPlugin(); - } - EMStudioPlugin::EPluginType GetPluginType() const override - { - return EMStudioPlugin::PLUGINTYPE_RENDERING; - } + EMStudioPlugin* Clone(); + EMStudioPlugin::EPluginType GetPluginType() const override; private: QWidget* m_innerWidget; diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp index 432a351edf..b385de62be 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.cpp @@ -104,7 +104,6 @@ namespace EMStudio AZ::Interface::Register(this); } - // destructor EMStudioManager::~EMStudioManager() { @@ -498,4 +497,49 @@ namespace EMStudio path.addText(textPos, font, text); painter.drawPath(path); } + + // shortcuts + QApplication* GetApp() + { + return EMStudioManager::GetInstance()->GetApp(); + } + EMStudioManager* GetManager() + { + return EMStudioManager::GetInstance(); + } + + bool HasMainWindow() + { + return EMStudioManager::GetInstance()->HasMainWindow(); + } + + MainWindow* GetMainWindow() + { + return EMStudioManager::GetInstance()->GetMainWindow(); + } + + PluginManager* GetPluginManager() + { + return EMStudioManager::GetInstance()->GetPluginManager(); + } + + LayoutManager* GetLayoutManager() + { + return EMStudioManager::GetInstance()->GetLayoutManager(); + } + + NotificationWindowManager* GetNotificationWindowManager() + { + return EMStudioManager::GetInstance()->GetNotificationWindowManager(); + } + + MotionEventPresetManager* GetEventPresetManager() + { + return EMStudioManager::GetInstance()->GetEventPresetManger(); + } + + CommandSystem::CommandManager* GetCommandManager() + { + return EMStudioManager::GetInstance()->GetCommandManager(); + } } // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h index 8828253ea2..e7a9397b22 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h @@ -157,41 +157,14 @@ namespace EMStudio EventProcessingCallback* m_eventProcessingCallback; }; - // shortcuts - MCORE_INLINE QApplication* GetApp() - { - return EMStudioManager::GetInstance()->GetApp(); - } - MCORE_INLINE EMStudioManager* GetManager() - { - return EMStudioManager::GetInstance(); - } - MCORE_INLINE bool HasMainWindow() - { - return EMStudioManager::GetInstance()->HasMainWindow(); - } - MCORE_INLINE MainWindow* GetMainWindow() - { - return EMStudioManager::GetInstance()->GetMainWindow(); - } - MCORE_INLINE PluginManager* GetPluginManager() - { - return EMStudioManager::GetInstance()->GetPluginManager(); - } - MCORE_INLINE LayoutManager* GetLayoutManager() - { - return EMStudioManager::GetInstance()->GetLayoutManager(); - } - MCORE_INLINE NotificationWindowManager* GetNotificationWindowManager() - { - return EMStudioManager::GetInstance()->GetNotificationWindowManager(); - } - MCORE_INLINE MotionEventPresetManager* GetEventPresetManager() - { - return EMStudioManager::GetInstance()->GetEventPresetManger(); - } - MCORE_INLINE CommandSystem::CommandManager* GetCommandManager() - { - return EMStudioManager::GetInstance()->GetCommandManager(); - } + // Shortcuts + QApplication* GetApp(); + EMStudioManager* GetManager(); + bool HasMainWindow(); + MainWindow* GetMainWindow(); + PluginManager* GetPluginManager(); + LayoutManager* GetLayoutManager(); + NotificationWindowManager* GetNotificationWindowManager(); + MotionEventPresetManager* GetEventPresetManager(); + CommandSystem::CommandManager* GetCommandManager(); } // namespace EMStudio