Terrain3DEditor

Inherits: Object

Description

This class handles all of the sculpting and painting operations for Terrain3D.

Methods

void

apply_undo(data: Dictionary)

void

backup_region(region: Terrain3DRegion)

Operation

get_operation() const

Terrain3D

get_terrain() const

Tool

get_tool() const

bool

is_operating() const

void

operate(position: Vector3, camera_direction: float)

void

set_brush_data(data: Dictionary)

void

set_operation(operation: Operation)

void

set_terrain(terrain: Terrain3D)

void

set_tool(tool: Tool)

void

start_operation(position: Vector3)

void

stop_operation()


Enumerations

enum Operation: 🔗

Operation ADD = 0

Additive operations.

Operation SUBTRACT = 1

Subtractive operations.

Operation REPLACE = 2

Replacing operations.

Operation AVERAGE = 3

Averaging operations.

Operation GRADIENT = 4

Gradient operations.

Operation OP_MAX = 5

The number of elements in this enum.


enum Tool: 🔗

Tool SCULPT = 1

There is currently no description for this enum. Please help us by contributing one!

Tool HEIGHT = 2

Sculpt heights.

Tool TEXTURE = 3

Paint textures.

Tool COLOR = 4

Paint on the color map.

Tool ROUGHNESS = 5

Paint a roughness modifier, aka wetness.

Tool ANGLE = 10

Paint textures rotated by an angle.

Tool SCALE = 11

Paint textures scaled by a value.

Tool AUTOSHADER = 6

Paint where the shader automatically textures.

Tool HOLES = 7

Paint where vertices will be invalidated to leave holes.

Tool NAVIGATION = 8

Paint where navigation will be generated.

Tool INSTANCER = 9

Paint MultiMesh instances on the ground.

Tool REGION = 0

Add/remove regions.

Tool TOOL_MAX = 12

The number of elements in this enum.


Method Descriptions

void apply_undo(data: Dictionary) 🔗

Undo the previous changes, with the provided data. Used by Godot, not gamedevs.


void backup_region(region: Terrain3DRegion) 🔗

Adds a region to the currently pending operation undo snapshot. is_operating() must be true.


Operation get_operation() const 🔗

Returns the current selected tool operation (eg. add, subtract).


Terrain3D get_terrain() const 🔗

Returns the instance of Terrain3D this class is conneced to.


Tool get_tool() const 🔗

Returns the current tool selected in the editor plugin.


bool is_operating() const 🔗

Returns true if currently in the middle of a brushing operation.


void operate(position: Vector3, camera_direction: float) 🔗

Start brushing.


void set_brush_data(data: Dictionary) 🔗

Sets all brush settings used in the editor plugin.


void set_operation(operation: Operation) 🔗

Sets the tool operation used in the editor plugin.


void set_terrain(terrain: Terrain3D) 🔗

Sets the instance of Terrain3D this class is connected to.


void set_tool(tool: Tool) 🔗

Sets the tool selected in the editor plugin.


void start_operation(position: Vector3) 🔗

Begin a sculpting or painting operation. Prepares to create an undo/redo commit.


void stop_operation() 🔗

End a sculpting or painting operation. Commits any regions marked with Terrain3DRegion.edited in the undo/redo system and clears that flag.