Skip to content

TerrainBrush

Extends: Tool < Object

Description

The tool used to edit the terrain. Mostly to mod the Terrain Tool. To draw on the Terrain, use World.Level.Terrain.Paint() instead.

Accessed by Global.Editor.Tools["TerrainBrush"].

Properties

bool Enabled
float BrushRadius
bool IsPainting
int TerrainID
bool SmoothBlending
float Size
float Intensity
Image brush
Image previousSplat
Image previousSplat2
ItemList terrainList
VBoxContainer terrainButtonBox
bool extendedTerrainTypes

Methods

void SetBiome ( int index )
void SetSize ( float value )
void SetSmoothBlending ( bool enabled )
void SetTextureFromWindow ( Texture texture, int listIndex )
void UpdateBrush ( )
float GetBrushRadius ( )
void Fill ( )
void ExpandSlots ( bool value )
void SetControlsForExpandedSlots ( bool value )

Property Descriptions

  • bool Enabled:
    Gets if the tool is enabled by the user.

  • float BrushRadius:
    Gets the brush radius in canvas unit size.

  • bool IsPainting:
    Gets if the user is currently painting.

  • int TerrainID:
    Get or set the terrain being painted by slot order.

  • bool SmoothBlending:
    Get if the brush is smooth. Call SetSmoothBlending() to set instead.

  • float Size:
    Get or set the size of the brush.

  • float Intensity:
    Get or set the intensity of the brush.

  • Image brush:
    The Godot Image of the current brush style.

  • Image previousSplat:
    The previous version of the splatmap of the Terrain. Used for undo history.

  • Image previousSplat2:
    The previous version of the 2nd splatmap needed when slots are expanded to 8. Used for undo history.

  • ItemList terrainList:
    The UI Control that contains the current set of textures available.

  • VBoxContainer terrainButtonBox:
    The UI Control that contains all the terrain selection buttons.

  • bool extendedTerrainTypes:
    Gets whether or not the user has selected to expand terrain slots.

Method Descriptions

  • void SetBiome ( int index ):
    Selects a Terrain to paint based on the index of the texture list.

  • void SetSize ( float value ):
    Change the brush size. Calls UpdateBrush() automatically.

  • void SetSmoothBlending ( bool enabled ):
    Toggles if the terrain is using texured blending or smooth blending.


  • void UpdateBrush ( ):
    Call to update the brush once Size is set.


  • void Fill ( ):
    Fill the terrain with the selected terrain texture.