bPickValuePerApply
bPickValuePerApply
#Overview
name: bPickValuePerApply
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 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bPickValuePerApply is to control the behavior of the Flatten tool in the Landscape Editor of Unreal Engine 5. Specifically, it determines whether the tool should continuously pick new height values to flatten towards as the user drags the tool across the landscape, or if it should use only the initial clicked point’s height value.
This setting variable is primarily used within the Landscape Editor module of Unreal Engine 5. It’s particularly relevant to the Flatten tool, which is part of the landscape editing toolset.
The value of this variable is set in multiple places:
- It’s initialized in the ULandscapeEditorObject constructor.
- It’s loaded from the project’s configuration file (GEditorPerProjectIni) in the ULandscapeEditorObject::Load function.
- It can be modified through the Unreal Editor interface, as it’s exposed as an UPROPERTY with EditAnywhere access.
This variable interacts with other landscape editing variables, particularly:
- bUseSlopeFlatten
- bUseFlattenTarget
- FlattenTarget
Developers should be aware that:
- This variable only affects the Flatten tool when working with heightmap targets.
- Enabling this option can lead to more dynamic flattening results, as the target height will change as the user moves the tool.
- The effect is most noticeable when used in conjunction with the Flatten tool’s brush falloff.
Best practices when using this variable include:
- Enable it when you want more natural, varied flattening results that follow the contours of the landscape as you drag.
- Disable it when you need consistent flattening to a single height value across a larger area.
- Consider the interaction with other flatten-related settings (like bUseSlopeFlatten and bUseFlattenTarget) to achieve the desired landscape editing behavior.
- Remember to save your preferred setting, as it will be stored in the project configuration for future sessions.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:738, section: [LandscapeEdit]
- INI Section:
LandscapeEdit
- 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/LandscapeEditor/Private/LandscapeEdModePaintTools.cpp:896
Scope (from outer to inner):
file
class class FLandscapeToolStrokeFlatten : public FLandscapeToolStrokePaintBase<ToolTarget>
function void Apply
Source code excerpt:
bool bUseSlopeFlatten = UISettings->bUseSlopeFlatten && !UISettings->bUseFlattenTarget;
if (!bInitializedFlattenValue || (UISettings->bPickValuePerApply && bTargetIsHeightmap))
{
bInitializedFlattenValue = false;
float FlattenX = static_cast<float>(InteractorPositions[0].Position.X);
float FlattenY = static_cast<float>(InteractorPositions[0].Position.Y);
int32 FlattenHeightX = FMath::FloorToInt(FlattenX);
int32 FlattenHeightY = FMath::FloorToInt(FlattenY);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:40
Scope (from outer to inner):
file
function ULandscapeEditorObject::ULandscapeEditorObject
Source code excerpt:
, FlattenMode(ELandscapeToolFlattenMode::Both)
, bUseSlopeFlatten(false)
, bPickValuePerApply(false)
, bUseFlattenTarget(false)
, FlattenTarget(0)
, bShowFlattenTargetPreview(true)
, TerraceInterval(1.0f)
, TerraceSmooth(0.0001f)
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:252
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Load
Source code excerpt:
bUseSlopeFlatten = InbUseSlopeFlatten;
bool InbPickValuePerApply = bPickValuePerApply;
GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("bPickValuePerApply"), InbPickValuePerApply, GEditorPerProjectIni);
bPickValuePerApply = InbPickValuePerApply;
bool InbUseFlattenTarget = bUseFlattenTarget;
GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("bUseFlattenTarget"), InbUseFlattenTarget, GEditorPerProjectIni);
bUseFlattenTarget = InbUseFlattenTarget;
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("FlattenTarget"), FlattenTarget, GEditorPerProjectIni);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:410
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Save
Source code excerpt:
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("FlattenMode"), (int32)FlattenMode, GEditorPerProjectIni);
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bUseSlopeFlatten"), bUseSlopeFlatten, GEditorPerProjectIni);
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bPickValuePerApply"), bPickValuePerApply, GEditorPerProjectIni);
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bUseFlattenTarget"), bUseFlattenTarget, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("FlattenTarget"), FlattenTarget, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("TerraceSmooth"), TerraceSmooth, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("TerraceInterval"), TerraceInterval, GEditorPerProjectIni);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Public/LandscapeEditorObject.h:317
Scope (from outer to inner):
file
class class ULandscapeEditorObject : public UObject
Source code excerpt:
// Constantly picks new values to flatten towards when dragging around, instead of only using the first clicked point
UPROPERTY(Category="Tool Settings", EditAnywhere, NonTransactional, meta=(ShowForTools="Flatten", ShowForTargetTypes="Heightmap"))
bool bPickValuePerApply;
// Enable to flatten towards a target height
UPROPERTY(Category = "Tool Settings", NonTransactional, EditAnywhere, meta = (InlineEditConditionToggle))
bool bUseFlattenTarget;
// Target height to flatten towards (in Unreal Units)