MaximumValueRadius
MaximumValueRadius
#Overview
name: MaximumValueRadius
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 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MaximumValueRadius is to serve as a reference value for adjusting brush sizes in Unreal Engine’s landscape editing tools. It acts as a maximum threshold for brush radius calculations, particularly in erosion and noise-related operations for landscape modification.
This setting variable is primarily used in the Unreal Engine’s Landscape Editor subsystem. Based on the callsites, it’s specifically utilized in the erosion and noise tools for landscape editing.
The value of MaximumValueRadius is set in the ULandscapeEditorObject constructor with a default value of 10000.0f. It can be loaded from and saved to the project’s editor configuration file (GEditorPerProjectIni) using the “LandscapeEdit” section.
MaximumValueRadius interacts with the current tool brush radius (UISettings->GetCurrentToolBrushRadius()). It’s used to calculate a brush size adjustment factor (BrushSizeAdjust) when the current brush radius is smaller than MaximumValueRadius.
Developers should be aware that this variable is not exposed to the UI, as noted in the comment in the header file. It’s used internally by the noise and erosion tools to adjust brush effects based on the brush size.
Best practices when using this variable include:
- Avoid modifying it directly unless you fully understand its impact on landscape editing tools.
- If customizing landscape tools, consider this variable when calculating brush effects to maintain consistency with built-in tools.
- Be mindful of its value when debugging landscape editing operations, especially if unexpected behavior occurs with large brush sizes.
- If extending the landscape editing functionality, consider using a similar approach for new tools that require brush size scaling.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:757, section: [LandscapeEdit]
- INI Section:
LandscapeEdit
- Raw value:
10000.000000
- 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/LandscapeEdModeErosionTools.cpp:259
Scope (from outer to inner):
file
class class FLandscapeToolStrokeErosion : public FLandscapeToolStrokeErosionBase
function void Apply
Source code excerpt:
float BrushSizeAdjust = 1.0f;
if (UISettings->GetCurrentToolBrushRadius() < UISettings->MaximumValueRadius)
{
BrushSizeAdjust = UISettings->GetCurrentToolBrushRadius() / UISettings->MaximumValueRadius;
}
// Make some noise...
for (int32 Y = BrushInfo.GetBounds().Min.Y; Y < BrushInfo.GetBounds().Max.Y; Y++)
{
const float* BrushScanline = BrushInfo.GetDataPtr(FIntPoint(0, Y));
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEdModePaintTools.cpp:1320
Scope (from outer to inner):
file
class class FLandscapeToolStrokeNoise : public FLandscapeToolStrokePaintBase<ToolTarget>
function void Apply
Source code excerpt:
float BrushSizeAdjust = 1.0f;
CA_SUPPRESS(6326);
if (ToolTarget::TargetType != ELandscapeToolTargetType::Weightmap && UISettings->GetCurrentToolBrushRadius() < UISettings->MaximumValueRadius)
{
BrushSizeAdjust = UISettings->GetCurrentToolBrushRadius() / UISettings->MaximumValueRadius;
}
CA_SUPPRESS(6326);
bool bUseWeightTargetValue = UISettings->bUseWeightTargetValue && ToolTarget::TargetType == ELandscapeToolTargetType::Weightmap;
const float PaintStrength = this->GetStrength(UISettings, /* bInIsHeighthMap = */ false);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:35
Scope (from outer to inner):
file
function ULandscapeEditorObject::ULandscapeEditorObject
Source code excerpt:
, bUseWeightTargetValue(false)
, WeightTargetValue(1.0f)
, MaximumValueRadius(10000.0f)
, bCombinedLayersOperation(true)
, FlattenMode(ELandscapeToolFlattenMode::Both)
, bUseSlopeFlatten(false)
, bPickValuePerApply(false)
, bUseFlattenTarget(false)
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:301
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Load
Source code excerpt:
bDetailSmooth = InbDetailSmooth;
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("MaximumValueRadius"), MaximumValueRadius, GEditorPerProjectIni);
bool InbSmoothGizmoBrush = bSmoothGizmoBrush;
GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("bSmoothGizmoBrush"), InbSmoothGizmoBrush, GEditorPerProjectIni);
bSmoothGizmoBrush = InbSmoothGizmoBrush;
int32 InPasteMode = (int32)ELandscapeToolPasteMode::Both;
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:443
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Save
Source code excerpt:
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bDetailSmooth"), bDetailSmooth, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("MaximumValueRadius"), MaximumValueRadius, GEditorPerProjectIni);
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("bSmoothGizmoBrush"), bSmoothGizmoBrush, GEditorPerProjectIni);
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("PasteMode"), (int32)PasteMode, GEditorPerProjectIni);
GConfig->SetInt(TEXT("LandscapeEdit"), TEXT("MirrorOp"), (int32)MirrorOp, GEditorPerProjectIni);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Public/LandscapeEditorObject.h:299
Scope (from outer to inner):
file
class class ULandscapeEditorObject : public UObject
Source code excerpt:
// I have no idea what this is for but it's used by the noise and erosion tools, and isn't exposed to the UI
UPROPERTY(NonTransactional)
float MaximumValueRadius;
// Use the combined result of the underlying layers as input to the operation. When not checked, it will use only the data in the currently selected layer as input.
UPROPERTY(Category="Tool Settings", EditAnywhere, NonTransactional, meta=(ShowForTools="Flatten,Smooth,Erosion,HydraErosion,Ramp", ShowForTargetTypes="Heightmap", ShowForLandscapeLayerSystem))
bool bCombinedLayersOperation;
// Flatten Tool: