AlphaBrushPanU
AlphaBrushPanU
#Overview
name: AlphaBrushPanU
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 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AlphaBrushPanU is to horizontally offset the brush mask texture in the Landscape Editor of Unreal Engine 5. This setting variable is part of the Landscape editing system, specifically for controlling the appearance and behavior of alpha brushes used in landscape sculpting and painting.
Based on the callsites, this variable is primarily used in the LandscapeEditor module, which is part of Unreal Engine’s landscape editing system. It’s utilized in classes like FLandscapeBrushAlphaPattern and ULandscapeEditorObject.
The value of this variable is set through the Unreal Engine editor interface. It’s exposed as an editable property in the ULandscapeEditorObject class, with metadata indicating it’s displayed in the “Brush Settings” category of the editor UI.
AlphaBrushPanU interacts closely with other related variables such as AlphaBrushPanV (for vertical offset), AlphaBrushRotation, and AlphaBrushScale. Together, these variables control the positioning, rotation, and scaling of the alpha brush texture.
Developers should be aware that:
- The value is clamped between 0 and 1, as indicated by the property metadata.
- It’s used in conjunction with the brush size (SizeX) to calculate the final horizontal offset.
- Changes to this value are saved to and loaded from the project’s editor settings file (GEditorPerProjectIni).
Best practices when using this variable include:
- Use it in combination with AlphaBrushPanV for precise control over brush positioning.
- Be mindful of how it interacts with brush scale and rotation for the desired effect.
- Consider using the world space pattern brush option (bUseWorldSpacePatternBrush) for more consistent results across different landscape scales.
- Remember that changes to this value will affect all instances of the landscape editor in the project, as it’s saved in the project settings.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:732, section: [LandscapeEdit]
- INI Section:
LandscapeEdit
- 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/LandscapeEditor/Private/LandscapeEdModeBrushes.cpp:1213
Scope (from outer to inner):
file
class class FLandscapeBrushAlphaPattern : public FLandscapeBrushAlphaBase
function virtual FLandscapeBrushData ApplyBrush
Source code excerpt:
Scale.X = 1.0f / EdMode->UISettings->AlphaBrushScale;
Scale.Y = 1.0f / EdMode->UISettings->AlphaBrushScale;
Bias.X = SizeX * EdMode->UISettings->AlphaBrushPanU;
Bias.Y = SizeY * EdMode->UISettings->AlphaBrushPanV;
Angle = EdMode->UISettings->AlphaBrushRotation;
}
// Find alphamap sample location
FVector2D SamplePos = FVector2D(X, Y) * Scale + Bias;
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEdModeBrushes.cpp:1306
Scope (from outer to inner):
file
class class FLandscapeBrushAlphaPattern : public FLandscapeBrushAlphaBase
function virtual void Tick
Source code excerpt:
static_cast<float>(FMath::IsNearlyZero(Scale.X) ? 1.0 : 1.0 / (Scale.X)),
static_cast<float>(FMath::IsNearlyZero(Scale.Y) ? 1.0 : 1.0 / (Scale.Y)),
EdMode->UISettings->AlphaBrushPanU,
EdMode->UISettings->AlphaBrushPanV);
Angle = EdMode->UISettings->AlphaBrushRotation;
}
Angle = FMath::DegreesToRadians(Angle);
FVector LandscapeLocation = Proxy->LandscapeActorToWorld().GetTranslation();
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorDetailCustomization_AlphaBrush.cpp:254
Scope (from outer to inner):
file
function BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION void FLandscapeEditorDetailCustomization_AlphaBrush::CustomizeDetails
Source code excerpt:
TSharedRef<IPropertyHandle> PropertyHandle_AlphaBrushScale = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, AlphaBrushScale));
TSharedRef<IPropertyHandle> PropertyHandle_AlphaBrushRotation = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, AlphaBrushRotation));
TSharedRef<IPropertyHandle> PropertyHandle_AlphaBrushPanU = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, AlphaBrushPanU));
TSharedRef<IPropertyHandle> PropertyHandle_AlphaBrushPanV = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, AlphaBrushPanV));
auto NonWorld_Visibility = TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateLambda([=]() { return GetPropertyValue<bool>(PropertyHandle_bUseWorldSpacePatternBrush) ? EVisibility::Collapsed : EVisibility::Visible; } ));
auto World_Visibility = TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateLambda([=]() { return GetPropertyValue<bool>(PropertyHandle_bUseWorldSpacePatternBrush) ? EVisibility::Visible : EVisibility::Collapsed; } ));
BrushSettingsCategory.AddProperty(PropertyHandle_bUseWorldSpacePatternBrush);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:110
Scope (from outer to inner):
file
function ULandscapeEditorObject::ULandscapeEditorObject
Source code excerpt:
, bAlphaBrushAutoRotate(true)
, AlphaBrushRotation(0.0f)
, AlphaBrushPanU(0.5f)
, AlphaBrushPanV(0.5f)
, bUseWorldSpacePatternBrush(false)
, WorldSpacePatternBrushSettings(FVector2D::ZeroVector, 0.0f, false, 3200)
, AlphaTexture(nullptr)
, AlphaTextureChannel(ELandscapeTextureColorChannel::Red)
, AlphaTextureSizeX(1)
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:226
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Load
Source code excerpt:
GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("AlphaBrushAutoRotate"), bAlphaBrushAutoRotate, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("AlphaBrushRotation"), AlphaBrushRotation, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("AlphaBrushPanU"), AlphaBrushPanU, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("AlphaBrushPanV"), AlphaBrushPanV, GEditorPerProjectIni);
GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("bUseWorldSpacePatternBrush"), bUseWorldSpacePatternBrush, GEditorPerProjectIni);
GConfig->GetVector2D(TEXT("LandscapeEdit"), TEXT("WorldSpacePatternBrushSettings.Origin"), WorldSpacePatternBrushSettings.Origin, GEditorPerProjectIni);
GConfig->GetBool(TEXT("LandscapeEdit"), TEXT("WorldSpacePatternBrushSettings.bCenterTextureOnOrigin"), WorldSpacePatternBrushSettings.bCenterTextureOnOrigin, GEditorPerProjectIni);
GConfig->GetFloat(TEXT("LandscapeEdit"), TEXT("WorldSpacePatternBrushSettings.RepeatSize"), WorldSpacePatternBrushSettings.RepeatSize, GEditorPerProjectIni);
FString AlphaTextureName = (AlphaTexture != nullptr) ? AlphaTexture->GetPathName() : FString();
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorObject.cpp:399
Scope (from outer to inner):
file
function void ULandscapeEditorObject::Save
Source code excerpt:
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("AlphaBrushAutoRotate"), bAlphaBrushAutoRotate, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("AlphaBrushRotation"), AlphaBrushRotation, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("AlphaBrushPanU"), AlphaBrushPanU, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("AlphaBrushPanV"), AlphaBrushPanV, GEditorPerProjectIni);
GConfig->SetVector2D(TEXT("LandscapeEdit"), TEXT("WorldSpacePatternBrushSettings.Origin"), WorldSpacePatternBrushSettings.Origin, GEditorPerProjectIni);
GConfig->SetBool(TEXT("LandscapeEdit"), TEXT("WorldSpacePatternBrushSettings.bCenterTextureOnOrigin"), WorldSpacePatternBrushSettings.bCenterTextureOnOrigin, GEditorPerProjectIni);
GConfig->SetFloat(TEXT("LandscapeEdit"), TEXT("WorldSpacePatternBrushSettings.RepeatSize"), WorldSpacePatternBrushSettings.RepeatSize, GEditorPerProjectIni);
const FString AlphaTextureName = (AlphaTexture != nullptr) ? AlphaTexture->GetPathName() : FString();
GConfig->SetString(TEXT("LandscapeEdit"), TEXT("AlphaTextureName"), *AlphaTextureName, GEditorPerProjectIni);
#Loc: <Workspace>/Engine/Source/Editor/LandscapeEditor/Public/LandscapeEditorObject.h:654
Scope (from outer to inner):
file
class class ULandscapeEditorObject : public UObject
Source code excerpt:
// Horizontally offsets the brush mask texture
UPROPERTY(Category="Brush Settings", EditAnywhere, NonTransactional, meta=(DisplayName="Texture Pan U", ShowForBrushes="BrushSet_Pattern", ClampMin="0", ClampMax="1"))
float AlphaBrushPanU;
// Vertically offsets the brush mask texture
UPROPERTY(Category="Brush Settings", EditAnywhere, NonTransactional, meta=(DisplayName="Texture Pan V", ShowForBrushes="BrushSet_Pattern", ClampMin="0", ClampMax="1"))
float AlphaBrushPanV;
// Tile the pattern in world space (this only takes scale and position into account, not rotation)