|
Blender V4.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_RECENT_SEARCHES_FILE "recent-searches.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_EXTENSIONS = 34 , BLENDER_SYSTEM_DATAFILES = 52 , BLENDER_SYSTEM_SCRIPTS = 53 , BLENDER_SYSTEM_EXTENSIONS = 54 , BLENDER_SYSTEM_PYTHON = 55 } |
| enum | { BLENDER_RESOURCE_PATH_USER = 0 , BLENDER_RESOURCE_PATH_LOCAL = 1 , BLENDER_RESOURCE_PATH_SYSTEM = 2 } |
Definition in file BKE_appdir.hh.
| #define BLENDER_BOOKMARK_FILE "bookmarks.txt" |
Definition at line 189 of file BKE_appdir.hh.
Referenced by ED_file_read_bookmarks(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), and fsmenu_write_file_and_refresh_or_report_error().
| #define BLENDER_HISTORY_FILE "recent-files.txt" |
Definition at line 190 of file BKE_appdir.hh.
Referenced by wm_history_file_read(), and wm_history_file_write().
| #define BLENDER_PLATFORM_SUPPORT_FILE "platform_support.txt" |
Definition at line 192 of file BKE_appdir.hh.
Referenced by wm_platform_support_check_approval().
| #define BLENDER_QUIT_FILE "quit.blend" |
Definition at line 188 of file BKE_appdir.hh.
Referenced by wm_autosave_delete(), WM_exit_ex(), WM_file_recover_last_session(), and WM_OT_recover_last_session().
| #define BLENDER_RECENT_SEARCHES_FILE "recent-searches.txt" |
Definition at line 191 of file BKE_appdir.hh.
Referenced by blender::ui::string_search::get_recent_searches_file_path().
| #define BLENDER_STARTUP_FILE "startup.blend" |
Definition at line 186 of file BKE_appdir.hh.
Referenced by wm_homefile_read_ex(), wm_homefile_write_exec(), workspace_config_file_read(), and workspace_system_file_read().
| #define BLENDER_USERPREF_FILE "userpref.blend" |
Definition at line 187 of file BKE_appdir.hh.
Referenced by BKE_appdir_app_template_has_userpref(), BKE_blendfile_userdef_write_all(), wm_block_splash_create(), wm_homefile_read_ex(), and wm_init_splash_show_on_startup_check().
| anonymous enum |
The folder_id for BKE_appdir_folder_id and related functions.
Run-time only so existing values may change.
Definition at line 162 of file BKE_appdir.hh.
| anonymous enum |
For #BKE_appdir_folder_id_version only.
| Enumerator | |
|---|---|
| BLENDER_RESOURCE_PATH_USER | |
| BLENDER_RESOURCE_PATH_LOCAL | |
| BLENDER_RESOURCE_PATH_SYSTEM | |
Definition at line 180 of file BKE_appdir.hh.
| bool BKE_appdir_app_template_any | ( | ) |
Return true if templates exist
Definition at line 1066 of file appdir.cc.
References appdir_app_template_directories(), and blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty().
Referenced by wm_file_read_post().
| bool BKE_appdir_app_template_has_userpref | ( | const char * | app_template | ) |
Definition at line 1085 of file appdir.cc.
References app_template, BKE_appdir_app_template_id_search(), BLENDER_USERPREF_FILE, BLI_exists(), BLI_path_join, and FILE_MAX.
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_maxncpy ) |
Definition at line 1071 of file appdir.cc.
References app_template, appdir_app_template_directories(), BLI_is_dir(), and BLI_path_join.
Referenced by BKE_appdir_app_template_has_userpref(), wm_block_splash_image(), wm_homefile_read_ex(), and workspace_system_file_read().
| void BKE_appdir_app_templates | ( | ListBase * | templates | ) |
Definition at line 1105 of file appdir.cc.
References app_template, appdir_app_template_directories(), BLI_addtail(), BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_genericNodeN(), BLI_listbase_clear(), BLI_strdup(), FILENAME_IS_CURRPAR, and S_ISDIR.
Referenced by workspace_add_invoke().
| void BKE_appdir_exit | ( | ) |
Definition at line 101 of file appdir.cc.
References BLI_assert, GHOST_DisposeSystemPaths(), and is_appdir_init.
Referenced by blender::bke::image::partial_update::ImagePartialUpdateTest::TearDown(), BlendfileLoadingBaseTest::TearDownTestCase(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), WM_exit_ex(), and blender::bke::tests::Context< TestData >::~Context().
| bool BKE_appdir_folder_caches | ( | char * | path, |
| size_t | path_maxncpy ) |
Get the user's cache directory, i.e.
$HOME/.cache/blender/USERPROFILE%\AppData\Local\Blender Foundation\Blender\/Library/Caches/Blenderblender folder exists. It does check if the parent of the path exists. Definition at line 226 of file appdir.cc.
References BKE_tempdir_base(), BLI_is_dir(), BLI_path_join, GHOST_getUserSpecialDir(), GHOST_kUserSpecialDirCaches, and SEP_STR.
Referenced by blender::gpu::cache_dir_get(), and blender::ed::asset::index::AssetLibraryIndex::init_indices_base_path().
| const char * BKE_appdir_folder_default | ( | ) |
Get the folder that's the "natural" starting point for browsing files on an OS.
$HOMEuserprofile%/DocumentsUsers/{MyUserName}/Documents is used as it's the default location to save documents. Definition at line 137 of file appdir.cc.
References BKE_appdir_folder_documents(), BKE_appdir_folder_home(), and FILE_MAXDIR.
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 | ( | ) |
Definition at line 163 of file appdir.cc.
References BKE_appdir_folder_default(), and BKE_appdir_folder_root().
Referenced by file_browse_invoke(), and file_expand_directory().
| bool BKE_appdir_folder_documents | ( | char * | dir | ) |
Get the user's document directory, i.e.
$HOME/Documentsuserprofile%/DocumentsIf this can't be found using OS queries (via Ghost), try manually finding it.
Definition at line 196 of file appdir.cc.
References BKE_appdir_folder_home(), BLI_is_dir(), BLI_path_join, BLI_strncpy(), FILE_MAXDIR, GHOST_getUserSpecialDir(), GHOST_kUserSpecialDirDocuments, and N_.
Referenced by BKE_appdir_folder_default(), and BKE_preferences_asset_library_default_add().
| const char * BKE_appdir_folder_home | ( | ) |
Get the user's home directory, i.e.
$HOMEuserprofile% Definition at line 172 of file appdir.cc.
References BLI_expand_tilde(), and BLI_getenv().
Referenced by BKE_appdir_folder_default(), BKE_appdir_folder_documents(), and file_expand_directory().
| std::optional< std::string > BKE_appdir_folder_id | ( | int | folder_id, |
| const char * | subfolder ) |
Definition at line 704 of file appdir.cc.
References BKE_appdir_folder_id_ex(), and FILE_MAX.
Referenced by BKE_appdir_folder_id_create(), BKE_appdir_program_python_search(), BKE_preferences_extension_repo_dirpath_get(), blf_load_datafiles_dir(), blf_load_font_default(), BLT_lang_init(), BPy_init_modules(), BPY_python_start(), bpy_script_paths(), bpy_system_resource(), colormanagement_init(), ED_file_read_bookmarks(), blender::asset_system::essentials_directory_path(), Freestyle_Init(), Freestyle::Config::Path::Path(), studiolight_add_files_from_datafolder(), wm_block_splash_create(), wm_history_file_read(), wm_homefile_read_ex(), wm_init_splash_show_on_startup_check(), wm_platform_support_check_approval(), and workspace_config_file_read().
| std::optional< std::string > 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 764 of file appdir.cc.
References BKE_appdir_folder_id(), BKE_appdir_folder_id_user_notest(), BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_EXTENSIONS, BLENDER_USER_SCRIPTS, BLI_assert_unreachable, BLI_dir_create_recursive(), and ELEM.
Referenced by BKE_blendfile_userdef_write_all(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), fsmenu_write_file_and_refresh_or_report_error(), blender::ui::string_search::get_recent_searches_file_path(), 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_maxncpy ) |
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 591 of file appdir.cc.
References BLENDER_DATAFILES, BLENDER_SYSTEM_DATAFILES, BLENDER_SYSTEM_EXTENSIONS, BLENDER_SYSTEM_PYTHON, BLENDER_SYSTEM_SCRIPTS, BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_EXTENSIONS, BLENDER_USER_SCRIPTS, BLI_assert_unreachable, get_path_environment(), get_path_local(), get_path_system(), and get_path_user().
Referenced by appdir_app_template_directories(), and BKE_appdir_folder_id().
| std::optional< std::string > 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 713 of file appdir.cc.
References BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_EXTENSIONS, BLENDER_USER_SCRIPTS, BLENDER_VERSION, BLI_assert_unreachable, FILE_MAX, get_path_environment_ex(), and get_path_user_ex().
Referenced by BKE_appdir_folder_id_create(), BKE_preferences_extension_repo_dirpath_get(), BKE_preferences_extension_repo_user_dirpath_get(), and bpy_user_resource().
| const char * BKE_appdir_folder_root | ( | ) |
Definition at line 152 of file appdir.cc.
References BLI_windows_get_default_root_dir().
Referenced by BKE_appdir_folder_default_or_root().
| bool BKE_appdir_font_folder_default | ( | char * | dir, |
| size_t | dir_maxncpy ) |
Gets a good default directory for fonts.
Definition at line 250 of file appdir.cc.
References BLI_exists(), BLI_expand_tilde(), BLI_strncpy(), BLI_strncpy_wchar_as_utf8(), FILE_MAXDIR, and STRNCPY.
Referenced by BKE_blendfile_userdef_from_defaults(), and file_browse_invoke().
| void BKE_appdir_init | ( | ) |
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 93 of file appdir.cc.
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(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
| const char * BKE_appdir_program_dir | ( | ) |
Path to directory of executable
Definition at line 948 of file appdir.cc.
References BLI_assert, and g_app.
Referenced by Freestyle::Config::Path::Path().
| const char * BKE_appdir_program_path | ( | ) |
Path to executable
Definition at line 940 of file appdir.cc.
References BLI_assert, and g_app.
Referenced by bpy_app_binary_path_get(), and BPY_python_start().
| void BKE_appdir_program_path_init | ( | const char * | argv0 | ) |
Initialize path to program executable.
Definition at line 917 of file appdir.cc.
References BLI_path_canonicalize_native(), BLI_path_split_dir_part(), g_app, STRNCPY, and where_am_i().
Referenced by bpy_app_binary_path_set(), and main().
| bool BKE_appdir_program_python_search | ( | char * | program_filepath, |
| size_t | program_filepath_maxncpy, | ||
| int | version_major, | ||
| int | version_minor ) |
Find Python executable.
Definition at line 954 of file appdir.cc.
References ARRAY_SIZE, ASSERT_IS_INIT, BKE_appdir_folder_id(), BLENDER_SYSTEM_PYTHON, BLI_exists(), BLI_path_join, BLI_path_program_search(), program_filepath, SNPRINTF, and STRINGIFY.
Referenced by BPY_python_start().
| std::optional< std::string > BKE_appdir_resource_path_id | ( | int | folder_id, |
| bool | check_is_dir ) |
Definition at line 817 of file appdir.cc.
References BKE_appdir_resource_path_id_with_version(), and BLENDER_VERSION.
| std::optional< std::string > BKE_appdir_resource_path_id_with_version | ( | int | folder_id, |
| bool | check_is_dir, | ||
| int | version ) |
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 789 of file appdir.cc.
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(), and get_path_user_ex().
Referenced by BKE_appdir_resource_path_id(), and bpy_resource_path().
| const char * BKE_tempdir_base | ( | ) |
Path to persistent temporary directory (with trailing slash)
Definition at line 1211 of file appdir.cc.
References g_app.
Referenced by BKE_appdir_folder_caches(), BKE_tempdir_session(), blender::io::obj::OBJMTLParserTest::check_string(), blender::io::obj::OBJExportRegressionTest::compare_obj_export_to_golden(), blender::io::stl::STLExportTest::get_temp_filename(), material_copybuffer_filepath_get(), blender::ed::outliner::outliner_copybuffer_filepath_get(), pose_copybuffer_filepath_get(), render_result_exr_file_cache_path(), sequencer_copybuffer_filepath_get(), blender::io::usd::UsdUsdzExportTest::SetUp(), sig_handle_crash(), view3d_copybuffer_filepath_get(), 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 1190 of file appdir.cc.
References BKE_tempdir_session_purge(), g_app, tempdir_session_create(), and where_is_temp().
Referenced by blender::io::obj::OBJMTLParserTest::check_string(), blender::io::obj::OBJExportRegressionTest::compare_obj_export_to_golden(), blender::io::obj::ObjExporterWriterTest::SetUp(), blender::io::ply::PLYExportTest::SetUp(), blender::io::stl::STLExportTest::SetUp(), blender::io::usd::UsdUsdzExportTest::SetUp(), blender::io::obj::TEST_F(), blender::asset_system::tests::AssetLibraryServiceTest::use_temp_path(), blender::asset_system::tests::AssetLibraryTestBase::use_temp_path(), and wm_init_userdef().
| const char * BKE_tempdir_session | ( | ) |
Path to temporary directory (with trailing slash)
Definition at line 38 of file 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::io::usd::create_temp_path_for_usdz_export(), blender::io::usd::export_endjob_usdz_cleanup(), blender::compositor::get_operations_export_dir(), blender::io::obj::ObjExporterWriterTest::get_temp_obj_filename(), blender::io::ply::PLYExportTest::get_temp_ply_filename(), blender::compositor::DebugInfo::graphviz(), blender::io::usd::image_cache_file_path(), make_temp_filepath(), ptcache_path(), blender::io::usd::temp_textures_dir(), blender::io::hydra::USDSceneDelegate::USDSceneDelegate(), blender::asset_system::tests::AssetLibraryServiceTest::use_temp_path(), and blender::asset_system::tests::AssetLibraryTestBase::use_temp_path().
| void BKE_tempdir_session_purge | ( | ) |
Delete content of this instance's temp dir.
Definition at line 1216 of file appdir.cc.
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(), blender::io::ply::PLYExportTest::TearDown(), blender::io::stl::STLExportTest::TearDown(), BlendfileLoadingBaseTest::TearDownTestCase(), and WM_exit_ex().