bTransparentBoxSelection
bTransparentBoxSelection
#Overview
name: bTransparentBoxSelection
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 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bTransparentBoxSelection is to control the behavior of box selection in the Unreal Engine 5 Level Editor viewport. Specifically, it determines whether the box selection tool should select only visible objects or include occluded objects as well.
This setting variable is primarily used in the Level Editor module, particularly in the viewport and selection systems. It is referenced in the LevelEditorActions and DragTool_FrustumSelect components.
The value of this variable is set in the ULevelEditorViewportSettings class, which is a configuration class for Level Editor viewport settings. It can be toggled through the Level Editor UI, as evidenced by the OnToggleTransparentBoxSelect function in LevelEditorActions.cpp.
This variable interacts with the selection system, particularly during frustum selection operations. When enabled, it allows the selection of objects that may be hidden behind other objects in the viewport.
Developers should be aware that enabling this option may result in unexpected selections, as objects that are not visible in the viewport can be selected. This could lead to unintended modifications of occluded objects.
Best practices when using this variable include:
- Use it judiciously, as it can affect performance in scenes with many objects.
- Be cautious when modifying selected objects, as some may not be visible in the viewport.
- Consider providing clear visual feedback to users when this option is enabled, to avoid confusion.
- Use in combination with other selection tools and filters for more precise control over object selection in complex scenes.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:444, section: [/Script/UnrealEd.LevelEditorViewportSettings]
- INI Section:
/Script/UnrealEd.LevelEditorViewportSettings
- Raw value:
False
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp:2747
Scope (from outer to inner):
file
function void FLevelEditorActionCallbacks::OnToggleTransparentBoxSelect
Source code excerpt:
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->bTransparentBoxSelection = !ViewportSettings->bTransparentBoxSelection;
ViewportSettings->PostEditChange();
}
bool FLevelEditorActionCallbacks::OnIsTransparentBoxSelectEnabled()
{
return GetDefault<ULevelEditorViewportSettings>()->bTransparentBoxSelection;
}
void FLevelEditorActionCallbacks::OnDrawBrushMarkerPolys()
{
GEditor->Exec( GetWorld(), *FString::Printf( TEXT("MODE SHOWBRUSHMARKERPOLYS=%d"), !GEditor->bShowBrushMarkerPolys ? 1 : 0 ) );
GEditor->SaveConfig();
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorViewportSettings.h:517
Scope (from outer to inner):
file
class class ULevelEditorViewportSettings : public UObject
Source code excerpt:
/** True if viewport box selection also selects occluded objects, false if only objects with visible pixels are selected */
UPROPERTY(config)
uint32 bTransparentBoxSelection:1;
/** Whether to show selection outlines for selected Actors */
UPROPERTY(EditAnywhere, config, Category=LookAndFeel, meta=(DisplayName = "Use Selection Outline"))
uint32 bUseSelectionOutline:1;
/** Sets the intensity of the overlay displayed when an object is selected */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DragTool_FrustumSelect.cpp:142
Scope (from outer to inner):
file
function void FDragTool_ActorFrustumSelect::EndDrag
Source code excerpt:
TArray<FTypedElementHandle> ElementsToSelect;
const bool bTransparentBoxSelection = GetDefault<ULevelEditorViewportSettings>()->bTransparentBoxSelection;
if (bTransparentBoxSelection)
{
// Get a list of frustum-culled actors
for(FActorIterator It(EditorViewportClient->GetWorld()); It; ++It)
{
AActor* Actor = *It;
ElementsToSelect.Append(UE::LevelEditor::Private::GetElementsIntersectingFrustum(Actor, Frustum, EditorViewportClient, LevelViewportClient, SeletionArgs));