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:

  1. It’s loaded from and saved to the editor’s project-specific configuration file (GEditorPerProjectIni) in the “FoliageEdit” section.
  2. It can be get and set through getter and setter methods in the FFoliageUISettings class.
  3. It’s initialized with a default value of 0.5f in the FFoliageUISettings constructor.

PaintDensity interacts closely with other foliage-related variables, particularly:

Developers should be aware that:

  1. PaintDensity affects how many foliage instances are placed per brush stroke.
  2. It’s a float value, likely ranging from 0 to 1, where higher values result in denser foliage placement.
  3. Changes to this value are persisted between editor sessions via the configuration file.

Best practices when using this variable include:

  1. Adjust PaintDensity in small increments to fine-tune foliage placement.
  2. Consider the performance implications of high-density foliage placement, especially in large areas.
  3. Use in conjunction with other foliage parameters (like Radius) for optimal results.
  4. 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]

#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;