Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
EditorPaths¶
Inherits: Object
Editor-only singleton that returns paths to various OS-specific data folders and files.
Description¶
This editor-only singleton returns OS-specific paths to various data folders and files. It can be used in editor plugins to ensure files are saved in the correct location on each operating system.
Note: This singleton is not accessible in exported projects. Attempting to access it in an exported project will result in a script error as the singleton won't be declared. To prevent script errors in exported projects, use Engine.has_singleton to check whether the singleton is available before using it.
Note: On the Linux/BSD platform, Godot complies with the XDG Base Directory Specification. You can override environment variables following the specification to change the editor and project data paths.
Tutorials¶
Methods¶
get_cache_dir ( ) const |
|
get_config_dir ( ) const |
|
get_data_dir ( ) const |
|
get_project_settings_dir ( ) const |
|
get_self_contained_file ( ) const |
|
is_self_contained ( ) const |
Method Descriptions¶
String get_cache_dir ( ) const
Returns the absolute path to the user's cache folder. This folder should be used for temporary data that can be removed safely whenever the editor is closed (such as generated resource thumbnails).
Default paths per platform:
- Windows: %LOCALAPPDATA%\Godot\
- macOS: ~/Library/Caches/Godot/
- Linux: ~/.cache/godot/
String get_config_dir ( ) const
Returns the absolute path to the user's configuration folder. This folder should be used for persistent user configuration files.
Default paths per platform:
- Windows: %APPDATA%\Godot\ (same as `get_data_dir()`)
- macOS: ~/Library/Application Support/Godot/ (same as `get_data_dir()`)
- Linux: ~/.config/godot/
String get_data_dir ( ) const
Returns the absolute path to the user's data folder. This folder should be used for persistent user data files such as installed export templates.
Default paths per platform:
- Windows: %APPDATA%\Godot\ (same as `get_config_dir()`)
- macOS: ~/Library/Application Support/Godot/ (same as `get_config_dir()`)
- Linux: ~/.local/share/godot/
String get_project_settings_dir ( ) const
Returns the project-specific editor settings path. Projects all have a unique subdirectory inside the settings path where project-specific editor settings are saved.
String get_self_contained_file ( ) const
Returns the absolute path to the self-contained file that makes the current Godot editor instance be considered as self-contained. Returns an empty string if the current Godot editor instance isn't self-contained. See also is_self_contained.
bool is_se