[LYN-3419] Removed remaining references to checking if the new viewport interaction model is enabled.
This commit is contained in:
@@ -675,20 +675,8 @@ namespace AzToolsFramework
|
||||
// if the new viewport interaction model is enabled we do not want to
|
||||
// filter out locked entities as this breaks with the logic of being
|
||||
// able to select locked entities in the entity outliner
|
||||
if (IsNewViewportInteractionModelEnabled())
|
||||
{
|
||||
selectedEntitiesFiltered.insert(
|
||||
selectedEntitiesFiltered.begin(), selectedEntities.begin(), selectedEntities.end());
|
||||
}
|
||||
else
|
||||
{
|
||||
for (AZ::EntityId nowSelectedId : selectedEntities)
|
||||
{
|
||||
AZ_Assert(nowSelectedId.IsValid(), "Invalid entity Id being marked as selected.");
|
||||
|
||||
selectedEntitiesFiltered.push_back(nowSelectedId);
|
||||
}
|
||||
}
|
||||
selectedEntitiesFiltered.insert(
|
||||
selectedEntitiesFiltered.begin(), selectedEntities.begin(), selectedEntities.end());
|
||||
|
||||
EntityIdList newlySelectedIds;
|
||||
EntityIdList newlyDeselectedIds;
|
||||
|
||||
+10
-16
@@ -121,17 +121,14 @@ namespace AzToolsFramework
|
||||
EditorPickModeRequestBus::Handler::BusConnect(pickModeEntityContextId);
|
||||
EditorEventsBus::Handler::BusConnect();
|
||||
|
||||
if (IsNewViewportInteractionModelEnabled())
|
||||
// replace the default input handler with one specific for dealing with
|
||||
// entity selection in the viewport
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetHandler,
|
||||
[](const EditorVisibleEntityDataCache* entityDataCache)
|
||||
{
|
||||
// replace the default input handler with one specific for dealing with
|
||||
// entity selection in the viewport
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetHandler,
|
||||
[](const EditorVisibleEntityDataCache* entityDataCache)
|
||||
{
|
||||
return AZStd::make_unique<EditorPickEntitySelection>(entityDataCache);
|
||||
});
|
||||
}
|
||||
return AZStd::make_unique<EditorPickEntitySelection>(entityDataCache);
|
||||
});
|
||||
|
||||
if (!pickModeEntityContextId.IsNull())
|
||||
{
|
||||
@@ -162,12 +159,9 @@ namespace AzToolsFramework
|
||||
EditorEventsBus::Handler::BusDisconnect();
|
||||
emit OnPickComplete();
|
||||
|
||||
if (IsNewViewportInteractionModelEnabled())
|
||||
{
|
||||
// return to the default viewport editor selection
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetDefaultHandler);
|
||||
}
|
||||
// return to the default viewport editor selection
|
||||
EditorInteractionSystemViewportSelectionRequestBus::Event(
|
||||
GetEntityContextId(), &EditorInteractionSystemViewportSelection::SetDefaultHandler);
|
||||
|
||||
EditorPickModeNotificationBus::Broadcast(&EditorPickModeNotifications::OnEntityPickModeStopped);
|
||||
}
|
||||
|
||||
-12
@@ -126,7 +126,6 @@ namespace UnitTest
|
||||
/// Base fixture for ToolsApplication editor tests.
|
||||
class ToolsApplicationFixture
|
||||
: public AllocatorsTestFixture
|
||||
, private AzToolsFramework::NewViewportInteractionModelEnabledRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
void SetUp() override final
|
||||
@@ -148,8 +147,6 @@ namespace UnitTest
|
||||
// in the unit tests.
|
||||
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
|
||||
|
||||
AzToolsFramework::NewViewportInteractionModelEnabledRequestBus::Handler::BusConnect();
|
||||
|
||||
m_editorActions.Connect();
|
||||
|
||||
const auto viewportHandlerBuilder =
|
||||
@@ -184,7 +181,6 @@ namespace UnitTest
|
||||
|
||||
TearDownEditorFixtureImpl();
|
||||
m_editorActions.Disconnect();
|
||||
AzToolsFramework::NewViewportInteractionModelEnabledRequestBus::Handler::BusDisconnect();
|
||||
|
||||
// Stop & delete the Application created by this fixture, hence not using GetApplication() here
|
||||
if (m_app)
|
||||
@@ -222,14 +218,6 @@ namespace UnitTest
|
||||
|
||||
private:
|
||||
AZStd::unique_ptr<ToolsTestApplication> m_app;
|
||||
|
||||
// NewViewportInteractionModelEnabledRequestBus ...
|
||||
bool IsNewViewportInteractionModelEnabled() override
|
||||
{
|
||||
// default to the new viewport interaction model bus being enabled so the
|
||||
// manipulator manager is correctly instantiated in EditorDefaultSelection
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class EditorEntityComponentChangeDetector
|
||||
|
||||
+11
-20
@@ -30,15 +30,9 @@ namespace AzToolsFramework
|
||||
ActionOverrideRequestBus::Handler::BusConnect(GetEntityContextId());
|
||||
ComponentModeFramework::ComponentModeSystemRequestBus::Handler::BusConnect();
|
||||
|
||||
// only create EditorTransformComponentSelection if we are using the new viewport interaction model
|
||||
// note: EditorDefaultSelection is still used when the new viewport interaction model is disabled to support
|
||||
// Component Mode when using legacy viewport interaction model
|
||||
if (IsNewViewportInteractionModelEnabled())
|
||||
{
|
||||
m_manipulatorManager =
|
||||
AZStd::make_shared<AzToolsFramework::ManipulatorManager>(AzToolsFramework::g_mainManipulatorManagerId);
|
||||
m_transformComponentSelection = AZStd::make_unique<EditorTransformComponentSelection>(entityDataCache);
|
||||
}
|
||||
m_manipulatorManager =
|
||||
AZStd::make_shared<AzToolsFramework::ManipulatorManager>(AzToolsFramework::g_mainManipulatorManagerId);
|
||||
m_transformComponentSelection = AZStd::make_unique<EditorTransformComponentSelection>(entityDataCache);
|
||||
}
|
||||
|
||||
EditorDefaultSelection::~EditorDefaultSelection()
|
||||
@@ -325,17 +319,14 @@ namespace AzToolsFramework
|
||||
m_transformComponentSelection->DisplayViewportSelection(viewportInfo, debugDisplay);
|
||||
}
|
||||
|
||||
if (IsNewViewportInteractionModelEnabled())
|
||||
{
|
||||
// poll and set the keyboard modifiers to ensure the mouse interaction is up to date
|
||||
m_currentInteraction.m_keyboardModifiers =
|
||||
AzToolsFramework::ViewportInteraction::BuildKeyboardModifiers(QGuiApplication::queryKeyboardModifiers());
|
||||
// draw the manipulators
|
||||
const AzFramework::CameraState cameraState = GetCameraState(viewportInfo.m_viewportId);
|
||||
debugDisplay.DepthTestOff();
|
||||
m_manipulatorManager->DrawManipulators(debugDisplay, cameraState, m_currentInteraction);
|
||||
debugDisplay.DepthTestOn();
|
||||
}
|
||||
// poll and set the keyboard modifiers to ensure the mouse interaction is up to date
|
||||
m_currentInteraction.m_keyboardModifiers =
|
||||
AzToolsFramework::ViewportInteraction::BuildKeyboardModifiers(QGuiApplication::queryKeyboardModifiers());
|
||||
// draw the manipulators
|
||||
const AzFramework::CameraState cameraState = GetCameraState(viewportInfo.m_viewportId);
|
||||
debugDisplay.DepthTestOff();
|
||||
m_manipulatorManager->DrawManipulators(debugDisplay, cameraState, m_currentInteraction);
|
||||
debugDisplay.DepthTestOn();
|
||||
}
|
||||
|
||||
void EditorDefaultSelection::DisplayViewportSelection2d(
|
||||
|
||||
Reference in New Issue
Block a user