ActorSnapScale
ActorSnapScale
#Overview
name: ActorSnapScale
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 2
C++ source files.
#Summary
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:423, section: [/Script/UnrealEd.LevelEditorViewportSettings]
- INI Section:
/Script/UnrealEd.LevelEditorViewportSettings
- Raw value:
1.0
- Is Array:
False
#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:465
Scope (from outer to inner):
file
class class ULevelEditorViewportSettings : public UObject
Source code excerpt:
/** Global actor snap scale for the editor */
UPROPERTY(config, Category=GridSnapping, VisibleDefaultsOnly,AdvancedDisplay)
float ActorSnapScale;
/** Global actor snap distance setting for the editor */
UPROPERTY(config)
float ActorSnapDistance;
UPROPERTY(config)
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SnappingUtils.cpp:159
Scope (from outer to inner):
file
function float FEditorViewportSnapping::GetActorSnapDistance
Source code excerpt:
// If the user has purposefully exceeded the maximum scale, convert this to the range so that it can be more easily adjusted in the editor
if (ViewportSettings->ActorSnapScale > 1.0f)
{
ViewportSettings->ActorSnapDistance *= ViewportSettings->ActorSnapScale;
ViewportSettings->ActorSnapScale = 1.0f;
ViewportSettings->PostEditChange();
}
if (bScalar)
{
// Clamp to within range (just so slider looks correct)
return FMath::Clamp(ViewportSettings->ActorSnapScale, 0.0f, 1.0f);
}
// Multiply by the max distance allowed to convert to range
return FMath::Max(0.0f, ViewportSettings->ActorSnapScale) * ViewportSettings->ActorSnapDistance;
}
void FEditorViewportSnapping::SetActorSnapDistance(float Distance)
{
ULevelEditorViewportSettings* ViewportSettings = GetMutableDefault<ULevelEditorViewportSettings>();
ViewportSettings->ActorSnapScale = Distance;
ViewportSettings->PostEditChange();
}
bool FEditorViewportSnapping::SnapActorsToNearestActor( FVector& Drag, FLevelEditorViewportClient* ViewportClient )
{
FEditorModeTools& Tools = GLevelEditorModeTools();