UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LandscapeEditLayerMergeContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7
8
9// ----------------------------------------------------------------------------------
10// Forward declarations
11
12class ALandscape;
13class ULandscapeInfo;
15
17{
19} // namespace UE::Landscape::EditLayers
20
21// ----------------------------------------------------------------------------------
22
24{
25
26#if WITH_EDITOR
27
31class FMergeContext
32{
33public:
34 friend ALandscape;
35
36 using FTargetLayerGroupsPerBlendingMethod = TStaticArray<TArray<FTargetLayerGroup>, static_cast<uint8>(ELandscapeTargetLayerBlendMethod::Count)>;
37
39 virtual ~FMergeContext() = default;
40 FMergeContext(const FMergeContext& Other) = default;
42 FMergeContext& operator=(const FMergeContext& Other) = default;
43 FMergeContext& operator=(FMergeContext&& Other) = default;
44
45 inline ALandscape* GetLandscape() const { return Landscape; }
46
47 inline ULandscapeInfo* GetLandscapeInfo() const { return LandscapeInfo; }
48
52 inline const TArray<FName>& GetAllTargetLayerNames() const { return AllTargetLayerNames; }
53
58
63
67 inline bool IsHeightmapMerge() const { return bIsHeightmapMerge; }
68
72 inline bool ShouldSkipProceduralRenderers() const { return bSkipProceduralRenderers; }
73
78
83
89
94
99
104
109
114
119
124
129
134
139
144
149
154
163 LANDSCAPE_API void ForEachTargetLayer(const TBitArray<>& InTargetLayerBitIndices, TFunctionRef<bool(int32 /*InTargetLayerIndex*/, const FName& /*InTargetLayerName*/, ULandscapeLayerInfoObject* /*InWeightmapLayerInfo*/)> Fn) const;
164
166 LANDSCAPE_API void ForEachValidTargetLayer(TFunctionRef<bool(int32 /*InTargetLayerIndex*/, const FName& /*InTargetLayerName*/, ULandscapeLayerInfoObject* /*InWeightmapLayerInfo*/)> Fn) const;
167
172
177
180
185
190
192
198
199private:
202
203protected:
204 // COMMENT [jonathan.bard] : purposefully don't use ELandscapeToolTargetType here as ELandscapeToolTargetType::Weightmap and ELandscapeToolTargetType::Visibility have to be processed together (because of weightmap packing,
205 // which means a visibility weightmap could be another channel of a texture which contains weightmap up to 3 other weightmaps, so we have to resolve the 4 channels altogether).
206 // Note: this could change when SUPPORTS_LANDSCAPE_EDITORONLY_UBER_MATERIAL is done...
208 bool bIsHeightmapMerge = false;
209
211 bool bSkipProceduralRenderers = false;
212
214 ALandscape* Landscape = nullptr;
215
217 ULandscapeInfo* LandscapeInfo = nullptr;
218
223
226
229
232
235
238
239 // Index of the visibility layer in AllTargetLayerNames (always valid for weightmap merges)
241};
242
243#endif // WITH_EDITOR
244
245} // namespace UE::Landscape::EditLayers
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ELandscapeTargetLayerBlendMethod
Definition LandscapeEditTypes.h:33
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NameTypes.h:617
Definition Landscape.Build.cs:7
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition StaticArray.h:26
Definition LandscapeInfo.h:109
Definition LandscapeLayerInfoObject.h:60
Definition Landscape.h:55