UnpaintDensity

UnpaintDensity

#Overview

name: UnpaintDensity

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 UnpaintDensity is to control the density of foliage removal in Unreal Engine’s Foliage Edit mode. This variable is used in the foliage editing system to determine how quickly or intensely foliage is removed when using the unpaint tool.

The UnpaintDensity setting variable is primarily used by the Foliage Edit module in Unreal Engine. This can be seen from the file paths in the callsites, which are all within the FoliageEdit directory.

The value of this variable is set and retrieved in several ways:

  1. It is loaded from and saved to the project’s configuration file (GEditorPerProjectIni) using GConfig->GetFloat and GConfig->SetFloat functions.
  2. It can be directly set and retrieved using the SetUnpaintDensity and GetUnpaintDensity methods of the FFoliageUISettings class.
  3. It is initialized with a default value of 0.0f in the FFoliageUISettings constructor.

The UnpaintDensity variable interacts closely with other foliage editing variables, particularly PaintDensity. These two variables work together to control the addition and removal of foliage in the editor.

Developers should be aware that:

  1. The UnpaintDensity value is project-specific and persists between editor sessions.
  2. It’s a float value, likely representing a percentage or multiplier for foliage removal intensity.
  3. The default value is 0.0f, which might mean no unpaint effect by default.

Best practices when using this variable include:

  1. Adjusting it in small increments to fine-tune the foliage removal behavior.
  2. Considering the interaction between UnpaintDensity and PaintDensity to achieve the desired foliage distribution.
  3. Documenting any non-default values used in the project for consistency across the development team.
  4. Testing the foliage removal with different UnpaintDensity values to ensure it behaves as expected in various scenarios.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:767, section: [FoliageEdit]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.cpp:4079

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:4111

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:100

Scope (from outer to inner):

file
function     float GetUnpaintDensity

Source code excerpt:

	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; }
	bool GetFilterBSP() const { return bFilterBSP ? true : false; }
	void SetFilterBSP(bool InbFilterBSP) { bFilterBSP = InbFilterBSP; }

#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.h:161

Scope (from outer to inner):

file
function     FFoliageUISettings

Source code excerpt:

		, Radius(250.f)
		, PaintDensity(0.5f)
		, UnpaintDensity(0.f)
		, IsInSingleInstantiationMode(false)
		, IsInQuickSingleInstantiationMode(false)
		, IsInQuickEraseMode(false)
		, SingleInstantiationPlacementMode(EFoliageSingleInstantiationPlacementMode::Type::All)
		, SingleInstantiationCycleThroughIndex(0)
		, IsInSpawnInCurrentLevelMode(false)

#Loc: <Workspace>/Engine/Source/Editor/FoliageEdit/Private/FoliageEdMode.h:201

Scope: file

Source code excerpt:

	float Radius;
	float PaintDensity;
	float UnpaintDensity;

	bool IsInSingleInstantiationMode;
	bool IsInQuickSingleInstantiationMode;
	bool IsInQuickEraseMode;
	EFoliageSingleInstantiationPlacementMode::Type SingleInstantiationPlacementMode;
	int32 SingleInstantiationCycleThroughIndex;