From 646369c1b5b27baab176838ba0e4904d55b4ddfa Mon Sep 17 00:00:00 2001 From: rhhong Date: Tue, 5 Oct 2021 13:03:22 -0700 Subject: [PATCH] update camera naming and behavior after the merge in Signed-off-by: rhhong --- .../Tools/EMStudio/AnimViewportSettings.cpp | 4 +--- .../Tools/EMStudio/AnimViewportWidget.cpp | 19 ++++++++++++------- .../Code/Tools/EMStudio/AnimViewportWidget.h | 6 +++--- .../Source/RenderPlugin/RenderViewWidget.cpp | 4 ++-- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportSettings.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportSettings.cpp index 99bfae91fd..347e077af3 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportSettings.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportSettings.cpp @@ -66,8 +66,6 @@ namespace EMStudio::ViewportUtil AzFramework::InputChannelId BuildRotateCameraInputId() { - AzFramework::InputChannelId inputChannelId( - EMStudio::ViewportUtil::GetRegistry(CameraOrbitLookIdSetting, AZStd::string("mouse_button_left")).c_str()); - return inputChannelId; + return AzFramework::InputChannelId(GetRegistry(CameraOrbitLookIdSetting, AZStd::string("mouse_button_left")).c_str()); } } diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.cpp index 2a5006767a..d3fd719d38 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.cpp @@ -38,12 +38,17 @@ namespace EMStudio void AnimViewportWidget::SetupCameras() { - m_orbitRotateCamera = AZStd::make_shared(EMStudio::ViewportUtil::BuildRotateCameraInputId()); + m_pivotRotateCamera = AZStd::make_shared(EMStudio::ViewportUtil::BuildRotateCameraInputId()); const auto translateCameraInputChannelIds = EMStudio::ViewportUtil::BuildTranslateCameraInputChannelIds(); - m_orbitTranslateCamera = - AZStd::make_shared(AzFramework::OrbitTranslation, translateCameraInputChannelIds); - m_orbitDollyScrollCamera = AZStd::make_shared(); + m_pivotTranslateCamera = AZStd::make_shared( + translateCameraInputChannelIds, AzFramework::LookTranslation, AzFramework::TranslatePivot); + m_pivotTranslateCamera.get()->m_translateSpeedFn = [] + { + return 3.0f; + }; + + m_pivotDollyScrollCamera = AZStd::make_shared(); } void AnimViewportWidget::SetupCameraController() @@ -89,9 +94,9 @@ namespace EMStudio controller->SetCameraListBuilderCallback( [this](AzFramework::Cameras& cameras) { - cameras.AddCamera(m_orbitRotateCamera); - cameras.AddCamera(m_orbitTranslateCamera); - cameras.AddCamera(m_orbitDollyScrollCamera); + cameras.AddCamera(m_pivotRotateCamera); + cameras.AddCamera(m_pivotTranslateCamera); + cameras.AddCamera(m_pivotDollyScrollCamera); }); GetControllerList()->Add(controller); } diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.h index 64bf4cd5dd..70b4e1e667 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportWidget.h @@ -26,8 +26,8 @@ namespace EMStudio void SetupCameraController(); AZStd::unique_ptr m_renderer; - AZStd::shared_ptr m_orbitRotateCamera; - AZStd::shared_ptr m_orbitTranslateCamera; - AZStd::shared_ptr m_orbitDollyScrollCamera; + AZStd::shared_ptr m_pivotRotateCamera; + AZStd::shared_ptr m_pivotTranslateCamera; + AZStd::shared_ptr m_pivotDollyScrollCamera; }; } diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp index 93a6dd3019..fe8fb61f02 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderViewWidget.cpp @@ -155,12 +155,12 @@ namespace EMStudio cameraMenu->addAction("Reset Camera", [this]() { this->OnResetCamera(); }); QAction* showSelectedAction = cameraMenu->addAction("Show Selected", this, &RenderViewWidget::OnShowSelected); - showSelectedAction->setShortcut(Qt::Key_S); + showSelectedAction->setShortcut(QKeySequence(Qt::Key_S + Qt::SHIFT)); GetMainWindow()->GetShortcutManager()->RegisterKeyboardShortcut(showSelectedAction, RenderPlugin::s_renderWindowShortcutGroupName, true); addAction(showSelectedAction); QAction* showEntireSceneAction = cameraMenu->addAction("Show Entire Scene", this, &RenderViewWidget::OnShowEntireScene); - showEntireSceneAction->setShortcut(Qt::Key_A); + showEntireSceneAction->setShortcut(QKeySequence(Qt::Key_A + Qt::SHIFT)); GetMainWindow()->GetShortcutManager()->RegisterKeyboardShortcut(showEntireSceneAction, RenderPlugin::s_renderWindowShortcutGroupName, true); addAction(showEntireSceneAction);