Skip to content

TerrainTextureEditor ​

Inherits: ResourceEditor < Control

The Terrain Textures editor (the TerrainTextureDefinition database): the library a terrain is painted from. A texture has its textures (albedo, normal, roughness), how big one repeat is on the ground, the surface type footsteps use, and how the weather changes it. See docs: World > Terrain Textures.

Description ​

Files can be dragged from the FileSystem dock onto the Albedo, Normal, Roughness, Height, Emission and Subsurface buttons (one file each), or several at once onto the Texture maps section or any of the buttons: they are sorted by the words in their names (albedo, basecolor, diffuse, color / normal, nrm / orm, arm / roughness / height, displacement, bump / emission, emissive / sss, subsurface), so the maps of a material exported from Material Maker, Substance or ambientCG land where they belong. A file with orm in its name turns on "Roughness texture is ORM".

Variables ​

TerrainTextureDefinition:current_texture
LineEditlibrary_search
Buttonlibrary_refresh
Labellibrary_status
Treelibrary_tree
HBoxContainersource_row
Labelsource_label
Buttonsource_show_button
Buttonsource_reload_button
Buttonsource_delete_button
Dictionarydetile_boxes{} # (DetileSlider)
TerrainDetilePreviewdetile_preview
Dictionarysections{}

Methods ​

voidrefresh_library()
PackedStringArraydropped_paths( data: Variant ) static
StringNameclassify_file( path: String ) static
Array[StringName]drop_files( paths: PackedStringArray, slot: StringName )

Constants ​

  • PackedStringArray IMAGE_EXTENSIONS = TerrainTextureFiles.IMAGE_EXTENSIONS

Variable descriptions ​

TerrainTextureDefinition: current_texture ​

No description yet.

No description yet.

Button library_refresh ​

No description yet.

Label library_status ​

No description yet.

Tree library_tree ​

No description yet.

HBoxContainer source_row ​

No description yet.

Label source_label ​

No description yet.

Button source_show_button ​

No description yet.

Button source_reload_button ​

No description yet.

Button source_delete_button ​

No description yet.

Dictionary detile_boxes = # (DetileSlider) ​

The rows of the Detiling numbers of a texture (made in code under the Anti-tiling check box): property name -> its box

TerrainDetilePreview detile_preview ​

The preview of the detiling (under the numbers)

Dictionary sections = ​

The sub sections of the textures part of the editor (name -> the section), made in code from the rows of the scene

Method descriptions ​

void refresh_library() ​

Looks for new, changed and missing folders (making the entries they need) and shows the tree again.

PackedStringArray dropped_paths( data: Variant ) ​

The texture files in what was dragged (the FileSystem dock gives {"type": "files", "files": [paths]}): only picture files.

StringName classify_file( path: String ) ​

Which map a file is, from the words in its name: &"albedo", &"normal", &"orm", &"height", &"roughness" or &"" when the name says nothing.

Array[StringName] drop_files( paths: PackedStringArray, slot: StringName ) ​

Puts dropped files in the texture: one file goes to the slot it was dropped on (slot &"" = the section: by its name); several go where their names say. An ORM file turns on "Roughness texture is ORM". Returns the slots that were set, in the order they were set.