bStrictBoxSelection
bStrictBoxSelection
#Overview
name: bStrictBoxSelection
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 8
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bStrictBoxSelection is to control how viewport box selection behaves in the Unreal Engine editor. Specifically, it determines whether objects must be fully encompassed by the selection box to be selected or if partially enclosed objects can also be selected.
This setting variable is primarily used in the Level Editor and related viewport systems. It’s utilized by various subsystems and modules, including:
- ControlRigEditor
- FractureEditor
- LevelEditor
- UnrealEd
The value of this variable is set in the ULevelEditorViewportSettings class, which is part of the editor configuration. It can be toggled through the editor interface or programmatically.
bStrictBoxSelection interacts with other selection-related variables, such as bTransparentBoxSelection, which determines whether occluded objects are also selected.
Developers must be aware that this variable affects the user experience when selecting objects in the viewport. When set to true, it requires more precise selection actions from users, as objects must be fully within the selection box to be included.
Best practices when using this variable include:
- Considering the target user’s preference and the type of project when deciding whether to enable strict box selection.
- Providing a way for users to toggle this setting easily, as different tasks may benefit from different selection behaviors.
- Ensuring that any custom selection tools or systems in the project respect this setting for consistency across the editor.
- Documenting the current state of this setting in project guidelines to maintain consistent workflow among team members.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:442, 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/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/EditMode/ControlRigEditMode.cpp:1753
Scope (from outer to inner):
file
function bool FControlRigEditMode::BoxSelect
Source code excerpt:
return FEdMode::BoxSelect(InBox, InSelect);
}
const bool bStrictDragSelection = GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
FScopedTransaction ScopedTransaction(LOCTEXT("SelectControlTransaction", "Select Control"), !AreEditingControlRigDirectly() && !GIsTransacting);
const bool bShiftDown = LevelViewportClient->Viewport->KeyState(EKeys::LeftShift) || LevelViewportClient->Viewport->KeyState(EKeys::RightShift);
if (!bShiftDown)
{
ClearRigElementSelection(ValidControlTypeMask());
#Loc: <Workspace>/Engine/Plugins/Experimental/ChaosEditor/Source/FractureEditor/Private/FractureEditorMode.cpp:362
Scope (from outer to inner):
file
function bool UFractureEditorMode::FrustumSelect
Source code excerpt:
bool UFractureEditorMode::FrustumSelect(const FConvexVolume& InFrustum, FEditorViewportClient* InViewportClient, bool InSelect /*= true*/)
{
bool bStrictDragSelection = GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
bool bSelectedBones = false;
if (USelection* SelectedActors = GEditor->GetSelectedActors())
{
for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter)
{
#Loc: <Workspace>/Engine/Plugins/Experimental/ChaosEditor/Source/FractureEditor/Private/FractureToolSelection.cpp:181
Scope (from outer to inner):
file
function void UFractureToolSelection::OnDragRectangleFinished
Source code excerpt:
FConvexVolume FrustumVolume = Rectangle.FrustumAsConvexVolume();
bool bStrictDragSelection = GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
if (USelection* SelectedActors = GEditor->GetSelectedActors())
{
for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter)
{
AActor* Actor = Cast<AActor>(*Iter);
#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp:2735
Scope (from outer to inner):
file
function void FLevelEditorActionCallbacks::OnToggleStrictBoxSelect
Source code excerpt:
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->bStrictBoxSelection = !ViewportSettings->bStrictBoxSelection;
ViewportSettings->PostEditChange();
}
bool FLevelEditorActionCallbacks::OnIsStrictBoxSelectEnabled()
{
return GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
}
void FLevelEditorActionCallbacks::OnToggleTransparentBoxSelect()
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->bTransparentBoxSelection = !ViewportSettings->bTransparentBoxSelection;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorViewportSettings.h:513
Scope (from outer to inner):
file
class class ULevelEditorViewportSettings : public UObject
Source code excerpt:
/** 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 */
UPROPERTY(config)
uint32 bTransparentBoxSelection:1;
/** Whether to show selection outlines for selected Actors */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DragTool_BoxSelect.cpp:109
Scope (from outer to inner):
file
function void FDragTool_ActorBoxSelect::AddDelta
Source code excerpt:
if( bUseHoverFeedback )
{
const bool bStrictDragSelection = GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
UTypedElementSelectionSet* SelectionSet = GEditor->GetEditorSubsystem<ULevelEditorSubsystem>()->GetSelectionSet();
UBrushEditingSubsystem* BrushSubsystem = GEditor->GetEditorSubsystem<UBrushEditingSubsystem>();
const bool bGeometryMode = BrushSubsystem ? BrushSubsystem->IsGeometryEditorModeActive() : false;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DragTool_BoxSelect.cpp:207
Scope (from outer to inner):
file
function void FDragTool_ActorBoxSelect::EndDrag
Source code excerpt:
if ( !bEditorModeHandledBoxSelection && !bComponentVisHandledSelection )
{
const bool bStrictDragSelection = GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
UTypedElementSelectionSet* SelectionSet = GEditor->GetEditorSubsystem<ULevelEditorSubsystem>()->GetSelectionSet();
FTypedElementSelectionOptions ElementSelectionOption;
if (!bControlDown && !bShiftDown)
{
// If the user is selecting, but isn't holding down SHIFT, remove all current selections from the selection set
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DragTool_FrustumSelect.cpp:105
Scope (from outer to inner):
file
function void FDragTool_ActorFrustumSelect::EndDrag
Source code excerpt:
// Does an actor have to be fully contained in the box to be selected
const bool bStrictDragSelection = GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;
// Let the editor mode try to handle the selection.
const bool bEditorModeHandledSelection = ModeTools->FrustumSelect(Frustum, EditorViewportClient, bLeftMouseButtonDown);
// Let the component visualizers try to handle the selection.
const bool bComponentVisHandledSelection = !bEditorModeHandledSelection && GUnrealEd->ComponentVisManager.HandleFrustumSelect(Frustum, EditorViewportClient, EditorViewportClient->Viewport);