Description

Focus mode in the Editor does not handle Actors without PrimitiveComponent correctly, treating them as if they were at the origin (0,0,0), skewing the camera placement.
Some Actors like the WorldDataLayer (Default actor in every OpenWorld Template map) are treated as if they were an actor at the origin (0,0,0). If they are selected in the Editor and the F key (to Focus) is used, the camera will focus in the origin, what by itself is not a huge problem, but becomes annoying once you select more than one element in the scene besides these types that don't possess a bounding box, and the camera will position itself to always include de origin.
The licensee found a simple fix to this issue - instead of return true; in FActorElementEditorViewportInteractionCustomization::GetFocusBounds(), we should return if the BoundingBox IsValid.
Sample code:
bool FActorElementEditorViewPortInteractionCustomization::GetFocusBounds(...)

{ ... // return true; return !!BoundingBox.IsValid; }

This simple change fix the focusing in the origin issue.

Steps to Reproduce
  • Make a new map using the OpenWorld Template
  • Add a Cube, not at the origin
  • Select the Cube and the WorldDataLayers Actor
  • Press "F"
    Observed: The camera moves to focus the cube and the origin
    Expected: The camera moves to focus the cube
Callstack

> UnrealEditor-UnrealEd.dll!FActorElementEditorViewportInteractionCustomization::GetFocusBounds(const TTypedElement<ITypedElementWorldInterface> & InElementWorldHandle, UE::Math::TBoxSphereBounds<double,double> & OutBounds) Line 307 C++
[Inline Frame] UnrealEditor-EditorFramework.dll!FTypedElementViewportInteractionElement::GetFocusBounds(UE::Math::TBoxSphereBounds<double,double> &) Line 90 C++
UnrealEditor-EditorFramework.dll!??R<lambda_1>@?1??GetFocusBounds@UTypedElementViewportInteraction@@QEAA_NV?$TSharedRef@$$CBV?$TTypedElementList@UFTypedElementHandle@@@@$00@@AEAU?$TBoxSphereBounds@NN@Math@UE@@@Z@QEBA@AEBUFTypedElementHandle@@@Z(const FTypedElementHandle & InElementToMove) Line 266 C++
[Inline Frame] UnrealEditor-TypedElementFramework.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::FFunctionRefStoragePolicy,bool __cdecl(FTypedElementHandle const &)>::operator()(const FTypedElementHandle &) Line 555 C++
UnrealEditor-TypedElementFramework.dll!TTypedElementList<FTypedElementHandle>::ForEachElementHandle(TFunctionRef<bool __cdecl(FTypedElementHandle const &)> InCallback, const TSubclassOf<UInterface> & InBaseInterfaceType) Line 283 C++
UnrealEditor-EditorFramework.dll!UTypedElementViewportInteraction::GetFocusBounds(TSharedRef<TTypedElementList<FTypedElementHandle> const ,1> InElements, UE::Math::TBoxSphereBounds<double,double> & OutBounds) Line 275 C++
UnrealEditor-UnrealEd.dll!FLevelEditorViewportClient::GetFocusBounds(TSharedRef<TTypedElementList<FTypedElementHandle> const ,1> InElements, UE::Math::TBoxSphereBounds<double,double> & OutBounds) Line 4566 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::MoveViewportCamerasToElement(const UTypedElementSelectionSet * SelectionSet, bool bActiveViewportOnly) Line 4873 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Exec_Camera(const wchar_t * Str, FOutputDevice & Ar) Line 5225 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Exec_Editor(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 5691 C++
UnrealEditor-Core.dll!FExec::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 18 C++
UnrealEditor-Engine.dll!UEngine::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 4759 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 662 C++
UnrealEditor-LevelEditor.dll!FLevelEditorActionCallbacks::ExecuteExecCommand(FString Command) Line 2033 C++
[Inline Frame] UnrealEditor-LevelEditor.dll!Invoke(void[Image Removed](FString) &) Line 47 C++
UnrealEditor-LevelEditor.dll!??$ApplyAfter@AEBQ6AXVFString@@@Z$$V@?$TTupleBase@U?$TIntegerSequence@I$0A@@@VFString@@@Tuple@Private@Core@UE@@QEGBA?A_TAEBQ6AXVFString@@@Z@Z(void[Image Removed](FString) & Func) Line 309 C++
UnrealEditor-LevelEditor.dll!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy,FString>::ExecuteIfSafe() Line 777 C++
[Inline Frame] UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound() Line 570 C++
UnrealEditor-Slate.dll!FUIAction::Execute() Line 139 C++
UnrealEditor-Slate.dll!FUICommandList::ConditionalProcessCommandBindings(const FKey Key, bool bCtrl, bool bAlt, bool bShift, bool bCmd, bool bRepeat) Line 235 C++
UnrealEditor-Slate.dll!FUICommandList::ProcessCommandBindings(const FKeyEvent & InKeyEvent) Line 179 C++
UnrealEditor-LevelEditor.dll!SLevelEditor::OnKeyDown(const FGeometry & MyGeometry, const FKeyEvent & InKeyEvent) Line 1826 C++
[Inline Frame] UnrealEditor-Slate.dll!FSlateApplication::ProcessKeyDownEvent::__l22::<lambda_2>::operator()(const FArrangedWidget &) Line 4789 C++
UnrealEditor-Slate.dll!??$Route@VFReply@@VFBubblePolicy@FEventRouter@@UFKeyEvent@@V<lambda_2>@?BG@??ProcessKeyDownEvent@FSlateApplication@@QEAA_NAEBU4@@Z@@FEventRouter@@SA?AVFReply@@PEAVFSlateApplication@@VFBubblePolicy@0@UFKeyEvent@@AEBV<lambda_2>@?BG@??ProcessKeyDownEvent@2@QEAA_NAEBU4@@Z@W4ESlateDebuggingInputEvent@@@Z(FSlateApplication * ThisApplication, FEventRouter::FBubblePolicy RoutingPolicy, FKeyEvent EventCopy, const FSlateApplication::ProcessKeyDownEvent::__l22::<lambda_2> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 447 C++
[Inline Frame] UnrealEditor-Slate.dll!FEventRouter::RouteAlongFocusPath(FSlateApplication *) Line 416 C++
UnrealEditor-Slate.dll!FSlateApplication::ProcessKeyDownEvent(const FKeyEvent & InKeyEvent) Line 4785 C++
UnrealEditor-Slate.dll!FSlateApplication::OnKeyDown(const int KeyCode, const unsigned int CharacterCode, const bool IsRepeat) Line 4696 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2078 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2750 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1919 C++
[Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 923 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 929 C++
[External Code]
[Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 116 C++
UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 145 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5850 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 180 C++
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247 C++
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
[External Code]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-230706 in the post.

0
Login to Vote

Unresolved
ComponentUE - World Creation - Worldbuilding Tools
Affects Versions5.65.55.4.4
Target Fix5.6
CreatedNov 18, 2024
UpdatedNov 18, 2024
View Jira Issue