Skip to content
Orbdale

Orbdale Terrain · OrbdaleTerrain module · class

UOrbdaleTerrainBrushToolComponent

A brush tool a game drops onto a player controller: Enhanced Input for the verbs, a text HUD and a cursor ring drawn on the terrain, over UOrbdaleTerrainSculptComponent.

Declaration

UCLASS(Blueprintable, ClassGroup=(Orbdale), meta=(BlueprintSpawnableComponent),
       HideCategories=(Variable, Tags, ComponentReplication, Activation, Cooking, AssetUserData))
class UOrbdaleTerrainBrushToolComponent : public UActorComponent
Header
#include "Tools/OrbdaleTerrainBrushToolComponent.h"
Module
PublicDependencyModuleNames.Add("OrbdaleTerrain"); in your module’s Build.cs.
Stability
Stable: changes within a major version only add.
Thread
Game thread, local player only.
Derives from
UActorComponent
Blueprint
“Orbdale Terrain Brush Tool Component”, a Blueprint type; Blueprints can derive from it

Description

Add it to a PlayerController (or call SetToolActive from your own code). It finds a sculpt component on the same actor or adds one, so the brush state lives in the sculpt component's Brush and a game may keep driving that component directly. The default input assets live in /OrbdaleTerrain/Tools (IMC_TerrainBrush and thirteen IA_TerrainBrush_* actions, made by the plugin's content tooling); assign your own to the action slots to remap.

The HUD is drawn on the canvas of the player's AHUD (any HUD class, none to set up), so it works without a widget asset: restyle it with the style properties or override DrawToolHUD. The cursor ring is projected onto the terrain with the analytic ground raycast, not a physics trace, so it follows the ground exactly and costs no physics query.

Every verb is a plain function (BeginStroke, ScaleRadius, CycleBrushKind, Undo, ...), so a game can drive the tool from its own input, a gamepad, a menu or a test.

Note.

Game thread, local player only. Network play: set the sculpt component's bRouteCommandsExternally; the tool routes through it unchanged.

Functions

Properties

NameTypeDefaultMeaning
bActiveOnBeginPlayBlueprintReadWritebooltrue

Activate the tool in BeginPlay.

CursorSourceBlueprintReadWriteEOrbdaleTerrainCursorSourceEOrbdaleTerrainCursorSource::MouseCursor

Where the cursor comes from; copied to the sculpt component when the tool activates.

InitialRadius_cmBlueprintReadWritedouble2000.0

Brush radius a freshly added sculpt component starts with, cm.

InitialStrength_cmBlueprintReadWritedouble20.0

Brush strength a freshly added sculpt component starts with, cm per step.

BrushKindsBlueprintReadWriteTArray<EOrbdaleTerrainBrushKind>—

The kinds CycleBrushKind steps through, in order.

Default: Raise, Lower, Smooth, Flatten, Paint. PaintChannel may be added; it writes the sculpt component's Brush.Channel and ChannelValue as set, not the paint layer.

PaintLayerNamesBlueprintReadWriteTArray<FName>—

Display names of the paint layers, index = layer; the HUD shows them and CyclePaintLayer wraps over them.

The default lists the plugin's starter layers in their material order (a test keeps the two equal).

RadiusStepFactorBlueprintReadWritefloat1.25f

One radius step of the radius actions: the radius is multiplied (up) or divided (down) by this.

StrengthStepFactorBlueprintReadWritefloat1.25f

One strength step of the strength actions: the strength is multiplied (up) or divided (down) by this.

FalloffStartStepBlueprintReadWritefloat0.1f

One step of the falloff start actions (Shift+] and Shift+[), as a fraction of the radius.

FlattenFalloffStartBlueprintReadWritefloat0.5f

Flatten's own falloff start, 0 to 1, kept apart from the one every other kind shares: a pad on steep ground needs a flat core and a long blend, a sculpt brush mostly none.

SetBrushKind gives the brush this value when it switches to Flatten and writes the brush's value back here when it leaves, so a change made while flattening stays with Flatten and the other kinds keep theirs.

MappingContextBlueprintReadWriteTObjectPtr<UInputMappingContext>—

The mapping context added to the local player while the tool is active.

MappingPriorityBlueprintReadWriteint3210

Priority of MappingContext.

StrokeActionBlueprintReadWriteTObjectPtr<UInputAction>—

Boolean: press opens a stroke at the cursor, release closes it.

RadiusUpActionBlueprintReadWriteTObjectPtr<UInputAction>——
RadiusDownActionBlueprintReadWriteTObjectPtr<UInputAction>——
StrengthUpActionBlueprintReadWriteTObjectPtr<UInputAction>——
StrengthDownActionBlueprintReadWriteTObjectPtr<UInputAction>——
CycleKindActionBlueprintReadWriteTObjectPtr<UInputAction>——
CycleLayerActionBlueprintReadWriteTObjectPtr<UInputAction>——
CycleFalloffActionBlueprintReadWriteTObjectPtr<UInputAction>—

Boolean: press steps the falloff shape (Smooth, Linear, Constant).

FalloffStartUpActionBlueprintReadWriteTObjectPtr<UInputAction>—

Boolean: press widens the full-strength core by FalloffStartStep (default Shift+], a chord on IA_TerrainBrush_Shift).

FalloffStartDownActionBlueprintReadWriteTObjectPtr<UInputAction>—

Boolean: press narrows the full-strength core by FalloffStartStep (default Shift+[).

UndoActionBlueprintReadWriteTObjectPtr<UInputAction>——
RedoActionBlueprintReadWriteTObjectPtr<UInputAction>——
bShowHUDBlueprintReadWritebooltrue

Master switch of the tool HUD: false hides the text panel, the falloff plot and the cursor ring.

The HUD is also hidden whatever this says when the process runs with -SampleShots (the sample director capture pass), see IsHudHidden.

bShowCursorRingBlueprintReadWritebooltrue

Draw the cursor ring while the tool is active and the cursor is over ground.

HUDOriginBlueprintReadWriteFVector2DFVector2D(24.0, 24.0)

Top-left corner of the HUD text, pixels.

HUDTextScaleBlueprintReadWritefloat1.5f

Text scale of the HUD.

HUDColorBlueprintReadWriteFLinearColorFLinearColor(1.f, 0.92f, 0.45f, 1.f)—
HUDBackgroundBlueprintReadWriteFLinearColorFLinearColor(0.f, 0.f, 0.f, 0.55f)—
RingColorBlueprintReadWriteFLinearColorFLinearColor(1.f, 0.92f, 0.45f, 1.f)

Ring colour while idle.

RingActiveColorBlueprintReadWriteFLinearColorFLinearColor(1.f, 0.5f, 0.1f, 1.f)

Ring colour while a stroke is open.

FalloffContourLevelsBlueprintReadWriteTArray<float>—

Strength factors (0 to 1 exclusive) that get a fainter contour ring inside the outer ring, solved from the falloff curve: 0.5 is the radius where the brush is half as strong as at the centre.

Empty draws only the outer ring. Constant falloff has no contours.

bShowFalloffPlotBlueprintReadWritebooltrue

Draw the falloff profile plot (strength against distance) under the HUD text.

FalloffPlotSizeBlueprintReadWriteFVector2DFVector2D(220.0, 90.0)

Size of the falloff profile plot, pixels.

RingSegmentsBlueprintReadWriteint3264

Line segments of the outer ring; each is one ground raycast per frame.

A contour ring of radius r gets Segments * r / R segments (at least 16), so the ring spacing on the ground stays even: all rings together cost about Segments * (1 + sum of contour radius fractions).

RingThicknessBlueprintReadWritefloat2.f

Ring line width, pixels.

HintTextBlueprintReadWriteFText—

Last HUD line: the default key hints.

Empty hides it.

Blueprint