Inconsistent camera panning between editor viewport camera and piloting a cine camera in Sequencer

Hello,

We’ve observed some inconsistent behavior regarding camera panning in the editor viewport and when piloting a cinema camera in Sequencer. Looks like the `ViewRotation` in `FEditorViewportClient::ConvertMovementToDragRot` is different when piloting a camera and thus it’s panning incorrectly.

Steps to Reproduce

  1. Open level
  2. Alt + Middle Mouse, drag and observe correct panning behavior.
  3. Open a Level Sequence
  4. Add a camera cut track
  5. Pilot camera
  6. Alt + Middle Mouse, drag and observe incorrect panning behavior.

Hi Klaudius,

Thank you for reporting this issue. I believe I was able to repro the incorrect behavior you described, and I am now investigating the source code to gather some more information about possible causes. Meanwhile, I’d like to check some things with you to make sure we’re seeing the same thing:

1) Does the odd behavior also happen while piloting any actor in the viewport, regardless of having an open Sequencer? For example, if you place a cube on the level, then right-click it and select “Pilot Cube” in the context menu, do you also observe the same odd behavior when doing Alt+MMB+drag?

2) Is the behavior normal if you simply use MMB+drag without holding the Alt key? If so, is this a viable workaround for you?

3) Do you recall performing the same “steps to reproduce” in any previous engine version where it did work correctly as expected? I ask because I was able to observe the exact same odd behavior on all engine versions from 4.27 to 5.6 and source.

Best regards,

Vitor

Hey Vitor!

I tried piloting a basic cube without Sequencer open and sure enough the exact same behavior is there. The behavior for MMB+drag without holding Alt is behaving correctly, but it’s not the same so it’s not 100% viable as a alternative. The artists who reported this issue say it was an issue in UE4.27 as well.

Hi Klaudius,

I think I figured out what’s going on, but unfortunately it looks quite intricate and I won’t be able to offer a quick fix at this time. I will now create an internal bug report for the engine devs responsible for this system and include all my findings, but we cannot provide a timeline for an official fix. Meanwhile, one other possible workaround would be to not pilot the actor or cinecamera, but instead:

  • Right-click the desired actor or cinecamera and select “Move Camera to Object”
  • Move the regular viewport camera as desired
  • Right-click the desired actor or cinecamera and select “Move Object to Camera”

I’ll get back to you soon with some more information about this issue and with a tracking number for the bug report, and also if I can come up with a quick fix on the source code. Do you think you can use the workarounds presented so far while an official fix isn’t available?

Best regards,

Vitor

Hi Vitor,

We’ll wait for the official fix. Let me know how I can track it so I can pull it in from the depot.

Klaudius

Hi Klaudius,

I had another go at this before handing it to the engine devs, and I might have found a temporary workaround. Can your please try this and tell me how it goes?

On file [EditorViewportClient.cpp], function FEditorViewportClient::InputAxisForOrbit(), look at the top-level “else” block. At the beginning, you will find these lines:

// Ensure orbit is enabled
const bool bEnable=true;
ToggleOrbitCamera(bEnable);

Please wrap this ToggleOrbitCamera() function call with some code to save and restore the view location when in “orbit pan” mode:

FVector TempLoc = GetViewLocation();
 
// Ensure orbit is enabled
const bool bEnable=true;
ToggleOrbitCamera(bEnable);
 
if (IsOrbitPanMode(InViewport))
	SetViewLocation(TempLoc);

In my tests here, this seems to solve the issue, even though I’m not yet entirely sure about why this is needed (the engine devs will probably look into it more thoroughly).

I arrived at this workaround by comparing the behavior of this function over multiple frames while piloting and not piloting an actor in the viewport. When not piloting, ToggleOrbitCamera() only adjusts the view location once at the beginning of the interaction, then never again, and I could see that in this first frame of orbiting the result was slightly off because of it. In contrast, when piloting, function FLevelEditorViewportClient::MoveLockedActorToCamera() requires disabling orbit mode after every frame of movement, so ToggleOrbitCamera() also keeps doing the view location adjustment every frame. The “slightly off” result of each frame compounds over multiple frames.

Please let me know if the workaround above works for you. I’ll get back to you again with the bug tracking number!

All the best,

Vitor

Tried it out, and it looks good to me. Thank you!

Hi Klaudius:

Here’s the bug tracking number: UE-354248. The link should become accessible once the engine devs mark it as public.

Cheers,

Vitor