WorldAssetsEditor ​
Inherits: VBoxContainer
The World Assets tab (Assets > World Assets): the scenes of res://src/data/world_assets/ that the Assets button of the placement tool puts in the world (houses, trees, props) as a list with a picture of each, a category list (a category is a folder; New category makes one), Import (copies scenes and models into a category) and a 3D preview of the selected scene you can turn around. The scenes of the Foliage tab (the foliage and the ground scatter the terrain paints) are listed too, in categories of their own: you can look at them here, and they are made and changed in the Foliage tab. See docs: Assets > World Assets.
Variables ​
Array[Dictionary] | entries | [] |
Array[Dictionary] | shown | [] |
String | current_category | ALL_CATEGORIES |
String | selected_path | "" |
Methods ​
void | refresh() |
Array[String] | get_categories() |
void | select_path( path: String ) |
String | category_folder( category: String ) |
String | folder_name_of( text: String ) static |
String | make_category( text: String ) |
int | import_files( paths: PackedStringArray, category: String ) |
Constants ​
StringFOLIAGE_FOLDER =PlacementKinds.FOLIAGE_FOLDER- The folders of the foliage library: what the terrain tool scatters (shown here, not changed here)StringSCATTER_FOLDER ="res://src/data/worlds/foliage/ground_scatter/"StringFOLIAGE_CATEGORY ="Foliage (Foliage tab)"- The names of the categories that show the foliage libraryStringSCATTER_CATEGORY ="Ground scatter (Foliage tab)"StringALL_CATEGORIES ="All categories"- The category that shows everythingPackedStringArraySCATTER_EXTENSIONS =["glb", "gltf", "fbx", "obj", "blend", "res", "tres"]PackedStringArraySCENE_EXTENSIONS =["tscn", "scn", "glb", "gltf", "fbx", "blend"]
Variable descriptions ​
Array[Dictionary] entries = [] ​
Every scene listed: [{path, category, name, kind}] (kind: "asset", "foliage" or "scatter")
Array[Dictionary] shown = [] ​
The entries the search and the category show
String current_category = ALL_CATEGORIES ​
The category that is chosen (ALL_CATEGORIES for all)
String selected_path = "" ​
No description yet.
Method descriptions ​
void refresh() ​
Reads the folders again: the scenes, the categories, the pictures
Array[String] get_categories() ​
All the categories (the folders of the asset folder, empty ones too) and the two of the foliage library, in the list
void select_path( path: String ) ​
Shows a scene: the preview, its name, category and file, and the buttons
String category_folder( category: String ) ​
The folder of a category of the asset folder ("trees" -> .../world_assets/trees/; "Uncategorised" or all -> the folder itself)
String folder_name_of( text: String ) ​
A name for a folder: lower case, words joined by underscores, a slash for a category in a category ("Buildings/Ruins" -> "buildings/ruins")
String make_category( text: String ) ​
Makes a category (a folder of the asset folder). Gives its name in the list, or "" when the name is empty or the folder cannot be made
int import_files( paths: PackedStringArray, category: String ) ​
Copies scenes and models into a category (a file with the name of one that is there gets a number). Gives how many it copied