Forráskód Böngészése

Switch override prefs from setreg to CVars, and default the DPE Inspector to "off" (#16824)

* made a new CVar for AssetEditor DPE support

Signed-off-by: Alex Montgomery <[email protected]>

* fix for Linux DPEs not automatically resizing

Signed-off-by: Alex Montgomery <[email protected]>

* switch override flags from setreg to CVars

Signed-off-by: Alex Montgomery <[email protected]>

* remove overarchng DPE flag, and add an Inspector-specific one

Signed-off-by: Alex Montgomery <[email protected]>

* Update Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabEditorPreferences.cpp

Co-authored-by: lumberyard-employee-dm <[email protected]>
Signed-off-by: Alex Montgomery <[email protected]>

* addressed PR feedback

Signed-off-by: Alex Montgomery <[email protected]>

* default outliner overrides to false

Signed-off-by: Alex Montgomery <[email protected]>

* fix Inspector override tests

Signed-off-by: Alex Montgomery <[email protected]>

* remove unnecessary extern

Signed-off-by: Alex Montgomery <[email protected]>

* fix more tests

Signed-off-by: Alex Montgomery <[email protected]>

* fix some missed tests

Signed-off-by: Alex Montgomery <[email protected]>

* fix tests to save/restore cvar settings

Signed-off-by: Alex Montgomery <[email protected]>

* stupid copy pasta fix

Signed-off-by: Alex Montgomery <[email protected]>

* string fix

Signed-off-by: Alex Montgomery <[email protected]>

---------

Signed-off-by: Alex Montgomery <[email protected]>
Co-authored-by: lumberyard-employee-dm <[email protected]>
Alex Montgomery 1 éve
szülő
commit
9f9829b26a
18 módosított fájl, 111 hozzáadás és 80 törlés
  1. 3 3
      AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_DPEOverrides.py
  2. 6 6
      AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Main.py
  3. 1 1
      AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Periodic.py
  4. 1 1
      AutomatedTesting/Gem/PythonTests/editor/EditorScripts/DPE_AllComponentPropertyTypesEditable.py
  5. 1 1
      AutomatedTesting/Gem/PythonTests/editor/EditorScripts/DPE_AllComponentsAddedRemoved.py
  6. 1 1
      AutomatedTesting/Gem/PythonTests/editor/TestSuite_DPE.py
  7. 4 7
      Code/Framework/AzFramework/AzFramework/DocumentPropertyEditor/ReflectionAdapter.cpp
  8. 11 17
      Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorTab.cpp
  9. 23 11
      Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabEditorPreferences.cpp
  10. 0 2
      Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabEditorPreferences.h
  11. 0 18
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/DocumentPropertyEditor/DocumentPropertyEditor.cpp
  12. 0 5
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/DocumentPropertyEditor/DocumentPropertyEditor.h
  13. 25 4
      Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp
  14. 8 0
      Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeFixture.cpp
  15. 1 0
      Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeFixture.h
  16. 14 0
      Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeSelectionFixture.h
  17. 10 3
      Code/Framework/AzToolsFramework/Tests/Prefab/Overrides/PrefabInspectorOverrideTestFixture.cpp
  18. 2 0
      Code/Framework/AzToolsFramework/Tests/Prefab/Overrides/PrefabInspectorOverrideTestFixture.h

+ 3 - 3
AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_DPEOverrides.py

@@ -17,9 +17,9 @@ class TestAutomationOverridesEnabled(EditorTestSuite):
 
     # These tests will execute with Outliner Overrides/Inspector DPE/Inspector Overrides enabled
     EditorTestSuite.global_extra_cmdline_args.extend(
-        [f"--regset=/O3DE/Preferences/Prefabs/EnableOutlinerOverrideManagement=true",
-         f"--regset=/O3DE/Preferences/Prefabs/EnableInspectorOverrideManagement=true",
-         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableDPE=true"])
+        [f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableOutlinerOverrideManagement=true",
+         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableInspectorOverrideManagement=true",
+         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableDPEInspector=true"])
 
     # Add Entity Tests
     class test_AddEntity_UnderAnotherEntity(EditorBatchedTest):

+ 6 - 6
AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Main.py

@@ -17,9 +17,9 @@ class TestAutomationOverridesDisabled(EditorTestSuite):
 
     # These tests will execute with Outliner Overrides/Inspector DPE/Inspector Overrides disabled
     EditorTestSuite.global_extra_cmdline_args.extend(
-        [f"--regset=/O3DE/Preferences/Prefabs/EnableOutlinerOverrideManagement=false",
-         f"--regset=/O3DE/Preferences/Prefabs/EnableInspectorOverrideManagement=false",
-         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableDPE=false"])
+        [f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableOutlinerOverrideManagement=false",
+         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableInspectorOverrideManagement=false",
+         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableDPEInspector=false"])
 
     # Add Entity Tests
     class test_AddEntity_UnderAnotherEntity(EditorBatchedTest):
@@ -182,9 +182,9 @@ class TestAutomationOverrides(EditorTestSuite):
 
     # These tests will execute with Outliner Overrides/Inspector DPE/Inspector Overrides enabled
     EditorTestSuite.global_extra_cmdline_args.extend(
-        [f"--regset=/O3DE/Preferences/Prefabs/EnableOutlinerOverrideManagement=true",
-         f"--regset=/O3DE/Preferences/Prefabs/EnableInspectorOverrideManagement=true",
-         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableDPE=true"])
+        [f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableOutlinerOverrideManagement=true",
+         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableInspectorOverrideManagement=true",
+         f"--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableDPEInspector=true"])
 
     # Overrides Tests
 

+ 1 - 1
AutomatedTesting/Gem/PythonTests/Prefab/TestSuite_Periodic.py

@@ -16,7 +16,7 @@ from ly_test_tools.o3de.editor_test import EditorBatchedTest, EditorSingleTest,
 class TestAutomationNoOverrides(EditorTestSuite):
 
     # These tests will execute with prefab outliner overrides disabled
-    EditorTestSuite.global_extra_cmdline_args.append("--regset=O3DE/Preferences/Prefabs/EnableOutlinerOverrideManagement=false")
+    EditorTestSuite.global_extra_cmdline_args.append("--regset=/O3DE/Autoexec/ConsoleCommands/ed_enableOutlinerOverrideManagement=false")
 
     @pytest.mark.skip(reason="Single test case to avoid suite failure. Can be removed when other tests are added.")
     class test_DummyTest(EditorSingleTest):

+ 1 - 1
AutomatedTesting/Gem/PythonTests/editor/EditorScripts/DPE_AllComponentPropertyTypesEditable.py

@@ -67,7 +67,7 @@ def DPE_AllComponentPropertyTypesEditable():
         TestHelper.open_level("", "Base")
 
         # Verify the DPE is enabled
-        Report.critical_result(Tests.dpe_enabled, general.get_cvar("ed_enableDPE") == "true")
+        Report.critical_result(Tests.dpe_enabled, general.get_cvar("ed_enableDPEInspector") == "true")
 
         # Create several new entities to hold various components
         dither_entity = EditorEntity.create_editor_entity("DitherComponentTestEntity")

+ 1 - 1
AutomatedTesting/Gem/PythonTests/editor/EditorScripts/DPE_AllComponentsAddedRemoved.py

@@ -348,7 +348,7 @@ def DPE_AllComponentsAddedRemoved():
         TestHelper.open_level("", "Base")
 
         # Verify the DPE is enabled
-        Report.critical_result(Tests.dpe_enabled, general.get_cvar("ed_enableDPE") == "true")
+        Report.critical_result(Tests.dpe_enabled, general.get_cvar("ed_enableDPEInspector") == "true")
 
         # Loop through list of components
         for component_category in all_component_categories:

+ 1 - 1
AutomatedTesting/Gem/PythonTests/editor/TestSuite_DPE.py

@@ -16,7 +16,7 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorTestSuite
 class TestAutomationDPE(EditorTestSuite):
 
     # Disable Batch Mode and autotest mode and enable the DPE
-    global_extra_cmdline_args = ["-ed_enableDPE=true"]
+    global_extra_cmdline_args = ["-ed_enableDPEInspector=true"]
 
     @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/15718, https://github.com/o3de/o3de/issues/15704, "
                               "https://github.com/o3de/o3de/issues/15695, https://github.com/o3de/o3de/issues/15579")

+ 4 - 7
Code/Framework/AzFramework/AzFramework/DocumentPropertyEditor/ReflectionAdapter.cpp

@@ -7,6 +7,7 @@
  */
 
 #include <AzCore/Component/ComponentApplicationBus.h>
+#include <AzCore/Console/IConsole.h>
 #include <AzCore/DOM/Backends/JSON/JsonSerializationUtils.h>
 #include <AzCore/DOM/DomPrefixTree.h>
 #include <AzCore/DOM/DomUtils.h>
@@ -27,8 +28,6 @@ namespace AZ::DocumentPropertyEditor
         // Look-up table of onChanged callbacks for handling property changes
         AZ::Dom::DomPrefixTree<AZStd::function<Dom::Value(const Dom::Value&)>> m_onChangedCallbacks;
 
-        static constexpr AZStd::string_view InspectorOverrideManagementKey = "/O3DE/Preferences/Prefabs/EnableInspectorOverrideManagement";
-
         //! This represents a container or associative container instance and has methods
         //! for interacting with the container.
         struct BoundContainer
@@ -490,13 +489,11 @@ namespace AZ::DocumentPropertyEditor
 
         bool IsInspectorOverrideManagementEnabled()
         {
-            bool isInspectorOverrideManagementEnabled = true;
-
-            if (auto* registry = AZ::SettingsRegistry::Get())
+            bool isInspectorOverrideManagementEnabled = false;
+            if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
             {
-                registry->Get(isInspectorOverrideManagementEnabled, InspectorOverrideManagementKey);
+                console->GetCvarValue("ed_enableInspectorOverrideManagement", isInspectorOverrideManagementEnabled);
             }
-
             return isInspectorOverrideManagementEnabled;
         }
 

+ 11 - 17
Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorTab.cpp

@@ -57,18 +57,16 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QFileInfo::d_ptr':
 AZ_POP_DISABLE_WARNING
 #include <QAction>
 
-AZ_CVAR_EXTERNED(bool, ed_enableDPE);
-
-AZ_CVAR(
-    bool,
-    ed_enableDPEAssetEditor,
-    false,
-    nullptr,
-    AZ::ConsoleFunctorFlags::DontReplicate | AZ::ConsoleFunctorFlags::DontDuplicate,
-    "If set, enables experimental Document Property Editor for the AssetEditor");
-
 namespace AzToolsFramework
 {
+    AZ_CVAR(
+        bool,
+        ed_enableDPEAssetEditor,
+        false,
+        nullptr,
+        AZ::ConsoleFunctorFlags::DontReplicate | AZ::ConsoleFunctorFlags::DontDuplicate,
+        "If set, enables experimental Document Property Editor for the AssetEditor");
+
     namespace AssetEditor
     {
         // Amount to add on to the save confirm dialog text width to account for the icon etc when padding.
@@ -168,14 +166,10 @@ namespace AzToolsFramework
 
             QWidget* propertyEditor = nullptr;
 
-            // use the DPE version of the AssetEditor if both ed_enableDPE and ed_enableDPEAssetEditor are enabled
-            m_useDPE = DocumentPropertyEditor::ShouldReplaceRPE();
-            if (m_useDPE)
+            // use the DPE version of the AssetEditor if ed_enableDPEAssetEditor is enabled
+            if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
             {
-                if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
-                {
-                    console->GetCvarValue("ed_enableDPEAssetEditor", m_useDPE);
-                }
+                console->GetCvarValue("ed_enableDPEAssetEditor", m_useDPE);
             }
 
             if (!m_useDPE)

+ 23 - 11
Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabEditorPreferences.cpp

@@ -6,14 +6,29 @@
  *
  */
 
+#include <AzCore/Console/IConsole.h>
 #include <AzCore/Settings/SettingsRegistry.h>
 #include <AzToolsFramework/Prefab/PrefabEditorPreferences.h>
 
+AZ_CVAR(
+    bool,
+    ed_enableInspectorOverrideManagement,
+    false,
+    nullptr,
+    AZ::ConsoleFunctorFlags::DontReplicate | AZ::ConsoleFunctorFlags::DontDuplicate,
+    "If set, enables experimental prefab override support in the Entity Inspector");
+
+AZ_CVAR(
+    bool,
+    ed_enableOutlinerOverrideManagement,
+    false,
+    nullptr,
+    AZ::ConsoleFunctorFlags::DontReplicate | AZ::ConsoleFunctorFlags::DontDuplicate,
+    "If set, enables experimental prefab override support in the Outliner");
+
 namespace AzToolsFramework::Prefab
 {
     const AZStd::string_view HotReloadToggleKey = "/O3DE/Preferences/Prefabs/EnableHotReloading";
-    const AZStd::string_view InspectorOverrideManagementKey = "/O3DE/Preferences/Prefabs/EnableInspectorOverrideManagement";
-    const AZStd::string_view OutlinerOverrideManagementKey = "/O3DE/Preferences/Prefabs/EnableOutlinerOverrideManagement";
 
     bool IsHotReloadingEnabled()
     {
@@ -29,24 +44,21 @@ namespace AzToolsFramework::Prefab
 
     bool IsOutlinerOverrideManagementEnabled()
     {
-        bool isOutlinerOverrideManagementEnabled = true;
-        if (auto* registry = AZ::SettingsRegistry::Get())
+        bool isOutlinerOverrideManagementEnabled = false;
+        if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
         {
-            registry->Get(isOutlinerOverrideManagementEnabled, OutlinerOverrideManagementKey);
+            console->GetCvarValue("ed_enableOutlinerOverrideManagement", isOutlinerOverrideManagementEnabled);
         }
-
         return isOutlinerOverrideManagementEnabled;
     }
 
     bool IsInspectorOverrideManagementEnabled()
     {
-        bool isInspectorOverrideManagementEnabled = true;
-
-        if (auto* registry = AZ::SettingsRegistry::Get())
+        bool isInspectorOverrideManagementEnabled = false;
+        if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
         {
-            registry->Get(isInspectorOverrideManagementEnabled, InspectorOverrideManagementKey);
+            console->GetCvarValue("ed_enableInspectorOverrideManagement", isInspectorOverrideManagementEnabled);
         }
-
         return isInspectorOverrideManagementEnabled;
     }
 

+ 0 - 2
Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabEditorPreferences.h

@@ -13,8 +13,6 @@
 namespace AzToolsFramework::Prefab
 {
     extern const AZStd::string_view HotReloadToggleKey;
-    extern const AZStd::string_view InspectorOverrideManagementKey;
-    extern const AZStd::string_view OutlinerOverrideManagementKey;
     
     //! Checks if hot reloading for prefab files is enabled.
     bool IsHotReloadingEnabled();

+ 0 - 18
Code/Framework/AzToolsFramework/AzToolsFramework/UI/DocumentPropertyEditor/DocumentPropertyEditor.cpp

@@ -23,14 +23,6 @@
 #include <AzToolsFramework/UI/DPEDebugViewer/DPEDebugWindow.h>
 #include <AzToolsFramework/UI/DocumentPropertyEditor/KeyQueryDPE.h>
 
-AZ_CVAR(
-    bool,
-    ed_enableDPE,
-    true,
-    nullptr,
-    AZ::ConsoleFunctorFlags::DontReplicate | AZ::ConsoleFunctorFlags::DontDuplicate,
-    "If set, enables experimental Document Property Editor support, replacing the Reflected Property Editor where possible");
-
 AZ_CVAR(
     bool,
     ed_enableCVarDPE,
@@ -1601,16 +1593,6 @@ namespace AzToolsFramework
         m_spawnDebugView = shouldSpawn;
     }
 
-    bool DocumentPropertyEditor::ShouldReplaceRPE()
-    {
-        bool dpeEnabled = false;
-        if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
-        {
-            console->GetCvarValue(GetEnableDPECVarName(), dpeEnabled);
-        }
-        return dpeEnabled;
-    }
-
     bool DocumentPropertyEditor::ShouldReplaceCVarEditor()
     {
         bool dpeCVarEditorEnabled = false;

+ 0 - 5
Code/Framework/AzToolsFramework/AzToolsFramework/UI/DocumentPropertyEditor/DocumentPropertyEditor.h

@@ -221,11 +221,6 @@ namespace AzToolsFramework
         // but can be overridden here
         void SetSpawnDebugView(bool shouldSpawn);
 
-        static constexpr const char* GetEnableDPECVarName()
-        {
-            return "ed_enableDPE";
-        }
-        static bool ShouldReplaceRPE();
         static bool ShouldReplaceCVarEditor();
 
         static constexpr const char* GetEnableCVarEditorName()

+ 25 - 4
Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp

@@ -18,6 +18,7 @@ AZ_POP_DISABLE_WARNING
 #include <AzCore/Component/Entity.h>
 #include <AzCore/Component/TickBus.h>
 #include <AzCore/Component/TransformBus.h>
+#include <AzCore/Console/IConsole.h>
 #include <AzCore/Debug/Profiler.h>
 #include <AzCore/IO/FileIO.h>
 #include <AzCore/Serialization/SerializeContext.h>
@@ -129,6 +130,26 @@ namespace AzToolsFramework
     constexpr const char* kPropertyEditorMenuActionMoveUp("editor/propertyEditorMoveUp");
     constexpr const char* kPropertyEditorMenuActionMoveDown("editor/propertyEditorMoveDown");
 
+    static constexpr const char* enableDPECVarName = "ed_enableDPEInspector";
+
+    AZ_CVAR(
+        bool,
+        ed_enableDPEInspector,
+        false,
+        nullptr,
+        AZ::ConsoleFunctorFlags::DontReplicate | AZ::ConsoleFunctorFlags::DontDuplicate,
+        "If set, enables experimental Document Property Editor support for the Entity Inspector");
+
+    static bool ShouldUseDPE()
+    {
+        bool dpeEnabled = false;
+        if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
+        {
+            console->GetCvarValue(enableDPECVarName, dpeEnabled);
+        }
+        return dpeEnabled;
+    }
+
     //since component editors are spaced apart to make room for drop indicator,
     //giving drop logic simple buffer so drops between editors don't go to the bottom
     static const int kComponentEditorDropTargetPrecision = 6;
@@ -510,7 +531,7 @@ namespace AzToolsFramework
         , m_commandInvokedHandler(
               [this](AZStd::string_view command, const AZ::ConsoleCommandContainer&, AZ::ConsoleFunctorFlags, AZ::ConsoleInvokedFrom)
               {
-                  if (command == AzToolsFramework::DocumentPropertyEditor::GetEnableDPECVarName())
+                  if (command == enableDPECVarName)
                   {
                       ClearInstances();
                       for (auto componentEditor : m_componentEditors)
@@ -1816,7 +1837,7 @@ namespace AzToolsFramework
             }
 
             // Set up other entity property editor customization
-            if (DocumentPropertyEditor::ShouldReplaceRPE() && Prefab::IsInspectorOverrideManagementEnabled())
+            if (ShouldUseDPE() && Prefab::IsInspectorOverrideManagementEnabled())
             {
                 // Set up visualization for overrides on the component
                 UpdateOverrideVisualization(*componentEditor);
@@ -1906,7 +1927,7 @@ namespace AzToolsFramework
             ComponentEditor::ComponentAdapterFactory adapterFactory =
                 [&]() -> AZStd::shared_ptr<AZ::DocumentPropertyEditor::ComponentAdapter>
             {
-                if (DocumentPropertyEditor::ShouldReplaceRPE())
+                if (ShouldUseDPE())
                 {
                     return (
                         Prefab::IsInspectorOverrideManagementEnabled()
@@ -1939,7 +1960,7 @@ namespace AzToolsFramework
             componentEditor->GetPropertyEditor()->SetHiddenQueryFunction([this](const InstanceDataNode* node) { return QueryInstanceDataNodeHiddenStatus(node); });
             componentEditor->GetPropertyEditor()->SetIndicatorQueryFunction([this](const InstanceDataNode* node) { return GetAppropriateIndicator(node); });
 
-            if (DocumentPropertyEditor::ShouldReplaceRPE() && Prefab::IsInspectorOverrideManagementEnabled())
+            if (ShouldUseDPE() && Prefab::IsInspectorOverrideManagementEnabled())
             {
                 // Connect to the component icon's click event to display override context menu
                 connect(

+ 8 - 0
Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeFixture.cpp

@@ -42,6 +42,12 @@ namespace UnitTest
         m_focusModeInterface = AZ::Interface<AzToolsFramework::FocusModeInterface>::Get();
         ASSERT_TRUE(m_focusModeInterface != nullptr);
 
+        if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
+        {
+            console->GetCvarValue("ed_enableOutlinerOverrideManagement", m_ed_enableOutlinerOverrideManagement);
+            console->PerformCommand("ed_enableOutlinerOverrideManagement true");
+        }
+
         // register a simple component implementing BoundsRequestBus and EditorComponentSelectionRequestsBus
         GetApplication()->RegisterComponentDescriptor(UnitTest::BoundsTestComponent::CreateDescriptor());
 
@@ -67,6 +73,8 @@ namespace UnitTest
 
         // Clear selection
         ClearSelectedEntities();
+        AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
+        registry->Set("/O3DE/Autoexec/ConsoleCommands/ed_enableOutlinerOverrideManagement", m_ed_enableOutlinerOverrideManagement);
     }
 
     void EditorFocusModeFixture::GenerateTestHierarchy()

+ 1 - 0
Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeFixture.h

@@ -32,6 +32,7 @@ namespace UnitTest
 
         AzToolsFramework::ContainerEntityInterface* m_containerEntityInterface = nullptr;
         AzToolsFramework::FocusModeInterface* m_focusModeInterface = nullptr;
+        bool m_ed_enableOutlinerOverrideManagement = false;
 
     public:
         AzToolsFramework::EntityIdList GetSelectedEntities();

+ 14 - 0
Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeSelectionFixture.h

@@ -25,6 +25,7 @@
 #include <AzToolsFramework/Manipulators/LinearManipulator.h>
 #include <AzToolsFramework/Manipulators/ManipulatorManager.h>
 #include <AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.h>
+#include <AzToolsFramework/Prefab/PrefabEditorPreferences.h>
 
 namespace UnitTest
 {
@@ -33,10 +34,20 @@ namespace UnitTest
     public:
         void SetUpEditorFixtureImpl() override
         {
+            AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
+            m_formerOutlinerOverrideSetting = AzToolsFramework::Prefab::IsOutlinerOverrideManagementEnabled();
+            registry->Set("/O3DE/Autoexec/ConsoleCommands/ed_enableOutlinerOverrideManagement", true);
             IndirectCallManipulatorViewportInteractionFixtureMixin<EditorFocusModeFixture>::SetUpEditorFixtureImpl();
             m_viewportManipulatorInteraction->GetViewportInteraction().SetIconsVisible(false);
         }
 
+        void TearDownEditorFixtureImpl() override
+        {
+            AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
+            IndirectCallManipulatorViewportInteractionFixtureMixin<EditorFocusModeFixture>::TearDownEditorFixtureImpl();
+            registry->Set("/O3DE/Autoexec/ConsoleCommands/ed_enableOutlinerOverrideManagement", m_formerOutlinerOverrideSetting);
+        }
+
         void ClickAtWorldPositionOnViewport(const AZ::Vector3& worldPosition)
         {
             // Calculate the world position in screen space
@@ -60,5 +71,8 @@ namespace UnitTest
                 ->MousePosition(endingPositionWorldBoxSelect)
                 ->MouseLButtonUp();
         }
+
+    protected:
+        bool m_formerOutlinerOverrideSetting = false;
     };
 } // namespace UnitTest

+ 10 - 3
Code/Framework/AzToolsFramework/Tests/Prefab/Overrides/PrefabInspectorOverrideTestFixture.cpp

@@ -15,10 +15,14 @@ namespace UnitTest
     void PrefabInspectorOverrideTestFixture::SetUpEditorFixtureImpl()
     {
         // Enable feature flags for DPE and InspectorOverrideManagement
-        AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
-        registry->Set(InspectorOverrideManagementKey, true);
-        registry->Set("/O3DE/Autoexec/ConsoleCommands/ed_enableDPE", true);
+        if (auto* console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
+        {
+            console->GetCvarValue("ed_enableInspectorOverrideManagement", m_ed_enableInspectorOverrideManagement);
+            console->GetCvarValue("ed_enableDPEInspector", m_ed_enableDPEInspector);
+            console->PerformCommand("ed_enableInspectorOverrideManagement true");
+            console->PerformCommand("ed_enableDPEInspector true");
 
+        }
         PrefabOverrideTestFixture::SetUpEditorFixtureImpl();
 
         m_testEntityPropertyEditor = AZStd::make_unique<AzToolsFramework::EntityPropertyEditor>(nullptr, Qt::WindowFlags(), false);
@@ -28,6 +32,9 @@ namespace UnitTest
     {
         m_testEntityPropertyEditor.reset();
         PrefabOverrideTestFixture::TearDownEditorFixtureImpl();
+        AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get();
+        registry->Set("/O3DE/Autoexec/ConsoleCommands/ed_enableDPEInspector", m_ed_enableDPEInspector);
+        registry->Set("/O3DE/Autoexec/ConsoleCommands/ed_enableInspectorOverrideManagement", m_ed_enableInspectorOverrideManagement);
     }
 
     void PrefabInspectorOverrideTestFixture::GenerateComponentAdapterDoms(AZ::EntityId entityId)

+ 2 - 0
Code/Framework/AzToolsFramework/Tests/Prefab/Overrides/PrefabInspectorOverrideTestFixture.h

@@ -29,5 +29,7 @@ namespace UnitTest
             const AzToolsFramework::ComponentEditor::VisitComponentAdapterContentsCallback& callback);
 
         AZStd::unique_ptr<AzToolsFramework::EntityPropertyEditor> m_testEntityPropertyEditor;
+        bool m_ed_enableDPEInspector = false;
+        bool m_ed_enableInspectorOverrideManagement = false;
     };
 } // namespace UnitTest