[Backout] - CL29484848

[FYI] benoit.gadreau
Original CL Desc
-----------------------------------------------------------------
New TRS Gizmo: CTRL + MMB does indirect manipulation on the Y axiz (CTRL+LMB does Z instead of CTRL+RMB+LMB)

#rb brooke.hubert
#rnx

[CL 29499083 by bob tellez in ue5-main branch]
This commit is contained in:
bob tellez
2023-11-06 15:56:38 -05:00
parent 18b5da1455
commit 2030016c50
2 changed files with 6 additions and 26 deletions

View File

@@ -107,14 +107,8 @@ void UTransformGizmo::SetupIndirectBehaviors()
bIndirectManipulation = false;
return OnTerminateDragSequence();
};
if (bCtrlMiddleDoesY)
{
// disable ctrl + mmb for that behavior
MiddleClickDragBehavior->ModifierCheckFunc = [](const FInputDeviceState& InputState)
{
return !FInputDeviceState::IsCtrlKeyDown(InputState);
};
}
// add this to enable indirect manipulation using CTRL + MMB
// MiddleClickDragBehavior->ModifierCheckFunc = FInputDeviceState::IsCtrlKeyDown;
AddInputBehavior(MiddleClickDragBehavior);
@@ -122,10 +116,6 @@ void UTransformGizmo::SetupIndirectBehaviors()
UMultiButtonClickDragBehavior* LeftRightClickDragBehavior = NewObject<UMultiButtonClickDragBehavior>();
LeftRightClickDragBehavior->Initialize();
LeftRightClickDragBehavior->EnableButton(EKeys::LeftMouseButton);
if (bCtrlMiddleDoesY)
{
LeftRightClickDragBehavior->EnableButton(EKeys::MiddleMouseButton);
}
LeftRightClickDragBehavior->EnableButton(EKeys::RightMouseButton);
LeftRightClickDragBehavior->ModifierCheckFunc = FInputDeviceState::IsCtrlKeyDown;
LeftRightClickDragBehavior->CanBeginClickDragFunc = [this](const FInputDeviceRay&)
@@ -159,15 +149,9 @@ void UTransformGizmo::SetupIndirectBehaviors()
return OnTerminateDragSequence();
};
auto GetAxis = [this](const FInputDeviceState& InInput)
auto GetAxis = [](const FInputDeviceState& InInput)
{
const bool bAddX = InInput.Mouse.Left.bDown;
if (bCtrlMiddleDoesY)
{
const bool bAddY = InInput.Mouse.Middle.bDown;
const bool bAddZ = InInput.Mouse.Right.bDown;
return bAddX ? EAxis::X : bAddY ? EAxis::Y : bAddZ ? EAxis::Z : EAxis::None;
}
const bool bAddY = InInput.Mouse.Right.bDown;
return bAddX && bAddY ? EAxis::Z : bAddX ? EAxis::X : bAddY ? EAxis::Y : EAxis::None;
};
@@ -371,7 +355,7 @@ void UTransformGizmo::OnEndHover()
FInputRayHit UTransformGizmo::UpdateHoveredPart(const FInputDeviceRay& PressPos)
{
if (!HitTarget || !bVisible)
if (!HitTarget)
{
return FInputRayHit();
}
@@ -717,7 +701,7 @@ void UTransformGizmo::EnableRotate(EAxisList::Type InAxisListToDraw)
if (RotateOuterCircleElement == nullptr)
{
RotateOuterCircleElement = MakeRotateCircleHandle(ETransformGizmoPartIdentifier::RotateAll, RotateOuterCircleRadius, RotateOuterCircleColor, false);
RotateOuterCircleElement = MakeRotateCircleHandle(ETransformGizmoPartIdentifier::Default, RotateOuterCircleRadius, RotateOuterCircleColor, false);
RotateOuterCircleElement->SetHittableState(false);
GizmoElementRoot->Add(RotateOuterCircleElement);
}
@@ -1039,7 +1023,7 @@ UGizmoElementRectangle* UTransformGizmo::MakeTranslateScreenSpaceHandle()
RectangleElement->SetViewAlignAxis(FVector::UpVector);
RectangleElement->SetViewAlignNormal(-FVector::ForwardVector);
RectangleElement->SetMaterial(TransparentVertexColorMaterial);
RectangleElement->SetVertexColor(WhiteColor, true);
RectangleElement->SetLineColor(ScreenSpaceColor);
RectangleElement->SetHitMesh(true);
RectangleElement->SetDrawMesh(false);
RectangleElement->SetDrawLine(true);

View File

@@ -834,8 +834,4 @@ protected:
/** Pending drag function to be called if bDeferDrag is true */
TFunction<void()> PendingDragFunction;
/** Use Ctrl + MMB to do indirect manipulation on the Y axis */
UPROPERTY()
bool bCtrlMiddleDoesY = true;
};