ModelSceneDatabase ​
Inherits: RefCounted
The library of model scenes, read from res://src/data/meshes/skeletons/ (the scenes of characters and creatures) and res://src/data/meshes/interactable_models/ (the scenes of interactable objects).
Description ​
Every .tscn file in those folders is an entry, named by its file name. For a skeleton scene the database instantiates it once to find out what kind of skeleton it holds (GeneralSkeleton or ModularSkeleton). The folders are scanned once on first use; call refresh_database after adding scenes.
Methods ​
void | initialize() static |
void | refresh_database() static |
void | ensure_initialized() static |
Array[String] | get_all_skeleton_names() static |
Dictionary | get_skeleton_data( scene_name: String ) static |
PackedScene | get_skeleton_scene( scene_name: String ) static |
String | get_skeleton_path( scene_name: String ) static |
String | get_skeleton_display_name( scene_name: String ) static |
bool | has_skeleton( scene_name: String ) static |
Array[Dictionary] | get_skeletons_for_list() static |
Array[String] | search_skeletons( search_text: String ) static |
int | get_skeleton_count() static |
Node | instantiate_skeleton( scene_name: String ) static |
Array[String] | get_all_interactable_model_names() static |
Dictionary | get_interactable_model_data( scene_name: String ) static |
Array[Dictionary] | get_interactable_models_for_list() static |
PackedScene | get_interactable_model_scene( scene_name: String ) static |
String | get_interactable_model_path( scene_name: String ) static |
String | get_interactable_model_display_name( scene_name: String ) static |
bool | has_interactable_model( scene_name: String ) static |
Array[String] | search_interactable_models( search_text: String ) static |
int | get_interactable_model_count() static |
Node | instantiate_interactable_model( scene_name: String ) static |
Array[String] | get_mesh_skeleton_types( mesh_path: String ) static |
bool | set_mesh_skeleton_types( mesh_path: String, skeleton_types: Array[String] ) static |
bool | does_mesh_support_skeleton_type( mesh_path: String, skeleton_type: String ) static |
Array[Dictionary] | get_meshes_for_skeleton_type( skeleton_type: String ) static |
Dictionary | get_database_stats() static |
Array[Dictionary] | validate_database() static |
bool | is_database_empty() static |
Dictionary | get_skeleton_health_check() static |
Constants ​
StringSKELETONS_PATH ="res://src/data/meshes/skeletons/"- ========== PATHS ==========StringINTERACTABLE_MODELS_PATH ="res://src/data/meshes/interactable_models/"- The folder of the model scenes of objects.Array[String]SKELETON_EXTENSIONS =[".tscn"]- ========== FILE EXTENSIONS ==========Array[String]INTERACTABLE_MODEL_EXTENSIONS =[".tscn"]- The file types that count as model scenes.DictionarySKELETON_TYPE_MAPPING ={- ========== SKELETON TYPE MAPPING ==========
Method descriptions ​
void initialize() ​
Initialize the model scene database by scanning all files
void refresh_database() ​
Force refresh of the entire database (useful for development)
void ensure_initialized() ​
Ensure database is initialized before any operation (private)
Array[String] get_all_skeleton_names() ​
Get all available skeleton scene names (not skeleton types)
Dictionary get_skeleton_data( scene_name: String ) ​
Get skeleton data by scene name
PackedScene get_skeleton_scene( scene_name: String ) ​
Get skeleton scene by scene name
String get_skeleton_path( scene_name: String ) ​
Get skeleton file path by scene name
String get_skeleton_display_name( scene_name: String ) ​
Get skeleton display name by scene name
bool has_skeleton( scene_name: String ) ​
Check if skeleton scene exists
Array[Dictionary] get_skeletons_for_list() ​
Get all skeleton scenes data for list display
Array[String] search_skeletons( search_text: String ) ​
Search skeleton scenes by name pattern
int get_skeleton_count() ​
Get skeleton count
Node instantiate_skeleton( scene_name: String ) ​
Instantiate a skeleton scene by scene name
Array[String] get_all_interactable_model_names() ​
Get all available interactable model scene names
Dictionary get_interactable_model_data( scene_name: String ) ​
Get interactable model data by scene name
Array[Dictionary] get_interactable_models_for_list() ​
Get all interactable model scenes data for list display
PackedScene get_interactable_model_scene( scene_name: String ) ​
Get interactable model scene by scene name
String get_interactable_model_path( scene_name: String ) ​
Get interactable model file path by scene name
String get_interactable_model_display_name( scene_name: String ) ​
Get interactable model display name by scene name
bool has_interactable_model( scene_name: String ) ​
Check if interactable model scene exists
Array[String] search_interactable_models( search_text: String ) ​
Search interactable model scenes by name pattern
int get_interactable_model_count() ​
Get interactable model count
Node instantiate_interactable_model( scene_name: String ) ​
Instantiate an interactable model scene by scene name
Array[String] get_mesh_skeleton_types( mesh_path: String ) ​
Get skeleton types that support a specific mesh
bool set_mesh_skeleton_types( mesh_path: String, skeleton_types: Array[String] ) ​
Set which skeleton types support a specific mesh
bool does_mesh_support_skeleton_type( mesh_path: String, skeleton_type: String ) ​
Check if a mesh supports a specific skeleton type
Array[Dictionary] get_meshes_for_skeleton_type( skeleton_type: String ) ​
Get meshes compatible with a specific skeleton type
Dictionary get_database_stats() ​
Get database statistics
Array[Dictionary] validate_database() ​
Validate database (check for issues)
bool is_database_empty() ​
Check if database is empty
Dictionary get_skeleton_health_check() ​
Get all skeletons with their instantiation status