unreal.Paths
¶
- class unreal.Paths(outer=None, name='None')¶
Bases:
unreal.BlueprintFunctionLibrary
Function library to expose FPaths to Blueprints and Python
Function signatures are preserved for the most part with adjustments made to some signatures to better match Blueprints / Python workflow
C++ Source:
Module: Engine
File: BlueprintPathsLibrary.h
- classmethod automation_dir() → str¶
Returns the directory for automation save files
- Returns
- Return type
- classmethod automation_log_dir() → str¶
Returns the directory for automation log files
- Returns
- Return type
- classmethod automation_transient_dir() → str¶
Returns the directory for automation save files that are meant to be deleted every run
- Returns
- Return type
- classmethod bug_it_dir() → str¶
Returns the directory the engine uses to output BugIt files.
- Returns
screenshot directory
- Return type
- classmethod change_extension(path, new_extension) → str¶
Changes the extension of the given filename (does nothing if the file has no extension)
- classmethod cloud_dir() → str¶
Returns the directory for local files used in cloud emulation or support
- Returns
- Return type
- classmethod collapse_relative_directories(path) → str or None¶
Takes a fully pathed string and eliminates relative pathing (eg: annihilates “..” with the adjacent directory). Assumes all slashes have been converted to TEXT(‘/’). For example, takes the string:
BaseDirectory/SomeDirectory/../SomeOtherDirectory/Filename.ext
- and converts it to:
BaseDirectory/SomeOtherDirectory/Filename.ext
- classmethod convert_from_sandbox_path(path, sandbox_name) → str¶
Converts a sandbox (in Saved/Sandboxes) path to a normal path.
- classmethod convert_relative_path_to_full(path, base_path='') → str¶
Converts a relative path name to a fully qualified name relative to the specified BasePath. BasePath will be the process BaseDir() if not BasePath is given
- classmethod convert_to_sandbox_path(path, sandbox_name) → str¶
Converts a normal path to a sandbox path (in Saved/Sandboxes).
- classmethod create_temp_filename(path, prefix='', extension='.tmp') → str¶
Creates a temporary filename with the specified prefix.
- classmethod diff_dir() → str¶
Returns the directory for temp files used for diffing
- Returns
- Return type
- classmethod directory_exists(path) → bool¶
Returns true if this directory was found, false otherwise
- classmethod engine_config_dir() → str¶
Returns the directory the root configuration files are located.
- Returns
root config directory
- Return type
- classmethod engine_content_dir() → str¶
Returns the content directory of the “core” engine that can be shared across several games or across games & mods.
- Returns
engine content directory
- Return type
- classmethod engine_dir() → str¶
Returns the base directory of the “core” engine that can be shared across several games or across games & mods. Shaders and base localization files e.g. reside in the engine directory.
- Returns
engine directory
- Return type
- classmethod engine_intermediate_dir() → str¶
Returns the intermediate directory of the engine
- Returns
content directory
- Return type
- classmethod engine_plugins_dir() → str¶
Returns the plugins directory of the engine
- Returns
Plugins directory.
- Return type
- classmethod engine_saved_dir() → str¶
Returns the saved directory of the engine
- Returns
Saved directory.
- Return type
- classmethod engine_source_dir() → str¶
Returns the directory where engine source code files are kept
- Returns
- Return type
- classmethod engine_user_dir() → str¶
Returns the root directory for user-specific engine files. Always writable.
- Returns
root user directory
- Return type
- classmethod engine_version_agnostic_user_dir() → str¶
Returns the root directory for user-specific engine files which can be shared between versions. Always writable.
- Returns
root user directory
- Return type
- classmethod enterprise_dir() → str¶
Returns the base directory enterprise directory.
- Returns
enterprise directory
- Return type
- classmethod enterprise_feature_pack_dir() → str¶
Returns the enterprise FeaturePack directory
- Returns
FeaturePack directory.
- Return type
- classmethod enterprise_plugins_dir() → str¶
Returns the enterprise plugins directory
- Returns
Plugins directory.
- Return type
- classmethod feature_pack_dir() → str¶
Returns the directory where feature packs are kept
- Returns
- Return type
- classmethod game_agnostic_saved_dir() → str¶
Returns the saved directory that is not game specific. This is usually the same as EngineSavedDir().
- Returns
saved directory
- Return type
- classmethod game_developers_dir() → str¶
Returns the directory that contains subfolders for developer-specific content
- Returns
- Return type
- classmethod game_source_dir() → str¶
Returns the directory where game source code files are kept
- Returns
- Return type
- classmethod game_user_developer_dir() → str¶
Returns the directory that contains developer-specific content for the current user
- Returns
- Return type
- classmethod generated_config_dir() → str¶
Returns the directory the engine saves generated config files.
- Returns
config directory
- Return type
- classmethod get_base_filename(path, remove_path=True) → str¶
Returns the same thing as GetCleanFilename, but without the extension
- classmethod get_clean_filename(path) → str¶
Returns the filename (with extension), minus any path information.
- classmethod get_editor_localization_paths()¶
Returns a list of editor-specific localization paths
- classmethod get_engine_localization_paths()¶
Returns a list of engine-specific localization paths
- classmethod get_game_localization_paths()¶
Returns a list of game-specific localization paths
- classmethod get_invalid_file_system_chars() → str¶
Returns a string containing all invalid characters as dictated by the operating system
- Returns
- Return type
- classmethod get_project_file_path() → str¶
Gets the path to the project file.
- Returns
Project file path.
- Return type
- classmethod get_property_name_localization_paths()¶
Returns a list of property name localization paths
- classmethod get_relative_path_to_root() → str¶
Gets the relative path to get from BaseDir to RootDirectory
- Returns
- Return type
- classmethod get_restricted_folder_names()¶
Returns a list of restricted/internal folder names (without any slashes) which may be tested against full paths to determine if a path is restricted or not.
- classmethod get_tool_tip_localization_paths()¶
Returns a list of tool tip localization paths
- classmethod has_project_persistent_download_dir() → bool¶
Returns true if a writable directory for downloaded data that persists across play sessions is available
- Returns
- Return type
- classmethod is_project_file_path_set() → bool¶
Checks whether the path to the project file, if any, is set.
- Returns
true if the path is set, false otherwise.
- Return type
- classmethod is_restricted_path(path) → bool¶
Determines if supplied path uses a restricted/internal subdirectory. Note that slashes are normalized and character case is ignored for the comparison.
- classmethod launch_dir() → str¶
Returns the directory the application was launched from (useful for commandline utilities)
- Returns
- Return type
- classmethod make_path_relative_to(path, relative_to) → str or None¶
Assuming both paths (or filenames) are relative to the same base dir, converts InPath to be relative to InRelativeTo
- classmethod make_platform_filename(path) → str¶
Takes an “Unreal” pathname and converts it to a platform filename.
- classmethod make_standard_filename(path) → str¶
- Make fully standard “Unreal” pathname:
Normalizes path separators [NormalizeFilename]
Removes extraneous separators [NormalizeDirectoryName, as well removing adjacent separators]
Collapses internal ..’s
Makes relative to EngineBinaries<Platform> (will ALWAYS start with ......)
- classmethod make_valid_file_name(string, replacement_char='') → str¶
Returns a string that is safe to use as a filename because all items in GetInvalidFileSystemChars() are removed
Optionally specify the character to replace invalid characters with
- classmethod normalize_directory_name(path) → str¶
Normalize all / and to TEXT(“/”) and remove any trailing TEXT(“/”) if the character before that is not a TEXT(“/”) or a colon
- classmethod profiling_dir() → str¶
Returns the directory the engine uses to output profiling files.
- Returns
log directory
- Return type
- classmethod project_config_dir() → str¶
Returns the directory the root configuration files are located.
- Returns
root config directory
- Return type
- classmethod project_content_dir() → str¶
Returns the content directory of the current game by looking at FApp::GetProjectName().
- Returns
content directory
- Return type
- classmethod project_dir() → str¶
Returns the base directory of the current project by looking at FApp::GetProjectName(). This is usually a subdirectory of the installation root directory and can be overridden on the command line to allow self contained mod support.
- Returns
base directory
- Return type
- classmethod project_intermediate_dir() → str¶
Returns the intermediate directory of the current game by looking at FApp::GetProjectName().
- Returns
intermediate directory
- Return type
- classmethod project_log_dir() → str¶
Returns the directory the engine uses to output logs. This currently can’t be an .ini setting as the game starts logging before it can read from .ini files.
- Returns
log directory
- Return type
- classmethod project_mods_dir() → str¶
Returns the mods directory of the current project by looking at FApp::GetProjectName().
- Returns
mods directory
- Return type
- classmethod project_persistent_download_dir() → str¶
Returns the writable directory for downloaded data that persists across play sessions.
- Returns
- Return type
- classmethod project_plugins_dir() → str¶
Returns the plugins directory of the current game by looking at FApp::GetProjectName().
- Returns
plugins directory
- Return type
- classmethod project_saved_dir() → str¶
Returns the saved directory of the current game by looking at FApp::GetProjectName().
- Returns
saved directory
- Return type
- classmethod project_user_dir() → str¶
Returns the root directory for user-specific game files.
- Returns
game user directory
- Return type
- classmethod remove_duplicate_slashes(path) → str¶
Removes duplicate slashes in paths. Assumes all slashes have been converted to TEXT(‘/’). For example, takes the string:
BaseDirectory/SomeDirectory//SomeOtherDirectory////Filename.ext
- and converts it to:
BaseDirectory/SomeDirectory/SomeOtherDirectory/Filename.ext
- classmethod root_dir() → str¶
Returns the root directory of the engine directory tree
- Returns
Root directory.
- Return type
- classmethod sandboxes_dir() → str¶
Returns the directory the engine stores sandbox output
- Returns
sandbox directory
- Return type
- classmethod screen_shot_dir() → str¶
Returns the directory the engine uses to output screenshot files.
- Returns
screenshot directory
- Return type
- classmethod set_extension(path, new_extension) → str¶
Sets the extension of the given filename (like ChangeExtension, but also applies the extension if the file doesn’t have one)
- classmethod set_project_file_path(new_game_project_file_path) → None¶
Sets the path to the project file.
- Parameters
new_game_project_file_path (str) – The project file path to set.
- classmethod shader_working_dir() → str¶
Returns the Shader Working Directory
- Returns
shader working directory
- Return type
- classmethod should_save_to_user_dir() → bool¶
Should the “saved” directory structures be rooted in the user dir or relative to the “engine/game”
- Returns
- Return type
- classmethod source_config_dir() → str¶
Returns the directory the engine uses to look for the source leaf ini files. This can’t be an .ini variable for obvious reasons.
- Returns
source config directory
- Return type
- classmethod split(path) -> (path_part=str, filename_part=str, extension_part=str)¶
Parses a fully qualified or relative filename into its components (filename, path, extension).
- Parameters
path (str) –
- Returns
path_part (str):
filename_part (str):
extension_part (str):
- Return type
tuple
- classmethod validate_path(path) -> (did_succeed=bool, out_reason=Text)¶
Validates that the parts that make up the path contain no invalid characters as dictated by the operating system Note that this is a different set of restrictions to those imposed by FPackageName
- Parameters
path (str) – path to validate
- Returns
did_succeed (bool): Whether the path could be validated
out_reason (Text): If validation fails, this is filled with the failure reason
- Return type
tuple