Blender
V3.3
|
Go to the source code of this file.
Macros | |
#define | BLENDER_STARTUP_FILE "startup.blend" |
#define | BLENDER_USERPREF_FILE "userpref.blend" |
#define | BLENDER_QUIT_FILE "quit.blend" |
#define | BLENDER_BOOKMARK_FILE "bookmarks.txt" |
#define | BLENDER_HISTORY_FILE "recent-files.txt" |
#define | BLENDER_PLATFORM_SUPPORT_FILE "platform_support.txt" |
Enumerations | |
enum | { BLENDER_DATAFILES = 2 , BLENDER_USER_CONFIG = 31 , BLENDER_USER_DATAFILES = 32 , BLENDER_USER_SCRIPTS = 33 , BLENDER_USER_AUTOSAVE = 34 , BLENDER_SYSTEM_DATAFILES = 52 , BLENDER_SYSTEM_SCRIPTS = 53 , BLENDER_SYSTEM_PYTHON = 54 } |
enum | { BLENDER_RESOURCE_PATH_USER = 0 , BLENDER_RESOURCE_PATH_LOCAL = 1 , BLENDER_RESOURCE_PATH_SYSTEM = 2 } |
Definition in file BKE_appdir.h.
#define BLENDER_BOOKMARK_FILE "bookmarks.txt" |
Definition at line 178 of file BKE_appdir.h.
#define BLENDER_HISTORY_FILE "recent-files.txt" |
Definition at line 179 of file BKE_appdir.h.
#define BLENDER_PLATFORM_SUPPORT_FILE "platform_support.txt" |
Definition at line 180 of file BKE_appdir.h.
#define BLENDER_QUIT_FILE "quit.blend" |
Definition at line 177 of file BKE_appdir.h.
#define BLENDER_STARTUP_FILE "startup.blend" |
Definition at line 175 of file BKE_appdir.h.
#define BLENDER_USERPREF_FILE "userpref.blend" |
Definition at line 176 of file BKE_appdir.h.
anonymous enum |
Enumerator | |
---|---|
BLENDER_DATAFILES | |
BLENDER_USER_CONFIG | |
BLENDER_USER_DATAFILES | |
BLENDER_USER_SCRIPTS | |
BLENDER_USER_AUTOSAVE | |
BLENDER_SYSTEM_DATAFILES | |
BLENDER_SYSTEM_SCRIPTS | |
BLENDER_SYSTEM_PYTHON |
Definition at line 152 of file BKE_appdir.h.
anonymous enum |
Enumerator | |
---|---|
BLENDER_RESOURCE_PATH_USER | |
BLENDER_RESOURCE_PATH_LOCAL | |
BLENDER_RESOURCE_PATH_SYSTEM |
Definition at line 169 of file BKE_appdir.h.
Check if this is an install with user files kept together with the Blender executable and its installation files.
Definition at line 404 of file appdir.c.
References FILE_MAX, get_path_local(), and NULL.
Referenced by BKE_studiolight_init(), and get_path_user_ex().
Return true if templates exist
Definition at line 966 of file appdir.c.
References app_template_directory_id, app_template_directory_search, ARRAY_SIZE, BKE_appdir_folder_id_ex(), and FILE_MAX.
Referenced by wm_file_read_post().
bool BKE_appdir_app_template_has_userpref | ( | const char * | app_template | ) |
Definition at line 992 of file appdir.c.
References app_template, BKE_appdir_app_template_id_search(), BLENDER_USERPREF_FILE, BLI_exists(), BLI_path_join(), FILE_MAX, and NULL.
Referenced by BKE_blendfile_userdef_write_all(), and wm_homefile_read_exec().
bool BKE_appdir_app_template_id_search | ( | const char * | app_template, |
char * | path, | ||
size_t | path_len | ||
) |
Definition at line 980 of file appdir.c.
References app_template, app_template_directory_id, app_template_directory_search, ARRAY_SIZE, BKE_appdir_folder_id_ex(), BLI_join_dirfile(), and FILE_MAX.
Referenced by BKE_appdir_app_template_has_userpref(), wm_block_splash_image(), wm_homefile_read_ex(), and workspace_system_file_read().
Definition at line 1012 of file appdir.c.
References app_template_directory_id, app_template_directory_search, ARRAY_SIZE, BKE_appdir_folder_id_ex(), BLI_addtail(), BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_genericNodeN(), BLI_listbase_clear(), BLI_strdup(), FILE_MAX, FILENAME_IS_CURRPAR, direntry::relname, S_ISDIR, and type.
Referenced by workspace_add_invoke().
Definition at line 96 of file appdir.c.
References BLI_assert, and is_appdir_init.
Referenced by blender::bke::image::partial_update::ImagePartialUpdateTest::TearDown(), BlendfileLoadingBaseTest::TearDownTestCase(), blender::bke::tests::TEST(), WM_exit_ex(), and blender::bke::tests::Context< TestData >::~Context().
bool BKE_appdir_folder_caches | ( | char * | r_path, |
size_t | path_len | ||
) |
Get the user's cache directory, i.e.
$HOME/.cache/blender/
USERPROFILE%\AppData\Local\Blender Foundation\Blender\
/Library/Caches/Blender
blender
folder exists. It does check if the parent of the path exists. Definition at line 203 of file appdir.c.
References BKE_tempdir_base(), BLI_is_dir(), BLI_path_join(), GHOST_getUserSpecialDir(), GHOST_kUserSpecialDirCaches, NULL, and SEP_STR.
Referenced by blender::ed::asset::index::AssetLibraryIndex::init_indices_base_path().
const char* BKE_appdir_folder_default | ( | void | ) |
Get the folder that's the "natural" starting point for browsing files on an OS.
$HOME
userprofile%/Documents
Users/{MyUserName}/Documents
is used as it's the default location to save documents. Definition at line 127 of file appdir.c.
References BKE_appdir_folder_documents(), BLI_getenv(), MAXPATHLEN, and NULL.
Referenced by BKE_appdir_folder_default_or_root(), blo_update_defaults_screen(), and fileselect_initialize_params_common().
const char* BKE_appdir_folder_default_or_root | ( | void | ) |
Definition at line 153 of file appdir.c.
References BKE_appdir_folder_default(), BKE_appdir_folder_root(), and NULL.
Referenced by file_expand_directory().
bool BKE_appdir_folder_documents | ( | char * | dir | ) |
Get the user's document directory, i.e.
$HOME/Documents
userprofile%/Documents
If this can't be found using OS queries (via Ghost), try manually finding it.
Definition at line 173 of file appdir.c.
References BKE_appdir_folder_home(), BLI_is_dir(), BLI_path_join(), BLI_strncpy(), FILE_MAXDIR, GHOST_getUserSpecialDir(), GHOST_kUserSpecialDirDocuments, N_, and NULL.
Referenced by BKE_appdir_folder_default(), and BKE_preferences_asset_library_default_add().
const char* BKE_appdir_folder_home | ( | void | ) |
Get the user's home directory, i.e.
$HOME
userprofile%
Definition at line 162 of file appdir.c.
References BLI_expand_tilde(), and BLI_getenv().
Referenced by BKE_appdir_folder_documents().
const char* BKE_appdir_folder_id | ( | int | folder_id, |
const char * | subfolder | ||
) |
Definition at line 672 of file appdir.c.
References BKE_appdir_folder_id_ex(), FILE_MAX, and NULL.
Referenced by BKE_appdir_folder_id_create(), BKE_appdir_program_python_search(), blf_load_font_default(), BLF_load_font_stack(), BLT_lang_init(), BPy_init_modules(), BPY_python_start(), bpy_script_paths(), bpy_system_resource(), colormanagement_init(), ED_file_read_bookmarks(), blender::io::usd::ensure_usd_plugin_path_registered(), Freestyle_Init(), icon_preview_imbuf_from_brush(), init_iconfile_list(), init_internal_icons(), Freestyle::Config::Path::Path(), studiolight_add_files_from_datafolder(), wm_block_create_splash(), wm_history_file_read(), wm_homefile_read_ex(), wm_platform_support_check_approval(), and workspace_config_file_read().
const char* BKE_appdir_folder_id_create | ( | int | folder_id, |
const char * | subfolder | ||
) |
Returns the path to a folder in the user area, creating it if it doesn't exist.
Definition at line 727 of file appdir.c.
References BKE_appdir_folder_id(), BKE_appdir_folder_id_user_notest(), BLENDER_USER_AUTOSAVE, BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_SCRIPTS, BLI_dir_create_recursive(), ELEM, and NULL.
Referenced by BKE_blendfile_userdef_write_all(), bookmark_add_exec(), bookmark_cleanup_exec(), bookmark_delete_exec(), bookmark_move_exec(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), file_execute(), reset_recent_exec(), wm_autosave_location(), wm_history_file_write(), and wm_homefile_write_exec().
bool BKE_appdir_folder_id_ex | ( | int | folder_id, |
const char * | subfolder, | ||
char * | path, | ||
size_t | path_len | ||
) |
Get a folder out of the folder_id presets for paths.
subfolder | The name of a directory to check for, this may contain path separators but must resolve to a directory, checked with BLI_is_dir. |
Definition at line 568 of file appdir.c.
References BLENDER_DATAFILES, BLENDER_SYSTEM_DATAFILES, BLENDER_SYSTEM_PYTHON, BLENDER_SYSTEM_SCRIPTS, BLENDER_USER_AUTOSAVE, BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_SCRIPTS, BLI_assert_unreachable, get_path_environment(), get_path_local(), get_path_system(), and get_path_user().
Referenced by BKE_appdir_app_template_any(), BKE_appdir_app_template_id_search(), BKE_appdir_app_templates(), and BKE_appdir_folder_id().
const char* BKE_appdir_folder_id_user_notest | ( | int | folder_id, |
const char * | subfolder | ||
) |
Returns the path to a folder in the user area without checking that it actually exists first.
Definition at line 681 of file appdir.c.
References BLENDER_USER_AUTOSAVE, BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_SCRIPTS, BLENDER_VERSION, BLI_assert_unreachable, FILE_MAX, get_path_environment_ex(), get_path_user_ex(), and NULL.
Referenced by BKE_appdir_folder_id_create(), and bpy_user_resource().
const char* BKE_appdir_folder_id_version | ( | int | folder_id, |
int | version, | ||
bool | check_is_dir | ||
) |
Returns the path of the top-level version-specific local, user or system directory. If check_is_dir, then the result will be NULL if the directory doesn't exist.
Definition at line 752 of file appdir.c.
References BLENDER_RESOURCE_PATH_LOCAL, BLENDER_RESOURCE_PATH_SYSTEM, BLENDER_RESOURCE_PATH_USER, BLI_assert_msg, FILE_MAX, get_path_local_ex(), get_path_system_ex(), get_path_user_ex(), and NULL.
Referenced by bpy_resource_path().
const char* BKE_appdir_folder_root | ( | void | ) |
Definition at line 142 of file appdir.c.
References BLI_windows_get_default_root_dir().
Referenced by BKE_appdir_folder_default_or_root().
bool BKE_appdir_font_folder_default | ( | char * | dir | ) |
Gets a good default directory for fonts.
Definition at line 227 of file appdir.c.
References BLI_exists(), BLI_expand_tilde(), BLI_path_slash_ensure(), BLI_strncpy(), BLI_strncpy_wchar_as_utf8(), FILE_MAXDIR, L, and STRNCPY.
Referenced by BKE_blendfile_userdef_from_defaults().
Sanity check to ensure correct API use in debug mode.
Run this once the first level of arguments has been passed so we can be sure --env-system-datafiles
, and other --env-*
arguments has been passed.
Without this any callers to this module that run early on, will miss out on changes from parsing arguments.
Definition at line 88 of file appdir.c.
References BLI_assert, and is_appdir_init.
Referenced by blender::bke::tests::Context< TestData >::Context(), main(), blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp(), BlendfileLoadingBaseTest::SetUpTestCase(), and blender::bke::tests::TEST().
const char* BKE_appdir_program_dir | ( | void | ) |
Path to directory of executable
Definition at line 873 of file appdir.c.
References BLI_assert, and g_app.
const char* BKE_appdir_program_path | ( | void | ) |
Path to executable
Definition at line 867 of file appdir.c.
References BLI_assert, and g_app.
Referenced by BPY_python_start(), and make_app_info().
void BKE_appdir_program_path_init | ( | const char * | argv0 | ) |
Initialize path to program executable.
Definition at line 861 of file appdir.c.
References BLI_split_dir_part(), g_app, and where_am_i().
Referenced by main().
bool BKE_appdir_program_python_search | ( | char * | fullpath, |
size_t | fullpath_len, | ||
int | version_major, | ||
int | version_minor | ||
) |
Find Python executable.
Definition at line 879 of file appdir.c.
References ARRAY_SIZE, ASSERT_IS_INIT, basename(), BKE_appdir_folder_id(), BLENDER_SYSTEM_PYTHON, BLI_exists(), BLI_join_dirfile(), BLI_path_program_search(), SNPRINTF, and STRINGIFY.
Referenced by BPY_python_start().
const char* BKE_tempdir_base | ( | void | ) |
Path to persistent temporary directory (with trailing slash)
Definition at line 1154 of file appdir.c.
References g_app.
Referenced by BKE_appdir_folder_caches(), BKE_tempdir_session(), blender::io::obj::obj_mtl_parser_test::check_string(), blender::io::obj::obj_exporter_regression_test::compare_obj_export_to_golden(), outliner_id_copy_exec(), outliner_id_paste_exec(), pose_copy_exec(), pose_paste_exec(), render_result_exr_file_cache_path(), sig_handle_crash(), view3d_copybuffer_exec(), view3d_pastebuffer_exec(), wm_autosave_delete(), wm_autosave_location(), WM_exit_ex(), and WM_file_recover_last_session().
void BKE_tempdir_init | ( | const char * | userdir | ) |
Initialize path to temporary directory.
Definition at line 1133 of file appdir.c.
References BKE_tempdir_session_purge(), g_app, tempdir_session_create(), and where_is_temp().
Referenced by blender::io::obj::obj_mtl_parser_test::check_string(), blender::io::obj::obj_exporter_regression_test::compare_obj_export_to_golden(), blender::io::obj::ObjExporterWriterTest::SetUp(), blender::io::obj::TEST_F(), blender::bke::tests::AssetCatalogTest::use_temp_path(), blender::bke::tests::AssetLibraryServiceTest::use_temp_path(), and wm_init_userdef().
const char* BKE_tempdir_session | ( | void | ) |
Path to temporary directory (with trailing slash)
Definition at line 41 of file intern/ghost/test/multitest/stubs.c.
References BKE_tempdir_base(), and g_app.
Referenced by BKE_memfile_undo_encode(), BKE_modifier_path_init(), BKE_modifier_path_relbase(), bpy_app_tempdir_get(), blender::compositor::get_operations_export_dir(), blender::io::obj::ObjExporterWriterTest::get_temp_obj_filename(), blender::compositor::DebugInfo::graphviz(), make_temp_filepath(), ptcache_path(), blender::bke::tests::AssetCatalogTest::use_temp_path(), and blender::bke::tests::AssetLibraryServiceTest::use_temp_path().
Delete content of this instance's temp dir.
Definition at line 1159 of file appdir.c.
References BLI_delete(), BLI_is_dir(), and g_app.
Referenced by BKE_tempdir_init(), sig_handle_abort(), sig_handle_crash(), blender::io::obj::ObjExporterWriterTest::TearDown(), BlendfileLoadingBaseTest::TearDownTestCase(), and WM_exit_ex().