PaintDensity
PaintDensity
#Overview
name: PaintDensity
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 PaintDensity is to control the density of foliage painting in the Unreal Engine 5 editor’s Foliage Edit mode. It determines how densely foliage instances are placed when painting foliage onto surfaces in the level.
This setting variable is primarily used by the Foliage Edit module, which is part of the Unreal Engine’s editor toolset. It’s specifically related to the foliage painting system within the level editor.
The value of this variable is set and retrieved in several ways:
- It’s loaded from and saved to the editor’s project-specific configuration file (GEditorPerProjectIni) in the “FoliageEdit” section.
- It can be get and set through getter and setter methods in the FFoliageUISettings class.
- It’s initialized with a default value of 0.5f in the FFoliageUISettings constructor.
PaintDensity interacts closely with other foliage-related variables, particularly:
- Radius: Determines the size of the foliage painting brush.
- UnpaintDensity: Controls the density of foliage removal when erasing.
Developers should be aware that:
- PaintDensity affects how many foliage instances are placed per brush stroke.
- It’s a float value, likely ranging from 0 to 1, where higher values result in denser foliage placement.
- Changes to this value are persisted between editor sessions via the configuration file.
Best practices when using this variable include:
- Adjust PaintDensity in small increments to fine-tune foliage placement.
- Consider the performance implications of high-density foliage placement, especially in large areas.
- Use in conjunction with other foliage parameters (like Radius) for optimal results.
- Remember that this setting affects editor behavior, not runtime performance directly.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:766, section: [FoliageEdit]
- INI Section:
FoliageEdit
- Raw value:
0.500000
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.cpp:4078
Scope (from outer to inner):
file
function void FFoliageUISettings::Load
Source code excerpt:
GConfig->GetFloat(TEXT("FoliageEdit"), TEXT("Radius"), Radius, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("FoliageEdit"), TEXT("PaintDensity"), PaintDensity, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("FoliageEdit"), TEXT("UnpaintDensity"), UnpaintDensity, GEditorPerProjectIni);
GConfig->GetBool(TEXT("FoliageEdit"), TEXT("bFilterLandscape"), bFilterLandscape, GEditorPerProjectIni);
GConfig->GetBool(TEXT("FoliageEdit"), TEXT("bFilterStaticMesh"), bFilterStaticMesh, GEditorPerProjectIni);
GConfig->GetBool(TEXT("FoliageEdit"), TEXT("bFilterBSP"), bFilterBSP, GEditorPerProjectIni);
GConfig->GetBool(TEXT("FoliageEdit"), TEXT("bFilterFoliage"), bFilterFoliage, GEditorPerProjectIni);
GConfig->GetBool(TEXT("FoliageEdit"), TEXT("bFilterTranslucent"), bFilterTranslucent, GEditorPerProjectIni);
#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.cpp:4110
Scope (from outer to inner):
file
function void FFoliageUISettings::Save
Source code excerpt:
GConfig->SetFloat(TEXT("FoliageEdit"), TEXT("Radius"), Radius, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("FoliageEdit"), TEXT("PaintDensity"), PaintDensity, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("FoliageEdit"), TEXT("UnpaintDensity"), UnpaintDensity, GEditorPerProjectIni);
GConfig->SetBool(TEXT("FoliageEdit"), TEXT("bFilterLandscape"), bFilterLandscape, GEditorPerProjectIni);
GConfig->SetBool(TEXT("FoliageEdit"), TEXT("bFilterStaticMesh"), bFilterStaticMesh, GEditorPerProjectIni);
GConfig->SetBool(TEXT("FoliageEdit"), TEXT("bFilterBSP"), bFilterBSP, GEditorPerProjectIni);
GConfig->SetBool(TEXT("FoliageEdit"), TEXT("bFilterFoliage"), bFilterFoliage, GEditorPerProjectIni);
GConfig->SetBool(TEXT("FoliageEdit"), TEXT("bFilterTranslucent"), bFilterTranslucent, GEditorPerProjectIni);
#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.h:98
Scope (from outer to inner):
file
function float GetPaintDensity
Source code excerpt:
float GetRadius() const { return (IsInAnySingleInstantiationMode()) ? SingleInstanceModeBrushSize : Radius; }
void SetRadius(float InRadius) { if (!IsInAnySingleInstantiationMode()) Radius = InRadius; }
float GetPaintDensity() const { return PaintDensity; }
void SetPaintDensity(float InPaintDensity) { PaintDensity = InPaintDensity; }
float GetUnpaintDensity() const { return UnpaintDensity; }
void SetUnpaintDensity(float InUnpaintDensity) { UnpaintDensity = InUnpaintDensity; }
bool GetFilterLandscape() const { return bFilterLandscape ? true : false; }
void SetFilterLandscape(bool InbFilterLandscape) { bFilterLandscape = InbFilterLandscape; }
bool GetFilterStaticMesh() const { return bFilterStaticMesh ? true : false; }
void SetFilterStaticMesh(bool InbFilterStaticMesh) { bFilterStaticMesh = InbFilterStaticMesh; }
#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.h:160
Scope (from outer to inner):
file
function FFoliageUISettings
Source code excerpt:
, PaletteThumbnailScale(0.3f)
, Radius(250.f)
, PaintDensity(0.5f)
, UnpaintDensity(0.f)
, IsInSingleInstantiationMode(false)
, IsInQuickSingleInstantiationMode(false)
, IsInQuickEraseMode(false)
, SingleInstantiationPlacementMode(EFoliageSingleInstantiationPlacementMode::Type::All)
, SingleInstantiationCycleThroughIndex(0)
#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.h:200
Scope: file
Source code excerpt:
float Radius;
float PaintDensity;
float UnpaintDensity;
bool IsInSingleInstantiationMode;
bool IsInQuickSingleInstantiationMode;
bool IsInQuickEraseMode;
EFoliageSingleInstantiationPlacementMode::Type SingleInstantiationPlacementMode;