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=(),
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.
Game thread, local player only. Network play: set the sculpt component's bRouteCommandsExternally; the tool routes through it unchanged.
Functions
- UOrbdaleTerrainBrushToolComponent
- BeginPlay
- EndPlay
- TickComponent
- SetToolActiveBlueprint
Turn the tool on or off.
- IsToolActiveBlueprint
- GetSculptComponentBlueprint
The sculpt component the tool drives; added to the owner on first use when it has none.
- BeginStrokeBlueprint
Open a stroke at the cursor and apply its first step.
- EndStrokeBlueprint
Close the open stroke.
- ScaleRadiusBlueprint
Multiply the radius by Factor, clamped to the terrain's sculpt limits (at least 1 m).
- ScaleStrengthBlueprint
Multiply the strength by Factor, clamped to the terrain's sculpt limits (at least 1 cm).
- SetBrushKindBlueprint
Select a brush kind.
- CycleBrushKindBlueprint
Step through BrushKinds, wrapping.
- SetPaintLayerBlueprint
Select the paint layer the Paint brush writes.
- SetFalloffBlueprint
Select the falloff toward the brush edge, for every brush kind.
- CycleFalloffBlueprint
Step through the falloff shapes Smooth, Linear, Constant, wrapping.
- SetFalloffStartBlueprint
Set where the falloff starts: the inner part of the radius at full strength, for the current brush kind (Flatten keeps its own, every other kind shares one).
- StepFalloffStartBlueprint
Move the falloff start by one FalloffStartStep, snapped to the step, between 0 and 1 - step.
- CyclePaintLayerBlueprint
Step through the paint layers, wrapping.
- UndoBlueprint
Undo the newest stroke (ends an open one first).
- RedoBlueprint
Redo the stroke the last Undo took back.
- StartScriptedStrokeBlueprint
Run a whole stroke along a straight line with no pointer: for automation, tutorials and tests.
- IsScriptedStrokeRunningBlueprint
- SetPointerBlockedBlueprint
Keep the stroke key from opening a stroke, and hide the ring: for a game whose pointer is over its own HUD, or busy turning the view.
- IsPointerBlockedBlueprint
Whether SetPointerBlocked holds the stroke key back now.
- GetHudRectBlueprint
The rectangle the tool's text and falloff plot covered in the last HUD draw, canvas pixels; invalid when nothing was drawn.
- SetBrushMaskBlueprint
Make a baked brush asset the tool brush: register its mask with the terrain, name it in the brush, take the asset's default angle, radius and aspect, and switch to Spacing steps (a patterned mask is laid evenly).
- SetBrushAngleBlueprint
Set the mask base angle, degrees from +X toward +Y; the rotation mode adds to it.
- SetRotationModeBlueprint
Set how each dab turns the mask.
- SetSpacingBlueprint
Lay dabs by distance: one each time the pointer has moved Fraction of the radius.
- StampAtBlueprint
Stamp the brush once at a place, as a one-dab stroke (one undo).
- SetSplatBrushBlueprint
Make a baked splat asset the tool's splat: register its channel masks with the terrain, keep the splat for SplatAt and for drags (the sculpt component lays it at every stroke step), and take the asset's default angle and radius.
- GetSplatBrushBlueprint
The splat SetSplatBrush set; empty when none.
- SplatAtBlueprint
Lay the splat once at a place, as a one-dab stroke (one undo): up to four masked Paint steps, red to alpha.
- IsHudSuppressedBystatic
Whether a command line asks for a HUD-free picture: it holds -SampleShots, bare or as -SampleShots=path (the form the sample director passes).
- IsHudHiddenBlueprint
Whether the tool draws nothing now: bShowHUD is off, or the process runs with -SampleShots.
- GetToolStateBlueprint
A snapshot of the tool for a HUD of your own.
- GetHUDLinesBlueprint
The HUD text, one entry per line, as the default HUD shows it.
- DrawToolHUDBlueprint
Draws the HUD text and the cursor ring on the player's canvas, once per frame while the tool is active.
Properties
| Name | Type | Default | Meaning |
|---|---|---|---|
bBlueprintReadWrite | bool | true | Activate the tool in BeginPlay. |
CursorBlueprintReadWrite | EOrbdale | EOrbdale | Where the cursor comes from; copied to the sculpt component when the tool activates. |
InitialBlueprintReadWrite | double | 2000.0 | Brush radius a freshly added sculpt component starts with, cm. |
InitialBlueprintReadWrite | double | 20.0 | Brush strength a freshly added sculpt component starts with, cm per step. |
BrushBlueprintReadWrite | TArray< | — | 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. |
PaintBlueprintReadWrite | TArray< | — | 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). |
RadiusBlueprintReadWrite | float | 1.25f | One radius step of the radius actions: the radius is multiplied (up) or divided (down) by this. |
StrengthBlueprintReadWrite | float | 1.25f | One strength step of the strength actions: the strength is multiplied (up) or divided (down) by this. |
FalloffBlueprintReadWrite | float | 0.1f | One step of the falloff start actions (Shift+] and Shift+[), as a fraction of the radius. |
FlattenBlueprintReadWrite | float | 0.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. |
MappingBlueprintReadWrite | TObject | — | The mapping context added to the local player while the tool is active. |
MappingBlueprintReadWrite | int32 | 10 | Priority of MappingContext. |
StrokeBlueprintReadWrite | TObject | — | Boolean: press opens a stroke at the cursor, release closes it. |
RadiusBlueprintReadWrite | TObject | — | — |
RadiusBlueprintReadWrite | TObject | — | — |
StrengthBlueprintReadWrite | TObject | — | — |
StrengthBlueprintReadWrite | TObject | — | — |
CycleBlueprintReadWrite | TObject | — | — |
CycleBlueprintReadWrite | TObject | — | — |
CycleBlueprintReadWrite | TObject | — | Boolean: press steps the falloff shape (Smooth, Linear, Constant). |
FalloffBlueprintReadWrite | TObject | — | Boolean: press widens the full-strength core by FalloffStartStep (default Shift+], a chord on IA_TerrainBrush_Shift). |
FalloffBlueprintReadWrite | TObject | — | Boolean: press narrows the full-strength core by FalloffStartStep (default Shift+[). |
UndoBlueprintReadWrite | TObject | — | — |
RedoBlueprintReadWrite | TObject | — | — |
bBlueprintReadWrite | bool | true | 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. |
bBlueprintReadWrite | bool | true | Draw the cursor ring while the tool is active and the cursor is over ground. |
HUDOriginBlueprintReadWrite | FVector2 | FVector2 | Top-left corner of the HUD text, pixels. |
HUDTextBlueprintReadWrite | float | 1.5f | Text scale of the HUD. |
HUDColorBlueprintReadWrite | FLinear | FLinear | — |
HUDBackgroundBlueprintReadWrite | FLinear | FLinear | — |
RingBlueprintReadWrite | FLinear | FLinear | Ring colour while idle. |
RingBlueprintReadWrite | FLinear | FLinear | Ring colour while a stroke is open. |
FalloffBlueprintReadWrite | TArray< | — | 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. |
bBlueprintReadWrite | bool | true | Draw the falloff profile plot (strength against distance) under the HUD text. |
FalloffBlueprintReadWrite | FVector2 | FVector2 | Size of the falloff profile plot, pixels. |
RingBlueprintReadWrite | int32 | 64 | 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). |
RingBlueprintReadWrite | float | 2.f | Ring line width, pixels. |
HintBlueprintReadWrite | FText | — | Last HUD line: the default key hints. Empty hides it. |
Blueprint
- Begin StrokeOrbdale › Terrain › Tool
- Cycle Brush KindOrbdale › Terrain › Tool
- Cycle FalloffOrbdale › Terrain › Tool
- Cycle Paint LayerOrbdale › Terrain › Tool
- Event DrawToolHUDOrbdale › Terrain › Tool
- End StrokeOrbdale › Terrain › Tool
- Get HUDLinesOrbdale › Terrain › Tool
- Get Hud RectOrbdale › Terrain › Tool
- Get Sculpt ComponentOrbdale › Terrain › Tool
- Get Splat BrushOrbdale › Terrain › Tool › Brush
- Get Tool StateOrbdale › Terrain › Tool
- Is Hud HiddenOrbdale › Terrain › Tool › HUD
- Is Pointer BlockedOrbdale › Terrain › Tool
- Is Scripted Stroke RunningOrbdale › Terrain › Tool
- Is Tool ActiveOrbdale › Terrain › Tool
- RedoOrbdale › Terrain › Tool
- Scale RadiusOrbdale › Terrain › Tool
- Scale StrengthOrbdale › Terrain › Tool
- Set Brush AngleOrbdale › Terrain › Tool › Brush
- Set Brush KindOrbdale › Terrain › Tool
- Set Brush MaskOrbdale › Terrain › Tool › Brush
- Set FalloffOrbdale › Terrain › Tool
- Set Falloff StartOrbdale › Terrain › Tool
- Set Paint LayerOrbdale › Terrain › Tool
- Set Pointer BlockedOrbdale › Terrain › Tool
- Set Rotation ModeOrbdale › Terrain › Tool › Brush
- Set SpacingOrbdale › Terrain › Tool › Brush
- Set Splat BrushOrbdale › Terrain › Tool › Brush
- Set Tool ActiveOrbdale › Terrain › Tool
- Splat AtOrbdale › Terrain › Tool › Brush
- Stamp AtOrbdale › Terrain › Tool › Brush
- Start Scripted StrokeOrbdale › Terrain › Tool
- Step Falloff StartOrbdale › Terrain › Tool
- UndoOrbdale › Terrain › Tool