bAllowResizing

bAllowResizing

#Overview

name: bAllowResizing

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 12 C++ source files. Also referenced in 1 C# build file meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of bAllowResizing is to control whether a particular element or window in Unreal Engine 5 can be resized by the user or dynamically during runtime. This setting is used across different subsystems and plugins within the engine, primarily in the context of user interfaces and particle simulations.

Based on the callsites provided, this variable is utilized in the following Unreal Engine subsystems, plugins, and modules:

  1. EditorScriptingUtilities plugin
  2. HarmonixDspEditor plugin
  3. AndroidRuntimeSettings
  4. Particle system (specifically GPU-based particle simulations)

The value of this variable is set in different contexts:

  1. In dialog creation within the EditorScriptingUtilities plugin
  2. As a property in the AndroidRuntimeSettings class
  3. During initialization of the FParticleTileAllocator class

This variable interacts with other variables and systems, such as:

  1. Window sizing rules and minimum dimensions in dialog creation
  2. Particle simulation texture sizes and tile allocation in GPU-based particle systems

Developers must be aware of the following when using this variable:

  1. Setting bAllowResizing to true may impact performance, especially in particle simulations where it allows dynamic resizing of tile allocations.
  2. In UI contexts, it affects the user’s ability to resize windows or dialogs.
  3. For Android, it relates to supporting splitscreen and foldable device features.

Best practices when using this variable include:

  1. Consider performance implications when allowing resizing, especially in performance-critical systems like particle simulations.
  2. Ensure that minimum sizes are set appropriately when allowing resizing in UI contexts to maintain usability.
  3. Test thoroughly on target platforms, especially when enabling resizing for Android devices with different form factors.
  4. Use in conjunction with other related settings (e.g., minimum dimensions, maximum tile counts) to ensure proper behavior and prevent issues.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3101, section: [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Editor/EditorScriptingUtilities/Source/EditorScriptingUtilities/Private/EditorDialogLibrary.cpp:171

Scope: file

Source code excerpt:

			TSharedRef<SWindow> Window = SNew(SWindow)
				.Title(Title)
				.SizingRule(Options.bAllowResizing ? ESizingRule::UserSized : ESizingRule::Autosized)
				.MinWidth(MinSize.X)
				.MinHeight(MinSize.Y)
				.ClientSize(Options.bAllowResizing ? MinSize : FVector2D())
				.AutoCenter(EAutoCenter::PrimaryWorkArea)
				.SupportsMinimize(false)
				.SupportsMaximize(false);
				
			TSharedPtr<SObjParamDialog> Dialog;
			Window->SetContent(SAssignNew(Dialog, SObjParamDialog, Window, ViewObjects, Options));

#Loc: <Workspace>/Engine/Plugins/Editor/EditorScriptingUtilities/Source/EditorScriptingUtilities/Public/EditorDialogLibrary.h:18

Scope: file

Source code excerpt:

	
	UPROPERTY(BlueprintReadWrite, Category = "Editor Scripting | Object Dialog")
	bool bAllowResizing = false;

	/** The minimum dialog width. If zero, default to the medium window width defined by the Editor style. */
	UPROPERTY(BlueprintReadWrite, Category = "Editor Scripting | Object Dialog")
	int32 MinWidth = 0;

	/** The minimum dialog height. If zero, default to the medium window height defined by the Editor style. */

#Loc: <Workspace>/Engine/Plugins/Runtime/Harmonix/Source/HarmonixDspEditor/Private/FusionPatchImportOptions.cpp:61

Scope (from outer to inner):

file
function     const UFusionPatchCreateOptions* UFusionPatchCreateOptions::GetWithDialog

Source code excerpt:

	const FText ImportDialogTitle = NSLOCTEXT("FusionPatchCreateOptions", "FusionPatchCreateOptionsTitle", "New Fusion Patch Options");
	FEditorDialogLibraryObjectDetailsViewOptions DialogOptions;
	DialogOptions.bAllowResizing = true;
	OutWasOkayPressed = UEditorDialogLibrary::ShowObjectDetailsView(ImportDialogTitle, Options, DialogOptions);
	Options->StagedSoundWaves.Empty();

	// apply some default settings that will work out of the box
	Options->FusionPatchSettings.Adsr[0].IsEnabled = true;
	Options->FusionPatchSettings.Adsr[0].SustainLevel = 1.0f;

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Classes/AndroidRuntimeSettings.h:289

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	// Allow resizing of the window on Android devices with splitscreen
	UPROPERTY(GlobalConfig, EditAnywhere, Category = "APK Packaging", Meta = (DisplayName = "Allow splitscreen resizing?"))
	bool bAllowResizing;

	// Allow support for size change when foldable and flip devices change screen or layout on Android 10+
	UPROPERTY(GlobalConfig, EditAnywhere, Category = "APK Packaging", Meta = (DisplayName = "Allow fold/flip size changes?"))
	bool bSupportSizeChanges;

	// Should we restore scheduled local notifications on reboot? This will add a receiver for boot complete and a permission to the manifest.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:143

Scope (from outer to inner):

file
class        class FParticleTileAllocator
function     FParticleTileAllocator

Source code excerpt:

	{
		InitialTileCount = 0;
		bAllowResizing = false;
	}

	/**
	 * Init the tile allocator
	 *
	 */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:153

Scope (from outer to inner):

file
class        class FParticleTileAllocator
function     void Init

Source code excerpt:

	{
		/** Check if the tile can be resized at runtime. */
		bAllowResizing = bAllowTileResizing;
		InitialTileCount = TileCount;
		MaxTileCount = InMaxTileCount;

		FreeTiles.AddUninitialized(InitialTileCount);

		for (uint32 TileIndex = 0; TileIndex < InitialTileCount; ++TileIndex)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:180

Scope (from outer to inner):

file
class        class FParticleTileAllocator
function     bool Resize

Source code excerpt:

	bool Resize()
	{
		check(bAllowResizing);

		static uint32 MaxMortonIndex = 65535;// (2 ^ 16) -1
		uint32 OldTileCount = InitialTileCount * FMath::Pow(4, (float)ResizeTileAllocCount);
		uint32 ResizedTileCount = OldTileCount * 4;

		// 1-check to make sure we dont bust the maximum tile allocation allowed (see GParticleSimulationTextureSizeX, GParticleSimulationTextureSizeY).

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:217

Scope (from outer to inner):

file
class        class FParticleTileAllocator
function     uint32 Allocate

Source code excerpt:

		}

		if (bAllowResizing && Resize())
		{
			return FreeTiles.Pop();
		}

		return INDEX_NONE;
	}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:269

Scope (from outer to inner):

file
class        class FParticleTileAllocator
function     bool SupportResizingTiles

Source code excerpt:

	bool SupportResizingTiles() const
	{
		return bAllowResizing;
	}

	/* Tile allocator have resized. Need to update the GPU resources*/
	bool bDirtyAlloc;

private:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:281

Scope (from outer to inner):

file
class        class FParticleTileAllocator

Source code excerpt:


	/** Support dynamic resizing of tiles*/
	bool bAllowResizing;

	/** Number of time the TileAllocator resized*/
	uint32 ResizeTileAllocCount;

	/** Tile information*/
	uint32 InitialTileCount;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:2140

Scope (from outer to inner):

file
function     static void BuildParticleVertexBuffer

Source code excerpt:

	FParticleIndex* RESTRICT ParticleIndices = (FParticleIndex*)RHICmdList.LockBuffer( VertexBufferRHI, 0, BufferSize, RLM_WriteOnly );

	bool bAllowResizing = ParticleSimulationResources->SupportTileResizing();
	
	float TileCountX = (float)ParticleSimulationResources->ParticleSimulationTileCountX;
	float TileCountY = (float)ParticleSimulationResources->ParticleSimulationTileCountY;
	float TextureSizeX = bAllowResizing ? GParticleSimulationDynTextureSizeXY: GParticleSimulationTextureSizeX;
	float TextureSizeY = bAllowResizing ? GParticleSimulationDynTextureSizeXY : GParticleSimulationTextureSizeY;

	for ( int32 Index = 0; Index < TileCount; ++Index )
	{
		// Take the mod of the tile index with the tile count of the first allocation. In case the gpu resources are resized, the 
		// tile coordinate will be ajusted by the TilePageIndex.
		const uint32 TileIndex = InTiles[Index] % ParticleSimulationResources->ParticleSimulationTileCount;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleGpuSimulation.cpp:4053

Scope (from outer to inner):

file
class        class FGPUSpriteParticleEmitterInstance : public FParticleEmitterInstance
function     int32 AllocateTilesForParticles

Source code excerpt:

		}

		bool bAllowResizing = ParticleSimulationResources->SupportTileResizing();
		float TileCountX = ParticleSimulationResources->ParticleSimulationTileCountX;
		float TileCountY = ParticleSimulationResources->ParticleSimulationTileCountY;
		float TextureSizeX = bAllowResizing ? GParticleSimulationDynTextureSizeXY : GParticleSimulationTextureSizeX;
		float TextureSizeY = bAllowResizing ? GParticleSimulationDynTextureSizeXY : GParticleSimulationTextureSizeY;

		// Need to allocate space in tiles for all new particles.
		FParticleSimulationResources* SimulationResources = FXSystem->GetParticleSimulationResources();
		uint32 TileIndex = (AllocatedTiles.IsValidIndex(TileToAllocateFrom)) ? AllocatedTiles[TileToAllocateFrom] % ParticleSimulationResources->ParticleSimulationTileCount : INDEX_NONE;
		FVector2D TileOffset(
			FMath::Fractional((float)TileIndex / TileCountX),

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs:2625

			Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bUseDisplayCutout", out bUseDisplayCutout);
			bool bAllowResizing;
			Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bAllowResizing", out bAllowResizing);
			bool bSupportSizeChanges;
			Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bSupportSizeChanges", out bSupportSizeChanges);
			bool bRestoreNotificationsOnReboot = false;
			Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bRestoreNotificationsOnReboot", out bRestoreNotificationsOnReboot);
			List<string>? ExtraManifestNodeTags;
			Ini.GetArray("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "ExtraManifestNodeTags", out ExtraManifestNodeTags);