Skip to content

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 ​

voidinitialize() static
voidrefresh_database() static
voidensure_initialized() static
Array[String]get_all_skeleton_names() static
Dictionaryget_skeleton_data( scene_name: String ) static
PackedSceneget_skeleton_scene( scene_name: String ) static
Stringget_skeleton_path( scene_name: String ) static
Stringget_skeleton_display_name( scene_name: String ) static
boolhas_skeleton( scene_name: String ) static
Array[Dictionary]get_skeletons_for_list() static
Array[String]search_skeletons( search_text: String ) static
intget_skeleton_count() static
Nodeinstantiate_skeleton( scene_name: String ) static
Array[String]get_all_interactable_model_names() static
Dictionaryget_interactable_model_data( scene_name: String ) static
Array[Dictionary]get_interactable_models_for_list() static
PackedSceneget_interactable_model_scene( scene_name: String ) static
Stringget_interactable_model_path( scene_name: String ) static
Stringget_interactable_model_display_name( scene_name: String ) static
boolhas_interactable_model( scene_name: String ) static
Array[String]search_interactable_models( search_text: String ) static
intget_interactable_model_count() static
Nodeinstantiate_interactable_model( scene_name: String ) static
Array[String]get_mesh_skeleton_types( mesh_path: String ) static
boolset_mesh_skeleton_types( mesh_path: String, skeleton_types: Array[String] ) static
booldoes_mesh_support_skeleton_type( mesh_path: String, skeleton_type: String ) static
Array[Dictionary]get_meshes_for_skeleton_type( skeleton_type: String ) static
Dictionaryget_database_stats() static
Array[Dictionary]validate_database() static
boolis_database_empty() static
Dictionaryget_skeleton_health_check() static

Constants ​

  • String SKELETONS_PATH = "res://src/data/meshes/skeletons/" - ========== PATHS ==========
  • String INTERACTABLE_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.
  • Dictionary SKELETON_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