Navigation
API > API/Plugins > API/Plugins/LandscapePatch
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- ULandscapePatchComponent
- ULandscapeTexturePatch
References
| Module | LandscapePatch |
| Header | /Engine/Plugins/Experimental/LandscapePatch/Source/LandscapePatch/Public/LandscapeTexturePatch.h |
| Include | #include "LandscapeTexturePatch.h" |
Syntax
UCLASS&40;Blueprintable, BlueprintType, ClassGroup&61;Landscape, Meta&61;&40;BlueprintSpawnableComponent&41;&41;
class ULandscapeTexturePatch : public ULandscapePatchComponent
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bApplyComponentZScale | Whether to apply the patch Z scale to the height stored in the patch. | |
| bool | bBaseResolutionOffLandscape | When initializing from landscape, set resolution based off of the landscape (and a multiplier). | |
| ELandscapeTexturePatchBlendMode | BlendMode | ||
| bool | bReinitializeHeightOnNextRender | ||
| bool | bUseTextureAlphaForHeight | When true, texture alpha channel will be used when applying the patch. | |
| ClampMin | Texture width to use when reinitializing, if not basing resolution off landscape. | ||
| ELandscapeTexturePatchSourceMode | DetailPanelHeightSourceMode | How the heightmap of the patch is stored. | |
| DisallowedAssetDataTags | |||
| EditCondition | Texture used when source mode is set to a texture asset. | ||
| float | Falloff | Distance (in unscaled world coordinates) across which to smoothly fall off the patch effects. | |
| ELandscapeTexturePatchFalloffMode | FalloffMode | ||
| TObjectPtr< ULandscapeHeightTextureBackedRenderTarget > | HeightInternalData | Not directly settable via detail panel- for display/debugging purposes only. | |
| ELandscapeTexturePatchSourceMode | HeightSourceMode | How the heightmap of the patch is stored. | |
| int32 | NumWeightPatches | Used to detect changes to the number of weight patches via the detail panel, so that we can initialize the "owner" pointer when patches are added or trigger update when patches are removed. | |
| int32 | ResolutionX | ||
| int32 | ResolutionY | ||
| FVector2D | UnscaledPatchCoverage | At scale 1.0, the X and Y of the region affected by the height patch. | |
| TArray< TObjectPtr< ULandscapeWeightPatchTextureInfo > > | WeightPatches | Weight patches. | |
| ELandscapeTextureHeightPatchZeroHeightMeaning | ZeroHeightMeaning | How 0 height is interpreted. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddWeightPatch
(
const FName& InWeightmapLayerName, |
By default, the layer is added with source mode set to be a texture-backed render target. | |
| void | ClearWeightPatchBlendModeOverride
(
const FName& InWeightmapLayerName |
||
| void | Sets the soure mode of all weight patches to "None". | ||
| TArray< FName > | |||
| FVector2D | Gives size in unscaled world coordinates of the patch in the world, based off of UnscaledCoverage and texture resolution (i.e., adds a half-pixel around UnscaledCoverage). | ||
| UTexture2D * | These need to be public so that we can take the internal textures and write them to external ones, but unclear whether we want to expose them to blueprints, since this is a fairly internal thing. | ||
| UTextureRenderTarget2D * | GetHeightRenderTarget
(
bool bMarkDirty |
Gets the internal height render target, if source mode is set to Texture Backed Render Target. | |
| ELandscapeTexturePatchSourceMode | |||
| bool | GetInitResolutionFromLandscape
(
float ResolutionMultiplier, |
Given the landscape resolution, current patch coverage, and a landscape resolution multiplier, gives the needed resolution of the landscape patch. | |
| FTransform | Gets the transform from patch to world. | ||
| FVector2D | Gets the size (in pixels) of the internal textures used by the patch. | ||
| FVector2D | Gives size in unscaled world coordinates (ie before applying patch transform) of the patch as measured between the centers of the outermost pixels. | ||
| UTexture2D * | GetWeightPatchInternalTexture
(
const FName& InWeightmapLayerName |
||
| UTextureRenderTarget2D * | GetWeightPatchRenderTarget
(
const FName& InWeightmapLayerName |
||
| ELandscapeTexturePatchSourceMode | GetWeightPatchSourceMode
(
const FName& InWeightmapLayerName |
||
| void | Given the current initialization settings, reinitialize the height patch. | ||
| void | |||
| void | |||
| void | RemoveWeightPatch
(
const FName& InWeightmapLayerName |
||
| void | ResetHeightEncodingMode
(
ELandscapeTextureHeightPatchEncoding EncodingMode |
Just like SetSourceEncodingMode, but resets ZeroInEncoding, WorldSpaceEncodingScale, and height render target format to mode-specific defaults. | |
| void | SetBlendMode
(
ELandscapeTexturePatchBlendMode BlendModeIn |
Determines how the height patch is blended into the existing terrain. | |
| void | SetEditVisibilityLayer
(
const FName& InWeightmapLayerName, |
||
| void | SetFalloff
(
float FalloffIn |
||
| void | SetHeightEncodingMode
(
ELandscapeTextureHeightPatchEncoding EncodingMode |
Set the height encoding mode for the patch, which determines how stored values in the patch are translated into heights when applying to landscape. | |
| void | SetHeightEncodingSettings
(
const FLandscapeTexturePatchEncodingSettings& Settings |
Set settings that determine how values in the patch are translated into heights. | |
| void | SetHeightRenderTargetFormat
(
ETextureRenderTargetFormat Format |
||
| void | SetHeightSourceMode
(
ELandscapeTexturePatchSourceMode NewMode |
Changes source mode. | |
| void | SetHeightTextureAsset
(
UTexture* TextureIn |
Sets the texture used for height when the height source mode is set to texture asset. | |
| void | SetResolution
(
FVector2D ResolutionIn |
Sets the resolution of the currently used internal texture or render target. | |
| void | SetUnscaledCoverage
(
FVector2D Coverage |
Set the patch coverage (see GetUnscaledCoverage for description). | |
| void | SetUseAlphaChannelForHeight
(
bool bUse |
Determines whether the height patch alpha channel is used for blending into the existing values. | |
| void | SetUseAlphaChannelForWeightPatch
(
const FName& InWeightmapLayerName, |
||
| void | SetWeightPatchBlendModeOverride
(
const FName& InWeightmapLayerName, |
||
| void | SetWeightPatchSourceMode
(
const FName& InWeightmapLayerName, |
||
| void | SetWeightPatchTextureAsset
(
const FName& InWeightmapLayerName, |
||
| void | SetZeroHeightMeaning
(
ELandscapeTextureHeightPatchZeroHeightMeaning ZeroHeightMeaningIn |
Set how zero height is interpreted, see comments in ELandscapeTextureHeightPatchZeroHeightMeaning. | |
| void | Adjusts patch rotation to be aligned to a 90 degree increment relative to the landscape, adjusts UnscaledPatchCoverage such that it becomes a multiple of landscape quad size, and adjusts patch location so that the boundaries of the covered area lie on the nearest landscape vertices. |
Overridden from ULandscapePatchComponent
| Type | Name | Description | |
|---|---|---|---|
| bool | |||
| bool | AffectsWeightmapLayer
(
const FName& InLayerName |
||
| bool | IsEnabled () |
||
| UTextureRenderTarget2D * | RenderLayer_Native
(
const FLandscapeBrushParameters& InParameters |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
UObject. |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | IsAffectingWeightmapLayer
(
const FName& InLayerName |
Use AffectsWeightmapLayer |