bLevelStreamingVolumePrevis

bLevelStreamingVolumePrevis

#Overview

name: bLevelStreamingVolumePrevis

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 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bLevelStreamingVolumePrevis is to enable or disable the preview of level streaming volumes in the Unreal Engine editor viewport. This setting is primarily used for the level streaming system, which is part of the engine’s world composition and level management functionality.

This setting variable is mainly relied upon by the Level Editor subsystem of Unreal Engine. It’s specifically used in the viewport-related modules and the editor engine.

The value of this variable is set in the ULevelEditorViewportSettings class, which is part of the editor’s configuration settings. It can be toggled through the level editor actions, as seen in the LevelEditorActions.cpp file.

This variable interacts with other viewport-related variables and functions, particularly those involved in rendering the viewport and handling camera movement.

Developers must be aware that enabling this setting may impact editor performance, especially in large or complex levels with many streaming volumes. It’s a tool primarily for visualization and debugging of level streaming setups.

Best practices when using this variable include:

  1. Only enable it when actively working on level streaming setups to avoid unnecessary performance overhead.
  2. Use it in conjunction with other level streaming tools and visualizations for a comprehensive understanding of the streaming behavior.
  3. Remember to disable it when not needed, especially before building or packaging the game.
  4. Be cautious when using it in multiplayer editor sessions, as it may affect performance for all connected clients.

This setting is particularly useful during level design and optimization phases, allowing designers and developers to visually confirm the boundaries and behavior of level streaming volumes in real-time within the editor viewport.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp:2848

Scope (from outer to inner):

file
function     void FLevelEditorActionCallbacks::OnToggleLevelStreamingVolumePrevis

Source code excerpt:

	ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();

	ViewportSettings->bLevelStreamingVolumePrevis = !ViewportSettings->bLevelStreamingVolumePrevis;
	ViewportSettings->PostEditChange();
}

bool FLevelEditorActionCallbacks::OnIsLevelStreamingVolumePrevisEnabled()
{
	return GetDefault<ULevelEditorViewportSettings>()->bLevelStreamingVolumePrevis;
}

FText FLevelEditorActionCallbacks::GetAudioVolumeToolTip()
{
	if ( !GEditor->IsRealTimeAudioMuted() )
	{

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

Scope (from outer to inner):

file
class        class ULevelEditorViewportSettings : public UObject

Source code excerpt:

	/** If enabled, the viewport will stream in levels automatically when the camera is moved. */
	UPROPERTY(EditAnywhere, config, Category=Controls, meta=(DisplayName = "Stream in Levels Automatically when Camera is Moved"), AdvancedDisplay)
	bool bLevelStreamingVolumePrevis;

	/** When checked, orbit the camera by using the L or U keys when unchecked, Alt and Left Mouse Drag will orbit around the look at point */
	UPROPERTY(EditAnywhere, config, Category=Controls, meta=(DisplayName="Use UE3 Orbit Controls"), AdvancedDisplay)
	bool bUseUE3OrbitControls;

	/** Direction of the scroll gesture for 3D viewports */

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

Scope (from outer to inner):

file
function     void UEditorEngine::Tick

Source code excerpt:

		{
			// Previs level streaming volumes in the Editor.
			if ( ViewportClient->IsPerspective() && GetDefault<ULevelEditorViewportSettings>()->bLevelStreamingVolumePrevis )
			{
				const FVector& ViewLocation = ViewportClient->GetViewLocation();

				// Iterate over streaming levels and compute whether the ViewLocation is in their associated volumes.
				TMap<ALevelStreamingVolume*, bool> VolumeMap;

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

Scope (from outer to inner):

file
function     void FLevelEditorViewportClient::Tick

Source code excerpt:


	// Copy perspective views to the global if this viewport has streaming volume previs enabled
	if ( (IsPerspective() && GetDefault<ULevelEditorViewportSettings>()->bLevelStreamingVolumePrevis && Viewport->GetSizeXY().X > 0) )
	{
		GPerspFrustumAngle=ViewFOV;
		GPerspFrustumAspectRatio=AspectRatio;
		GPerspFrustumStartDist=GetNearClipPlane();

		GPerspFrustumEndDist= UE_FLOAT_HUGE_DISTANCE;

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

Scope (from outer to inner):

file
function     void FLevelEditorViewportClient::Draw

Source code excerpt:

		for (FLevelEditorViewportClient* CurViewportClient : GEditor->GetLevelViewportClients())
		{
			if ( CurViewportClient && IsPerspective() && GetDefault<ULevelEditorViewportSettings>()->bLevelStreamingVolumePrevis )
			{
				// Draw the view frustum of the level streaming volume previs viewport.
				RenderViewFrustum(PDI, FLinearColor(1.0, 0.0, 1.0, 1.0),
					GPerspFrustumAngle,
					GPerspFrustumAspectRatio,
					GPerspFrustumStartDist,

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:939

Scope (from outer to inner):

file
function     ULevelEditorViewportSettings::ULevelEditorViewportSettings

Source code excerpt:

{
	MinimumOrthographicZoom = 250.0f;
	bLevelStreamingVolumePrevis = false;
	BillboardScale = 1.0f;
	TransformWidgetSizeAdjustment = 0.0f;
	MeasuringToolUnits = MeasureUnits_Centimeters;
	bAllowArcballRotate = false;
	bAllowScreenRotate = false;
	bShowActorEditorContext = true;