Atom Tools: Removing unnecessary modules, components, and dead code from ME

• Working toward creating a standalone application template
Removing application level modules and system components that make it difficult to navigate the project and add a lot of boilerplate code
• Temporarily keeping viewport module and components because shutting down the application deactivates module entities before system entities without respecting component service dependency order. This caused several RPI assets and names to leak because they were not being destroyed in the correct order.
• Fixing include paths not referenced source folders
• Mostly cleanup and reorganization, no behavioral changes

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
Guthrie Adams
2022-01-20 00:10:07 -06:00
parent bcc155049d
commit c98d14ad92
80 changed files with 327 additions and 736 deletions
@@ -6,7 +6,6 @@
*
*/
#include <Atom/Document/MaterialDocumentSettings.h>
#include <Atom/RPI.Edit/Common/AssetUtils.h>
#include <Atom/RPI.Edit/Material/MaterialSourceData.h>
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
@@ -15,6 +14,7 @@
#include <AzFramework/Application/Application.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <Document/MaterialDocumentSettings.h>
#include <Window/CreateMaterialDialog/CreateMaterialDialog.h>
namespace MaterialEditor
@@ -10,7 +10,7 @@
#include <AzCore/std/containers/vector.h>
#include <Source/Window/CreateMaterialDialog/ui_CreateMaterialDialog.h>
#include <Window/CreateMaterialDialog/ui_CreateMaterialDialog.h>
#include <QFileInfo>
@@ -6,7 +6,7 @@
*
*/
#include <Source/Window/HelpDialog/HelpDialog.h>
#include <Window/HelpDialog/HelpDialog.h>
namespace MaterialEditor
{
@@ -20,4 +20,4 @@ namespace MaterialEditor
HelpDialog::~HelpDialog() = default;
} // namespace MaterialEditor
#include <Source/Window/HelpDialog/moc_HelpDialog.cpp>
#include <Window/HelpDialog/moc_HelpDialog.cpp>
@@ -13,7 +13,7 @@
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
#include <QDialog>
#include <Source/Window/HelpDialog/ui_HelpDialog.h>
#include <Window/HelpDialog/ui_HelpDialog.h>
AZ_POP_DISABLE_WARNING
#endif
@@ -6,19 +6,19 @@
*
*/
#include <Atom/Document/MaterialDocumentRequestBus.h>
#include <Atom/RHI/Factory.h>
#include <Atom/RPI.Edit/Material/MaterialSourceData.h>
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
#include <Atom/Window/MaterialEditorWindowSettings.h>
#include <AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h>
#include <AtomToolsFramework/Util/Util.h>
#include <AzQtComponents/Components/StyleManager.h>
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
#include <Document/MaterialDocumentRequestBus.h>
#include <Viewport/MaterialViewportWidget.h>
#include <Window/CreateMaterialDialog/CreateMaterialDialog.h>
#include <Window/HelpDialog/HelpDialog.h>
#include <Window/MaterialEditorWindow.h>
#include <Window/MaterialEditorWindowSettings.h>
#include <Window/MaterialInspector/MaterialInspector.h>
#include <Window/PerformanceMonitor/PerformanceMonitorWidget.h>
#include <Window/SettingsDialog/SettingsDialog.h>
@@ -1,89 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AtomToolsFramework/Window/AtomToolsMainWindowFactoryRequestBus.h>
#include <AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h>
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <AzToolsFramework/API/ViewPaneOptions.h>
#include <AzToolsFramework/UI/UICore/QWidgetSavedState.h>
#include <Window/MaterialEditorWindow.h>
#include <Window/MaterialEditorWindowComponent.h>
#include <Window/ViewportSettingsInspector/ViewportSettingsInspector.h>
namespace MaterialEditor
{
void MaterialEditorWindowComponent::Reflect(AZ::ReflectContext* context)
{
MaterialEditorWindowSettings::Reflect(context);
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
{
serialize->Class<MaterialEditorWindowComponent, AZ::Component>()
->Version(0);
}
}
void MaterialEditorWindowComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
{
required.push_back(AZ_CRC_CE("AssetBrowserService"));
required.push_back(AZ_CRC_CE("PropertyManagerService"));
required.push_back(AZ_CRC_CE("SourceControlService"));
required.push_back(AZ_CRC_CE("AtomToolsMainWindowSystemService"));
}
void MaterialEditorWindowComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
{
provided.push_back(AZ_CRC_CE("MaterialEditorWindowService"));
}
void MaterialEditorWindowComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
{
incompatible.push_back(AZ_CRC_CE("MaterialEditorWindowService"));
}
void MaterialEditorWindowComponent::Init()
{
}
void MaterialEditorWindowComponent::Activate()
{
AzToolsFramework::EditorWindowRequestBus::Handler::BusConnect();
AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusConnect();
AzToolsFramework::SourceControlConnectionRequestBus::Broadcast(&AzToolsFramework::SourceControlConnectionRequests::EnableSourceControl, true);
}
void MaterialEditorWindowComponent::Deactivate()
{
AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusDisconnect();
AzToolsFramework::EditorWindowRequestBus::Handler::BusDisconnect();
m_window.reset();
}
void MaterialEditorWindowComponent::CreateMainWindow()
{
m_materialEditorBrowserInteractions.reset(aznew MaterialEditorBrowserInteractions);
m_window.reset(aznew MaterialEditorWindow);
}
void MaterialEditorWindowComponent::DestroyMainWindow()
{
m_window.reset();
}
QWidget* MaterialEditorWindowComponent::GetAppMainWindow()
{
return m_window.get();
}
}
@@ -1,58 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzToolsFramework/API/EditorWindowRequestBus.h>
#include <AtomToolsFramework/Window/AtomToolsMainWindowFactoryRequestBus.h>
#include <Source/Window/MaterialEditorBrowserInteractions.h>
#include <Source/Window/MaterialEditorWindow.h>
namespace MaterialEditor
{
//! MaterialEditorWindowComponent is the entry point for the Material Editor gem user interface, and is mainly
//! used for initialization and registration of other classes, including MaterialEditorWindow.
class MaterialEditorWindowComponent
: public AZ::Component
, private AzToolsFramework::EditorWindowRequestBus::Handler
, private AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler
{
public:
AZ_COMPONENT(MaterialEditorWindowComponent, "{03976F19-3C74-49FE-A15F-7D3CADBA616C}");
static void Reflect(AZ::ReflectContext* context);
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
private:
////////////////////////////////////////////////////////////////////////
// AtomToolsMainWindowFactoryRequestBus::Handler overrides...
void CreateMainWindow() override;
void DestroyMainWindow() override;
////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// AzToolsFramework::EditorWindowRequests::Bus::Handler
QWidget* GetAppMainWindow() override;
//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// AZ::Component interface implementation
void Init() override;
void Activate() override;
void Deactivate() override;
////////////////////////////////////////////////////////////////////////
AZStd::unique_ptr<MaterialEditorWindow> m_window;
AZStd::unique_ptr<MaterialEditorBrowserInteractions> m_materialEditorBrowserInteractions;
};
}
@@ -1,38 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <Atom/Window/MaterialEditorWindowModule.h>
#include <Window/MaterialEditorWindowComponent.h>
void InitMaterialEditorResources()
{
//Must register qt resources from other modules
Q_INIT_RESOURCE(MaterialEditor);
Q_INIT_RESOURCE(InspectorWidget);
Q_INIT_RESOURCE(AtomToolsAssetBrowser);
}
namespace MaterialEditor
{
MaterialEditorWindowModule::MaterialEditorWindowModule()
{
InitMaterialEditorResources();
// Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
m_descriptors.insert(m_descriptors.end(), {
MaterialEditorWindowComponent::CreateDescriptor(),
});
}
AZ::ComponentTypeList MaterialEditorWindowModule::GetRequiredSystemComponents() const
{
return AZ::ComponentTypeList{
azrtti_typeid<MaterialEditorWindowComponent>(),
};
}
}
@@ -6,9 +6,9 @@
*
*/
#include <Atom/Window/MaterialEditorWindowSettings.h>
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <Window/MaterialEditorWindowSettings.h>
namespace MaterialEditor
{
@@ -0,0 +1,32 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#if !defined(Q_MOC_RUN)
#include <AzCore/Memory/Memory.h>
#include <AzCore/RTTI/RTTI.h>
#include <AzCore/RTTI/ReflectContext.h>
#include <AzCore/std/containers/unordered_set.h>
#include <AzCore/UserSettings/UserSettings.h>
#endif
namespace MaterialEditor
{
struct MaterialEditorWindowSettings
: public AZ::UserSettings
{
AZ_RTTI(MaterialEditorWindowSettings, "{BB9DEB77-B7BE-4DF5-9FDD-6D9F3136C4EA}", AZ::UserSettings);
AZ_CLASS_ALLOCATOR(MaterialEditorWindowSettings, AZ::SystemAllocator, 0);
static void Reflect(AZ::ReflectContext* context);
AZStd::vector<char> m_mainWindowState;
AZStd::unordered_set<AZ::u32> m_inspectorCollapsedGroups;
};
} // namespace MaterialEditor
@@ -6,7 +6,6 @@
*
*/
#include <Atom/Document/MaterialDocumentRequestBus.h>
#include <Atom/RPI.Edit/Common/AssetUtils.h>
#include <Atom/RPI.Edit/Material/MaterialPropertyId.h>
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
@@ -15,6 +14,7 @@
#include <AtomToolsFramework/DynamicProperty/DynamicPropertyGroup.h>
#include <AtomToolsFramework/Inspector/InspectorPropertyGroupWidget.h>
#include <AtomToolsFramework/Util/MaterialPropertyUtil.h>
#include <Document/MaterialDocumentRequestBus.h>
#include <Window/MaterialInspector/MaterialInspector.h>
namespace MaterialEditor
@@ -9,12 +9,12 @@
#pragma once
#if !defined(Q_MOC_RUN)
#include <Atom/Window/MaterialEditorWindowSettings.h>
#include <AtomToolsFramework/Document/AtomToolsDocumentNotificationBus.h>
#include <AtomToolsFramework/DynamicProperty/DynamicPropertyGroup.h>
#include <AtomToolsFramework/Inspector/InspectorWidget.h>
#include <AzCore/std/containers/unordered_map.h>
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h>
#include <Window/MaterialEditorWindowSettings.h>
#endif
namespace MaterialEditor
@@ -6,10 +6,9 @@
*
*/
#include <Atom/Viewport/PerformanceMonitorRequestBus.h>
#include <Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h>
#include <Source/Window/PerformanceMonitor/ui_PerformanceMonitorWidget.h>
#include <Viewport/PerformanceMonitorRequestBus.h>
#include <Window/PerformanceMonitor/PerformanceMonitorWidget.h>
#include <Window/PerformanceMonitor/ui_PerformanceMonitorWidget.h>
#include <QTimer>
@@ -55,4 +54,4 @@ namespace MaterialEditor
}
} // namespace MaterialEditor
#include <Source/Window/PerformanceMonitor/moc_PerformanceMonitorWidget.cpp>
#include <Window/PerformanceMonitor/moc_PerformanceMonitorWidget.cpp>
@@ -8,9 +8,9 @@
#include <Atom/Feature/Utils/LightingPreset.h>
#include <Atom/RPI.Edit/Common/AssetUtils.h>
#include <Atom/Viewport/MaterialViewportRequestBus.h>
#include <AtomToolsFramework/Util/Util.h>
#include <AzFramework/Application/Application.h>
#include <Viewport/MaterialViewportRequestBus.h>
#include <Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h>
namespace MaterialEditor
@@ -10,8 +10,8 @@
#if !defined(Q_MOC_RUN)
#include <Atom/Feature/Utils/LightingPreset.h>
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
#include <AzCore/std/containers/vector.h>
#include <Viewport/MaterialViewportNotificationBus.h>
#endif
#include <Window/PresetBrowserDialogs/PresetBrowserDialog.h>
@@ -7,9 +7,9 @@
*/
#include <Atom/Feature/Utils/ModelPreset.h>
#include <Atom/Viewport/MaterialViewportRequestBus.h>
#include <AtomToolsFramework/Util/Util.h>
#include <AzFramework/Application/Application.h>
#include <Viewport/MaterialViewportRequestBus.h>
#include <Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h>
namespace MaterialEditor
@@ -10,8 +10,8 @@
#if !defined(Q_MOC_RUN)
#include <Atom/Feature/Utils/ModelPreset.h>
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
#include <AzCore/std/containers/vector.h>
#include <Viewport/MaterialViewportNotificationBus.h>
#endif
#include <Window/PresetBrowserDialogs/PresetBrowserDialog.h>
@@ -9,10 +9,10 @@
#pragma once
#if !defined(Q_MOC_RUN)
#include <Atom/Document/MaterialDocumentSettings.h>
#include <AtomToolsFramework/Document/AtomToolsDocumentSystemSettings.h>
#include <AtomToolsFramework/Inspector/InspectorWidget.h>
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h>
#include <Document/MaterialDocumentSettings.h>
#endif
namespace MaterialEditor
@@ -6,9 +6,9 @@
*
*/
#include <Source/Window/ToolBar/LightingPresetComboBox.h>
#include <Atom/Viewport/MaterialViewportRequestBus.h>
#include <Atom/Feature/Utils/LightingPreset.h>
#include <Viewport/MaterialViewportRequestBus.h>
#include <Window/ToolBar/LightingPresetComboBox.h>
namespace MaterialEditor
{
@@ -102,4 +102,4 @@ namespace MaterialEditor
} // namespace MaterialEditor
#include <Source/Window/ToolBar/moc_LightingPresetComboBox.cpp>
#include <Window/ToolBar/moc_LightingPresetComboBox.cpp>
@@ -10,7 +10,7 @@
#if !defined(Q_MOC_RUN)
#include <QComboBox>
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
#include <Viewport/MaterialViewportNotificationBus.h>
#endif
namespace MaterialEditor
@@ -6,21 +6,21 @@
*
*/
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
#include <Atom/Viewport/MaterialViewportRequestBus.h>
#include <Atom/Viewport/MaterialViewportSettings.h>
#include <AzCore/std/containers/vector.h>
#include <Viewport/MaterialViewportNotificationBus.h>
#include <Viewport/MaterialViewportRequestBus.h>
#include <Viewport/MaterialViewportSettings.h>
#include <Window/ToolBar/LightingPresetComboBox.h>
#include <Window/ToolBar/MaterialEditorToolBar.h>
#include <Window/ToolBar/ModelPresetComboBox.h>
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
#include <AzQtComponents/Components/Widgets/ToolBar.h>
#include <QAbstractItemView>
#include <QAction>
#include <QIcon>
#include <QMenu>
#include <QToolButton>
#include <QAbstractItemView>
AZ_POP_DISABLE_WARNING
namespace MaterialEditor
@@ -11,7 +11,7 @@
#if !defined(Q_MOC_RUN)
#include <QAction>
#include <QToolBar>
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
#include <Viewport/MaterialViewportNotificationBus.h>
#endif
namespace MaterialEditor
@@ -6,9 +6,9 @@
*
*/
#include <Source/Window/ToolBar/ModelPresetComboBox.h>
#include <Atom/Viewport/MaterialViewportRequestBus.h>
#include <Atom/Feature/Utils/ModelPreset.h>
#include <Viewport/MaterialViewportRequestBus.h>
#include <Window/ToolBar/ModelPresetComboBox.h>
namespace MaterialEditor
{
@@ -102,4 +102,4 @@ namespace MaterialEditor
} // namespace MaterialEditor
#include <Source/Window/ToolBar/moc_ModelPresetComboBox.cpp>
#include <Window/ToolBar/moc_ModelPresetComboBox.cpp>
@@ -10,7 +10,7 @@
#if !defined(Q_MOC_RUN)
#include <QComboBox>
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
#include <Viewport/MaterialViewportNotificationBus.h>
#endif
namespace MaterialEditor
@@ -7,10 +7,10 @@
*/
#include <Atom/RPI.Reflect/Model/ModelAsset.h>
#include <Atom/Viewport/MaterialViewportRequestBus.h>
#include <AtomToolsFramework/Inspector/InspectorPropertyGroupWidget.h>
#include <AtomToolsFramework/Util/Util.h>
#include <AzCore/Utils/Utils.h>
#include <Viewport/MaterialViewportRequestBus.h>
#include <Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h>
#include <Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h>
#include <Window/ViewportSettingsInspector/ViewportSettingsInspector.h>
@@ -376,4 +376,4 @@ namespace MaterialEditor
} // namespace MaterialEditor
#include <Source/Window/ViewportSettingsInspector/moc_ViewportSettingsInspector.cpp>
#include <Window/ViewportSettingsInspector/moc_ViewportSettingsInspector.cpp>
@@ -12,11 +12,11 @@
#include <ACES/Aces.h>
#include <Atom/Feature/Utils/LightingPreset.h>
#include <Atom/Feature/Utils/ModelPreset.h>
#include <Atom/Viewport/MaterialViewportNotificationBus.h>
#include <Atom/Viewport/MaterialViewportSettings.h>
#include <Atom/Window/MaterialEditorWindowSettings.h>
#include <AtomToolsFramework/Inspector/InspectorWidget.h>
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h>
#include <Viewport/MaterialViewportNotificationBus.h>
#include <Viewport/MaterialViewportSettings.h>
#include <Window/MaterialEditorWindowSettings.h>
#endif
namespace MaterialEditor