bUseLinkedOrthographicViewports

bUseLinkedOrthographicViewports

#Overview

name: bUseLinkedOrthographicViewports

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bUseLinkedOrthographicViewports is to control the synchronization of orthographic viewport movement in the Unreal Engine editor. Specifically, it determines whether all orthographic viewports should be linked to the same position and move together.

This setting variable is primarily used by the Level Editor subsystem of Unreal Engine. It’s part of the LevelEditorViewportSettings class, which manages various configuration options for the editor viewports.

The value of this variable is set in the project settings, specifically in the “Look and Feel” category of the Level Editor Viewport Settings. It’s exposed as an editable property with the display name “Link Orthographic Viewport Movement”.

This variable interacts with other viewport-related variables and functions, particularly those dealing with orthographic views and viewport updates. It’s often used in conjunction with checks for whether a viewport is orthographic (IsOrtho()) and whether it’s the current editing viewport.

Developers should be aware that when this setting is enabled, moving one orthographic viewport will cause all other orthographic viewports to move as well. This can be useful for maintaining consistent views across different orthographic angles, but it may also lead to unexpected behavior if not properly understood.

Best practices when using this variable include:

  1. Use it when you want to maintain consistent positioning across all orthographic views.
  2. Be aware of its impact on viewport behavior, especially when implementing custom editor tools or viewport interactions.
  3. Consider providing a way for users to toggle this setting easily if they frequently switch between linked and unlinked viewport behavior.
  4. When implementing new features that involve orthographic viewport movement, check this setting to ensure proper behavior in both linked and unlinked modes.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:440, section: [/Script/UnrealEd.LevelEditorViewportSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorViewportSettings.h:509

Scope (from outer to inner):

file
class        class ULevelEditorViewportSettings : public UObject

Source code excerpt:

	/** If checked all orthographic view ports are linked to the same position and move together. */
	UPROPERTY(EditAnywhere, config, Category=LookAndFeel, meta=(DisplayName = "Link Orthographic Viewport Movement"))
	uint32 bUseLinkedOrthographicViewports:1;

	/** True if viewport box selection requires objects to be fully encompassed by the selection box to be selected */
	UPROPERTY(config)
	uint32 bStrictBoxSelection:1;

	/** True if viewport box selection also selects occluded objects, false if only objects with visible pixels are selected */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:2208

Scope (from outer to inner):

file
function     void UEditorEngine::Tick

Source code excerpt:

				{
					// Only update ortho viewports if that mode is turned on, the viewport client we are about to update is orthographic and the current editing viewport is orthographic and tracking mouse movement.
					bUpdateLinkedOrthoViewports = GetDefault<ULevelEditorViewportSettings>()->bUseLinkedOrthographicViewports && ViewportClient->IsOrtho() && GCurrentLevelEditingViewportClient && GCurrentLevelEditingViewportClient->IsOrtho() && GCurrentLevelEditingViewportClient->IsTracking();

					if (bRenderingChildren || bUpdateLinkedOrthoViewports)
					{
						//if we haven't drawn a non-realtime viewport OR not one of the main viewports
						bool bAllowNonRealtimeViewports = (!bEditorFrameNonRealtimeViewportDrawn) || !(ViewportClient->IsLevelEditorClient());
						ViewportClient->SetIsCurrentLevelEditingFocus(true);

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorServer.cpp:4903

Scope (from outer to inner):

file
function     void UEditorEngine::MoveViewportCamerasToBox

Source code excerpt:


				// Update Linked Orthographic viewports.
				if (GCurrentLevelEditingViewportClient->IsOrtho() && GetDefault<ULevelEditorViewportSettings>()->bUseLinkedOrthographicViewports)
				{
					// Search through all viewports
					for (FLevelEditorViewportClient* LinkedViewportClient : GetLevelViewportClients())
					{
						// Only update other orthographic viewports
						if (LinkedViewportClient && LinkedViewportClient != GCurrentLevelEditingViewportClient && LinkedViewportClient->IsOrtho())

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/LevelEditorViewport.cpp:5373

Scope (from outer to inner):

file
function     void FLevelEditorViewportClient::UpdateLinkedOrthoViewports

Source code excerpt:

{
	// Only update if linked ortho movement is on, this viewport is orthographic, and is the current viewport being used.
	if (GetDefault<ULevelEditorViewportSettings>()->bUseLinkedOrthographicViewports && IsOrtho() && GCurrentLevelEditingViewportClient == this)
	{
		int32 MaxFrames = -1;
		int32 NextViewportIndexToDraw = INDEX_NONE;

		// Search through all viewports for orthographic ones
		for( int32 ViewportIndex = 0; ViewportIndex < GEditor->GetLevelViewportClients().Num(); ++ViewportIndex )