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

str

classmethod automation_log_dir()str

Returns the directory for automation log files

Returns

Return type

str

classmethod automation_transient_dir()str

Returns the directory for automation save files that are meant to be deleted every run

Returns

Return type

str

classmethod bug_it_dir()str

Returns the directory the engine uses to output BugIt files.

Returns

screenshot directory

Return type

str

classmethod change_extension(path, new_extension)str

Changes the extension of the given filename (does nothing if the file has no extension)

Parameters
  • path (str) –

  • new_extension (str) –

Returns

Return type

str

classmethod cloud_dir()str

Returns the directory for local files used in cloud emulation or support

Returns

Return type

str

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

Parameters

path (str) –

Returns

out_path (str):

Return type

str or None

classmethod combine(paths)str

Combine two or more Paths into one single Path

Parameters

paths (Array(str)) –

Returns

Return type

str

classmethod convert_from_sandbox_path(path, sandbox_name)str

Converts a sandbox (in Saved/Sandboxes) path to a normal path.

Parameters
  • path (str) –

  • sandbox_name (str) – The name of the sandbox.

Returns

Return type

str

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

Parameters
  • path (str) –

  • base_path (str) –

Returns

Return type

str

classmethod convert_to_sandbox_path(path, sandbox_name)str

Converts a normal path to a sandbox path (in Saved/Sandboxes).

Parameters
  • path (str) –

  • sandbox_name (str) – The name of the sandbox.

Returns

Return type

str

classmethod create_temp_filename(path, prefix='', extension='.tmp')str

Creates a temporary filename with the specified prefix.

Parameters
  • path (str) – The file pathname.

  • prefix (str) – The file prefix.

  • extension (str) – File extension (‘.’ required).

Returns

Return type

str

classmethod diff_dir()str

Returns the directory for temp files used for diffing

Returns

Return type

str

classmethod directory_exists(path)bool

Returns true if this directory was found, false otherwise

Parameters

path (str) –

Returns

Return type

bool

classmethod engine_config_dir()str

Returns the directory the root configuration files are located.

Returns

root config directory

Return type

str

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

str

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

str

classmethod engine_intermediate_dir()str

Returns the intermediate directory of the engine

Returns

content directory

Return type

str

classmethod engine_plugins_dir()str

Returns the plugins directory of the engine

Returns

Plugins directory.

Return type

str

classmethod engine_saved_dir()str

Returns the saved directory of the engine

Returns

Saved directory.

Return type

str

classmethod engine_source_dir()str

Returns the directory where engine source code files are kept

Returns

Return type

str

classmethod engine_user_dir()str

Returns the root directory for user-specific engine files. Always writable.

Returns

root user directory

Return type

str

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

str

classmethod enterprise_dir()str

Returns the base directory enterprise directory.

Returns

enterprise directory

Return type

str

classmethod enterprise_feature_pack_dir()str

Returns the enterprise FeaturePack directory

Returns

FeaturePack directory.

Return type

str

classmethod enterprise_plugins_dir()str

Returns the enterprise plugins directory

Returns

Plugins directory.

Return type

str

classmethod feature_pack_dir()str

Returns the directory where feature packs are kept

Returns

Return type

str

classmethod file_exists(path)bool

Returns true if this file was found, false otherwise

Parameters

path (str) –

Returns

Return type

bool

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

str

classmethod game_developers_dir()str

Returns the directory that contains subfolders for developer-specific content

Returns

Return type

str

classmethod game_source_dir()str

Returns the directory where game source code files are kept

Returns

Return type

str

classmethod game_user_developer_dir()str

Returns the directory that contains developer-specific content for the current user

Returns

Return type

str

classmethod generated_config_dir()str

Returns the directory the engine saves generated config files.

Returns

config directory

Return type

str

classmethod get_base_filename(path, remove_path=True)str

Returns the same thing as GetCleanFilename, but without the extension

Parameters
  • path (str) –

  • remove_path (bool) –

Returns

Return type

str

classmethod get_clean_filename(path)str

Returns the filename (with extension), minus any path information.

Parameters

path (str) –

Returns

Return type

str

classmethod get_editor_localization_paths()

Returns a list of editor-specific localization paths

Returns

Return type

Array(str)

classmethod get_engine_localization_paths()

Returns a list of engine-specific localization paths

Returns

Return type

Array(str)

classmethod get_extension(path, include_dot=False)str

Gets the extension for this filename.

Parameters
  • path (str) –

  • include_dot (bool) – if true, includes the leading dot in the result

Returns

the extension of this filename, or an empty string if the filename doesn’t have an extension.

Return type

str

classmethod get_game_localization_paths()

Returns a list of game-specific localization paths

Returns

Return type

Array(str)

classmethod get_invalid_file_system_chars()str

Returns a string containing all invalid characters as dictated by the operating system

Returns

Return type

str

classmethod get_path(path)str

Returns the path in front of the filename

Parameters

path (str) –

Returns

Return type

str

classmethod get_project_file_path()str

Gets the path to the project file.

Returns

Project file path.

Return type

str

classmethod get_property_name_localization_paths()

Returns a list of property name localization paths

Returns

Return type

Array(str)

classmethod get_relative_path_to_root()str

Gets the relative path to get from BaseDir to RootDirectory

Returns

Return type

str

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.

Returns

Return type

Array(str)

classmethod get_tool_tip_localization_paths()

Returns a list of tool tip localization paths

Returns

Return type

Array(str)

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

bool

classmethod is_drive(path)bool

Returns true if this path represents a root drive or volume

Parameters

path (str) –

Returns

Return type

bool

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

bool

classmethod is_relative(path)bool

Returns true if this path is relative to another path

Parameters

path (str) –

Returns

Return type

bool

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.

Parameters

path (str) –

Returns

Return type

bool

classmethod is_same_path(path_a, path_b)bool

Checks if two paths are the same.

Parameters
  • path_a (str) – First path to check.

  • path_b (str) – Second path to check.

Returns

True if both paths are the same. False otherwise.

Return type

bool

classmethod launch_dir()str

Returns the directory the application was launched from (useful for commandline utilities)

Returns

Return type

str

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

Parameters
  • path (str) – Path to change to be relative to InRelativeTo

  • relative_to (str) – Path to use as the new relative base

Returns

true if OutPath was changed to be relative

out_path (str):

Return type

str or None

classmethod make_platform_filename(path)str

Takes an “Unreal” pathname and converts it to a platform filename.

Parameters

path (str) –

Returns

out_path (str):

Return type

str

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 ......)

Parameters

path (str) –

Returns

out_path (str):

Return type

str

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

Parameters
  • string (str) –

  • replacement_char (str) –

Returns

Return type

str

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

Parameters

path (str) –

Returns

out_path (str):

Return type

str

classmethod normalize_filename(path)str

Convert all / and to TEXT(“/”)

Parameters

path (str) –

Returns

out_path (str):

Return type

str

classmethod profiling_dir()str

Returns the directory the engine uses to output profiling files.

Returns

log directory

Return type

str

classmethod project_config_dir()str

Returns the directory the root configuration files are located.

Returns

root config directory

Return type

str

classmethod project_content_dir()str

Returns the content directory of the current game by looking at FApp::GetProjectName().

Returns

content directory

Return type

str

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

str

classmethod project_intermediate_dir()str

Returns the intermediate directory of the current game by looking at FApp::GetProjectName().

Returns

intermediate directory

Return type

str

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

str

classmethod project_mods_dir()str

Returns the mods directory of the current project by looking at FApp::GetProjectName().

Returns

mods directory

Return type

str

classmethod project_persistent_download_dir()str
  • Returns the writable directory for downloaded data that persists across play sessions.

Returns

Return type

str

classmethod project_plugins_dir()str

Returns the plugins directory of the current game by looking at FApp::GetProjectName().

Returns

plugins directory

Return type

str

classmethod project_saved_dir()str

Returns the saved directory of the current game by looking at FApp::GetProjectName().

Returns

saved directory

Return type

str

classmethod project_user_dir()str

Returns the root directory for user-specific game files.

Returns

game user directory

Return type

str

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

Parameters

path (str) –

Returns

out_path (str):

Return type

str

classmethod root_dir()str

Returns the root directory of the engine directory tree

Returns

Root directory.

Return type

str

classmethod sandboxes_dir()str

Returns the directory the engine stores sandbox output

Returns

sandbox directory

Return type

str

classmethod screen_shot_dir()str

Returns the directory the engine uses to output screenshot files.

Returns

screenshot directory

Return type

str

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)

Parameters
  • path (str) –

  • new_extension (str) –

Returns

Return type

str

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

str

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

bool

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

str

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

classmethod video_capture_dir()str

Returns the directory the engine uses to output user requested video capture files.

Returns

Video capture directory

Return type

str