|
Blender V5.0
|
#include "BLI_compiler_attrs.h"#include "BLI_compiler_compat.h"#include "BLI_utildefines.h"#include "BLI_utildefines_variadic.h"Go to the source code of this file.
Macros | |
Current & Parent Directory Defines/Macros | |
| #define | FILENAME_PARENT ".." |
| #define | FILENAME_CURRENT "." |
| #define | FILENAME_IS_PARENT(_n) |
| #define | FILENAME_IS_CURRENT(_n) |
| #define | FILENAME_IS_CURRPAR(_n) |
Functions | |
Path Parent Operations | |
| bool | BLI_path_parent_dir (char *path) ATTR_NONNULL(1) |
| bool | BLI_path_parent_dir_until_exists (char *path) ATTR_NONNULL(1) |
| const char * | BLI_path_parent_dir_end (const char *path, size_t path_len) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Make Safe / Sanitize | |
| bool | BLI_path_make_safe_filename_ex (char *filename, bool allow_tokens) ATTR_NONNULL(1) |
| bool | BLI_path_make_safe_filename (char *filename) ATTR_NONNULL(1) |
| bool | BLI_path_make_safe (char *path) ATTR_NONNULL(1) |
| void | BLI_path_to_display_name (char *display_name, int display_name_maxncpy, const char *name) ATTR_NONNULL(1 |
Path Normalize | |
| int | BLI_path_normalize (char *path) ATTR_NONNULL(1) |
| int | BLI_path_normalize_native (char *path) ATTR_NONNULL(1) |
| int | BLI_path_normalize_dir (char *dir, size_t dir_maxncpy) ATTR_NONNULL(1) |
Path Canonicalize | |
| int | BLI_path_canonicalize_native (char *path, int path_maxncpy) |
Path FileName Manipulation | |
| bool | BLI_path_filename_ensure (char *filepath, size_t filepath_maxncpy, const char *filename) ATTR_NONNULL(1 |
| bool bool | BLI_path_suffix (char *path, size_t path_maxncpy, const char *suffix, const char *sep) ATTR_NONNULL(1 |
Path Slash Utilities | |
| const char * | BLI_path_slash_find (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| const char * | BLI_path_slash_rfind (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| int | BLI_path_slash_ensure_ex (char *path, size_t path_maxncpy, const size_t path_len) ATTR_NONNULL(1) |
| int | BLI_path_slash_ensure (char *path, size_t path_maxncpy) ATTR_NONNULL(1) |
| void | BLI_path_slash_rstrip (char *path) ATTR_NONNULL(1) |
| const char * | BLI_path_slash_skip (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| void | BLI_path_slash_native (char *path) ATTR_NONNULL(1) |
Path Directory/FileName Split | |
| void | BLI_path_split_dir_file (const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1 |
| void void | BLI_path_split_dir_part (const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1 |
| void void void | BLI_path_split_file_part (const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1 |
| void void void const char * | BLI_path_basename (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Filtering Utilities | |
| bool | BLI_path_has_hidden_component (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Append | |
| size_t | BLI_path_append (char *__restrict dst, size_t dst_maxncpy, const char *__restrict file) ATTR_NONNULL(1 |
| size_t size_t | BLI_path_append_dir (char *__restrict dst, size_t dst_maxncpy, const char *__restrict dir) ATTR_NONNULL(1 |
Path File Extensions | |
| const char * | BLI_path_extension_or_end (const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL |
| const char * | BLI_path_extension (const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_extension_check (const char *path, const char *ext) ATTR_NONNULL(1 |
| bool | BLI_path_extension_check_n (const char *path,...) ATTR_NONNULL(1) ATTR_SENTINEL(0) |
| bool | BLI_path_extension_check_array (const char *path, const char **ext_array) ATTR_NONNULL(1 |
| bool | BLI_path_extension_check_glob (const char *path, const char *ext_fnmatch) ATTR_NONNULL(1 |
| bool | BLI_path_extension_glob_validate (char *ext_fnmatch) ATTR_NONNULL(1) |
| bool | BLI_path_extension_replace (char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1 |
| bool bool | BLI_path_extension_strip (char *path) ATTR_NONNULL(1) |
| bool | BLI_path_extension_ensure (char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1 |
Program Specific Path Functions | |
| bool | BLI_path_program_search (char *program_filepath, size_t program_filepath_maxncpy, const char *program_name) ATTR_NONNULL(1 |
Blender Specific Frame Sequence Encode/Decode | |
| void | BLI_path_sequence_encode (char *path, size_t path_maxncpy, const char *head, const char *tail, unsigned short numlen, int pic) |
| int | BLI_path_sequence_decode (const char *path, char *head, size_t head_maxncpy, char *tail, size_t tail_maxncpy, unsigned short *r_digits_len) |
Blender Specific Frame Number Apply/Strip | |
| bool | BLI_path_frame (char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1) |
| bool | BLI_path_frame_range (char *path, size_t path_maxncpy, int sta, int end, int digits) ATTR_NONNULL(1) |
| bool | BLI_path_frame_get (const char *path, int *r_frame, int *r_digits_len) ATTR_NONNULL(1 |
| bool void | BLI_path_frame_strip (char *path, char *r_ext, size_t ext_maxncpy) ATTR_NONNULL(1 |
| bool void bool | BLI_path_frame_check_chars (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Current Working Directory Specific Paths | |
| bool | BLI_path_is_abs_from_cwd (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_abs_from_cwd (char *path, size_t path_maxncpy) ATTR_NONNULL(1) |
OS Level Wrappers | |
TODO: move these to a different module, they are not path functions. | |
| void | BLI_setenv (const char *env, const char *val) ATTR_NONNULL(1) |
| void | BLI_setenv_if_new (const char *env, const char *val) ATTR_NONNULL(1) |
| const char * | BLI_getenv (const char *env) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Comparison / Contains | |
| #define | BLI_path_cmp strcmp |
| #define | BLI_path_ncmp strncmp |
| int | BLI_path_cmp_normalized (const char *p1, const char *p2) ATTR_NONNULL(1 |
| bool | BLI_path_contains (const char *container_path, const char *containee_path) ATTR_NONNULL(1 |
Blender Specific File Relative Paths | |
| #define | FILE_MAXDIR 768 |
| #define | FILE_MAXFILE 256 |
| #define | FILE_MAX 1024 |
| bool | BLI_path_abs (char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1 |
| bool void | BLI_path_rel (char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1) |
| bool | BLI_path_is_rel (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Native Slash Defines & Checks | |
| #define | SEP '/' |
| #define | ALTSEP '\\' |
| #define | SEP_STR "/" |
| #define | ALTSEP_STR "\\" |
| BLI_INLINE bool | BLI_path_slash_is_native_compat (const char ch) |
Path Queries | |
| bool | ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_name_at_index (const char *__restrict path, int index, int *__restrict r_offset, int *__restrict r_len) ATTR_NONNULL(1 |
| bool | BLI_path_is_unc (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_is_win32_drive (const char *path) |
| bool | BLI_path_is_win32_drive_only (const char *path) |
| bool | BLI_path_is_win32_drive_with_slash (const char *path) |
| #define _BLI_PATH_JOIN_ARGS_1 char *__restrict dst, size_t dst_maxncpy, const char *a |
Definition at line 381 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_3().
| #define _BLI_PATH_JOIN_ARGS_10 _BLI_PATH_JOIN_ARGS_9, const char *j |
Definition at line 390 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_12().
| #define _BLI_PATH_JOIN_ARGS_2 _BLI_PATH_JOIN_ARGS_1, const char *b |
Definition at line 382 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_4().
| #define _BLI_PATH_JOIN_ARGS_3 _BLI_PATH_JOIN_ARGS_2, const char *c |
Definition at line 383 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_5().
| #define _BLI_PATH_JOIN_ARGS_4 _BLI_PATH_JOIN_ARGS_3, const char *d |
Definition at line 384 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_6().
| #define _BLI_PATH_JOIN_ARGS_5 _BLI_PATH_JOIN_ARGS_4, const char *e |
Definition at line 385 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_7().
| #define _BLI_PATH_JOIN_ARGS_6 _BLI_PATH_JOIN_ARGS_5, const char *f |
Definition at line 386 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_8().
| #define _BLI_PATH_JOIN_ARGS_7 _BLI_PATH_JOIN_ARGS_6, const char *g |
Definition at line 387 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_9().
| #define _BLI_PATH_JOIN_ARGS_8 _BLI_PATH_JOIN_ARGS_7, const char *h |
Definition at line 388 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_10().
| #define _BLI_PATH_JOIN_ARGS_9 _BLI_PATH_JOIN_ARGS_8, const char *i |
Definition at line 389 of file BLI_path_utils.hh.
Referenced by _BLI_path_join_11().
| #define ALTSEP '\\' |
Definition at line 729 of file BLI_path_utils.hh.
Referenced by BLI_path_canonicalize_native(), BLI_path_extension_or_end(), BLI_path_slash_is_native_compat(), BLI_path_slash_native(), current_relpath_append(), and blender::asset_system::tests::TEST_F().
| #define ALTSEP_STR "\\" |
Definition at line 731 of file BLI_path_utils.hh.
Referenced by blender::asset_system::AssetLibraryService::normalize_asset_weak_reference_relative_asset_identifier(), and blender::asset_system::AssetLibraryService::rfind_blendfile_extension().
| #define BLI_path_cmp strcmp |
Definition at line 538 of file BLI_path_utils.hh.
Referenced by BKE_image_load_exists_in_lib(), BKE_movieclip_file_add_exists_ex(), BKE_preferences_extension_repo_add(), BKE_sound_new_file_exists_ex(), BKE_vfont_load_exists_ex(), blf_font_new_impl(), blf_search_by_filepath(), BLF_unload(), BLI_path_cmp_normalized(), blo_find_main_for_library_and_idname(), BLO_write_file_impl(), bpy_lib_load(), direct_link_library(), filelist_readjob_list_dir(), folderlist_clear_next(), folderlist_pushdir(), fsmenu_get_active_indices(), blender::ed::outliner::lib_relocate(), python_script_error_jump(), surface_duplicateOutputExists(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), text_jump_to_file_at_point_internal(), wm_file_link_append_datablock_ex(), wm_file_write_check_with_report_on_failure(), wm_history_file_update(), wm_id_linked_relocate_exec(), wm_lib_relocate_exec_do(), wm_link_append_exec(), and workspace_append_activate_exec().
| #define BLI_path_join | ( | ... | ) |
Join multiple strings into a path, ensuring only a single path separator between each, and trailing slash is kept.
| path | The first patch which has special treatment, allowing // prefix which is kept intact unlike double-slashes which are stripped from the bounds of all other paths passed in. Passing in the following paths all result in the same output (//a/b/c):
|
Definition at line 379 of file BLI_path_utils.hh.
Referenced by blender::seq::add_image_init_alpha_mode(), blender::seq::add_reload_new_file(), blender::asset_system::asset_definition_default_file_path_from_dir(), autocomplete_directory(), blender::ed::object::bake_simulation::bake_directory_has_data(), blender::ed::object::bake_simulation::bake_geometry_nodes_startjob(), MANTA::bakeData(), MANTA::bakeGuiding(), MANTA::bakeMesh(), MANTA::bakeNoise(), MANTA::bakeParticles(), BKE_appdir_app_template_has_userpref(), BKE_appdir_app_template_id_search(), BKE_appdir_folder_caches(), BKE_appdir_folder_documents(), BKE_appdir_font_folder_default(), BKE_appdir_program_python_search(), BKE_blender_globals_crash_path_get(), BKE_blendfile_userdef_write_all(), BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_image_get_tile_info(), BKE_image_save_options_init(), BKE_memfile_undo_encode(), BKE_modifier_path_init(), BKE_preferences_asset_library_default_add(), BKE_preferences_extension_repo_dirpath_get(), BKE_preferences_extension_repo_user_dirpath_get(), BKE_ptcache_disk_cache_rename(), BKE_ptcache_id_clear(), BlendfileLoadingBaseTest::blendfile_load(), blf_load_font_default(), BLI_path_abs_from_cwd(), BPY_python_start(), blender::io::hydra::cache_or_get_image_file(), blender::seq::check_media_missing(), blender::ed::object::collection_exporter_export(), colormanagement_init(), blender::io::usd::copy_asset_to_directory(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), blender::io::usd::copy_udim_asset_to_directory(), blender::io::usd::create_temp_path_for_usdz_export(), blender::ed::vse::draw_seq_text_get_source(), dynamicPaint_bakeImageSequence(), ED_file_read_bookmarks(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), blender::bke::preferences::exists(), blender::io::usd::export_endjob_usdz_cleanup(), blender::io::usd::export_in_memory_imbuf(), blender::io::usd::export_packed_texture(), MANTA::exportLiquidScript(), MANTA::exportSmokeScript(), file_draw_check_exists(), file_expand_directory(), file_filename_enter_handle(), file_sfile_to_operator_ex(), fileentry_uiname(), filelist_file_get_full_path(), filelist_readjob_list_dir(), blender::asset_system::AssetCatalogService::find_suitable_cdf_path_for_writing(), fluid_bake_startjob(), blender::tests::font_path(), Freestyle_Init(), blender::bke::bake::BakePath::from_single_root(), fsmenu_read_system(), fsmenu_write_file_and_refresh_or_report_error(), fsmenu_xdg_insert_entry(), fsmenu_xdg_user_dirs_parse(), blender::asset_system::AssetRepresentation::full_path(), blender::bke::bake::get_default_modifier_bake_directory(), blender::bke::bake::get_default_node_bake_directory(), blender::io::usd::get_image_cache_file(), get_index_dir(), blender::bke::bake::get_node_bake_path(), blender::seq::get_path_from_strip(), get_path_local_ex(), get_proxy_filepath(), blender::ui::string_search::get_recent_searches_file_path(), get_tc_filepath(), blender::io::usd::get_tex_image_asset_filepath(), blender::io::usd::get_tex_image_asset_filepath(), blender::io::usd::image_cache_file_path(), image_foreach_path(), image_sequence_get_frame_ranges(), IMB_colormanagement_space_to_icc_profile(), blender::ed::vse::load_data_init_from_operator(), blender::io::fbx::load_texture_image(), blender::tests::ChangeWorkingDirectoryTest::make_pseudo_unique_temp_filename(), material_copybuffer_filepath_get(), missing_files_find__recursive(), blender::asset_system::AssetLibraryService::move_runtime_current_file_into_on_disk_library(), blender::io::obj::MTLParser::MTLParser(), new_folder_path(), open_exec(), blender::ed::outliner::outliner_copybuffer_filepath_get(), path_destination_ensure_filename(), blender::io::path_reference(), blender::ed::io::paths_from_operator_properties(), blender::io::usd::perform_usdz_conversion(), pose_copybuffer_filepath_get(), blender::bke::bake::DiskBlobReader::read(), renamebutton_cb(), render_result_exr_file_cache_path(), blender::seq::seq_proxy_get_custom_file_filepath(), blender::seq::seq_proxy_index_dir_set(), blender::seq::seq_proxy_multiview_context_invalid(), blender::seq::seq_render_image_strip(), blender::ed::vse::sequencer_add_movie_multiple_strips(), blender::ed::vse::sequencer_add_sound_multiple_strips(), blender::ed::vse::sequencer_change_path_invoke(), blender::ed::vse::sequencer_copybuffer_filepath_get(), blender::ed::asset::set_filepath_for_asset_lib(), blender::seq::strip_doversion_250_sound_proxy_update_cb(), blender::seq::strip_open_anim_file(), blender::io::usd::temp_textures_dir(), blender::seq::thumbnail_cache_invalidate_strip(), blender::bke::bake::unpack_bake_to_disk(), unpack_generate_paths(), unpack_menu(), blender::io::hydra::USDSceneDelegate::USDSceneDelegate(), view3d_copybuffer_filepath_get(), wm_autosave_delete(), wm_autosave_location(), wm_block_splash_image(), WM_exit_ex(), WM_file_recover_last_session(), wm_history_file_read(), wm_history_file_write(), wm_homefile_read_ex(), wm_homefile_write_exec(), wm_id_linked_relocate_exec(), wm_lib_relocate_exec_do(), wm_link_append_exec(), wm_platform_support_check_approval(), workspace_config_file_read(), workspace_system_file_read(), blender::io::usd::world_material_to_dome_light(), blender::bke::bake::DiskBlobWriter::write(), and blender::bke::bake::DiskBlobWriter::write_as_stream().
| #define BLI_path_ncmp strncmp |
Definition at line 539 of file BLI_path_utils.hh.
Referenced by BKE_autoexec_match(), fsmenu_insert_entry(), get_proxy_filepath(), IMB_thumb_delete(), IMB_thumb_manage(), missing_files_find__recursive(), thumb_create_ex(), and WM_window_title().
| #define FILE_MAX 1024 |
Definition at line 668 of file BLI_path_utils.hh.
Referenced by absolute_convert_foreach_path_cb(), blender::seq::add_image_init_alpha_mode(), blender::seq::add_image_strip(), blender::seq::add_movie_strip(), blender::seq::add_reload_new_file(), appdir_app_template_directories(), blender::io::obj::append_frame_to_filename(), arg_handle_python_file_run(), blender::ed::asset::asset_bundle_install_exec(), blender::bke::asset_root_path_for_save(), blender::ed::asset::asset_tooltip(), blender::bke::asset_weak_reference_for_user_library(), autocomplete_directory(), autocomplete_file(), blender::ed::object::bake_simulation::bake_directory_has_data(), blender::ed::object::bake_simulation::bake_geometry_nodes_startjob(), blender::ed::object::bake_simulation::bake_simulation_get_path_users(), blender::ed::object::bake_targets_output_external(), MANTA::bakeData(), MANTA::bakeGuiding(), MANTA::bakeMesh(), MANTA::bakeNoise(), MANTA::bakeParticles(), BKE_appdir_app_template_has_userpref(), BKE_appdir_folder_id(), BKE_appdir_folder_id_user_notest(), BKE_appdir_resource_path_id_with_version(), BKE_blender_globals_crash_path_get(), BKE_blendfile_append(), BKE_blendfile_userdef_write_all(), BKE_bpath_foreach_path_allocated_process(), BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_bpath_foreach_path_fixed_process(), BKE_cachefile_eval(), BKE_cachefile_filepath_get(), BKE_image_get_tile_info(), BKE_image_load_exists_in_lib(), BKE_image_load_in_lib(), BKE_image_memorypack(), BKE_image_packfiles(), BKE_image_render_write(), BKE_image_save_options_init(), BKE_image_set_filepath_from_tile_number(), BKE_image_signal(), BKE_image_user_file_path_ex(), BKE_main_library_weak_reference_find(), BKE_memfile_undo_encode(), BKE_movieclip_file_add(), BKE_movieclip_file_add_exists_ex(), BKE_movieclip_filepath_for_frame(), BKE_packedfile_compare_to_file(), BKE_packedfile_new(), BKE_packedfile_unpack(), BKE_packedfile_unpack_to_file(), BKE_packedfile_write_to_file(), BKE_scene_multiview_filepath_get(), BKE_scene_multiview_view_filepath_get(), BKE_scene_undo_depsgraphs_restore(), BKE_sound_new_file(), BKE_sound_new_file_exists_ex(), BKE_text_file_modified_check(), BKE_text_file_modified_ignore(), BKE_text_load_ex(), BKE_text_reload(), BKE_vfont_load_exists_ex(), BKE_volume_load(), BlendfileLoadingBaseTest::blendfile_load(), blf_load_font_default(), BLI_change_working_dir(), BLI_dir_create_recursive(), BLI_file_ensure_parent_dir_exists(), BLI_file_is_writable(), BLI_path_abs(), BLI_path_abs(), BLI_path_rel(), blo_add_main_for_library(), blo_find_main_for_library_and_idname(), BLO_write_file_impl(), block_create__close_file_dialog(), block_create_save_file_overwrite_dialog(), bpy_lib_load(), bpy_lib_write(), BPY_python_start(), blender::ed::sculpt_paint::brush_asset_load_preview_exec(), build_pict_list_from_image_sequence(), blender::gpu::cache_dir_get(), blender::io::hydra::cache_image_file(), blender::io::hydra::cache_or_get_image_file(), cachefile_layer_add_exec(), cachefile_layer_open_invoke(), cachefile_open_exec(), cachefile_open_invoke(), blender::seq::check_media_missing(), blender::seq::check_sound_media_missing(), clip_drop_copy(), blender::ed::object::collection_exporter_export(), colormanagement_init(), blender::nodes::node_composite_file_output_cc::compute_image_path(), console_drop_path_copy(), blender::io::usd::copy_asset_to_directory(), copy_material_exec(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), blender::io::usd::copy_udim_asset_to_directory(), blender::io::alembic::create_archive(), blender::io::usd::create_temp_path_for_usdz_export(), customdata_external_filename(), CustomData_external_read(), CustomData_external_write(), detect_clip_source(), do_history(), do_makepicstring(), do_version_file_output_node(), do_versions_nodetree_multi_file_output_format_2_62_1(), do_write_image_or_movie(), blender::nodes::draw_common_bake_settings(), blender::ed::vse::draw_seq_text_get_overlay_string(), blender::ed::vse::draw_seq_text_overlay(), blender::ed::vse::draw_strip_in_view(), dynamicPaint_bakeImageSequence(), dynamicPaint_outputSurfaceImage(), ED_file_path_button(), ED_file_read_bookmarks(), ED_fileselect_ensure_default_filepath(), ED_image_filesel_detect_sequences(), blender::seq::effect_text_font_load(), blender::nodes::GeoNodeExecParams::ensure_absolute_path(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_multi_layer(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_single_layer(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_single_layer_multi_view_exr(), blender::bke::preferences::exists(), blender::io::usd::export_endjob_usdz_cleanup(), blender::io::stl::export_frame(), blender::io::usd::export_in_memory_imbuf(), blender::io::usd::export_in_memory_texture(), blender::io::usd::export_packed_texture(), blender::io::obj::exporter_main(), MANTA::exportLiquidScript(), MANTA::exportSmokeScript(), blender::io::fbx::FbxImportContext::FbxImportContext(), file_browse_exec(), file_browse_invoke(), file_directory_new_exec(), file_draw_check_exists(), file_draw_tooltip_custom_func(), file_execute(), file_filename_enter_handle(), file_handler_import_operator_write_ptr(), blender::bke::bake::file_name_to_frame(), file_operator_to_sfile(), FILE_OT_directory_new(), FILE_OT_filepath_drop(), file_select_do(), file_select_match(), file_sfile_to_operator(), file_sfile_to_operator_ex(), filelist_readjob_list_dir(), filepath_drop_exec(), blender::ed::io::filesel_drop_import_invoke(), fileselect_ensure_updated_file_params(), fluid_bake_startjob(), fluid_validatepaths(), font_open_exec(), blender::tests::font_path(), blender::bke::bake::frame_to_file_name(), Freestyle_Init(), blender::bke::bake::BakePath::from_single_root(), fsmenu_read_system(), fsmenu_write_file(), fsmenu_write_file_and_refresh_or_report_error(), fsmenu_xdg_user_dirs_parse(), blender::asset_system::AssetRepresentation::full_path(), blender::io::usd::get_absolute_path(), blender::bke::bake::get_blend_file_name(), blender::bke::bake::get_default_modifier_bake_directory(), blender::bke::bake::get_default_node_bake_directory(), blender::ed::vse::get_drag_path(), blender::ed::asset::index::BlendFile::get_filename(), blender::io::usd::get_image_cache_file(), blender::io::obj::get_image_filepath(), blender::io::usd::get_in_memory_texture_filename(), blender::bke::bake::get_modifier_bake_path(), blender::bke::bake::get_node_bake_path(), get_path_environment_ex(), blender::seq::get_path_from_strip(), get_path_local_ex(), get_path_system_ex(), get_path_user_ex(), get_proxy_filepath(), blender::ui::string_search::get_recent_searches_file_path(), blender::io::usd::get_relative_path(), get_sequence_filepath(), blender::io::usd::get_tex_image_asset_filepath(), blender::io::usd::get_tex_image_asset_filepath(), blender::io::usd::get_tex_image_asset_filepath(), get_thumb_dir(), get_udim_tiles(), Freestyle::StringUtils::getPathName(), handle_load_file(), image_abs_path(), blender::io::usd::image_cache_file_path(), image_file_browse_exec(), image_file_browse_invoke(), image_foreach_path(), image_init_color_management(), image_replace_exec(), image_save_sequence_exec(), image_save_single(), image_sequence_get_frame_ranges(), image_update_views_format(), IMB_colormanagement_space_to_icc_profile(), IMB_thumb_delete(), IMB_thumb_makedirs(), IMB_thumb_manage(), IMB_thumb_read(), blender::io::usd::import_asset(), blender::io::ply::import_mesh(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), blender::seq::index_dir_set(), blender::ed::asset::index::AssetLibraryIndex::init_indices_base_path(), blender::ed::object::is_smooth_by_angle_modifier(), lib_id_library_local_paths_callback(), lib_id_load_custom_preview_exec(), blender::ed::outliner::lib_relocate(), load_image_single(), load_movie_single(), blender::io::fbx::load_texture_image(), Freestyle::Controller::LoadMesh(), blender::tests::ChangeWorkingDirectoryTest::make_pseudo_unique_temp_filename(), material_copybuffer_filepath_get(), meshcache_do(), missing_files_find__recursive(), missing_files_find_foreach_path_cb(), MOV_get_existing_proxies(), MOV_proxy_builder_start(), movie_open_index(), movie_open_proxy(), movieclip_build_proxy_ibuf(), movieclip_calc_length(), movieclip_load_sequence_file(), movieclip_open_anim_file(), blender::io::obj::MTLParser::MTLParser(), blender::io::obj::MTLWriter::MTLWriter(), blender::ed::object::multires_external_save_exec(), blender::ed::object::multires_external_save_invoke(), blender::ed::outliner::namebutton_fn(), new_folder_path(), blender::ed::space_node::NODE_OT_add_import_node(), blender::ed::object::OBJECT_OT_bake(), blender::seq::open_anim_file_multiview(), open_exec(), open_invoke(), open_invoke(), blender::ed::outliner::outliner_copybuffer_filepath_get(), blender::ed::outliner::outliner_id_copy_exec(), blender::ed::outliner::outliner_id_paste_exec(), blender::nodes::node_composite_file_output_cc::output_path_layout(), PAINT_OT_image_from_view(), blender::io::usd::parent_dir_exists_on_file_system(), paste_material_exec(), blender::ed::io::paths_from_operator_properties(), blender::ed::io::paths_to_operator_properties(), blender::io::usd::perform_usdz_conversion(), playanim_toscreen_ex(), pose_copybuffer_filepath_get(), pose_paste_exec(), preferences_extension_repo_add_exec(), preferences_extension_repo_remove_exec(), preferences_extension_repo_remove_invoke(), prefetch_read_file_to_memory(), blender::io::usd::process_usdz_textures(), blender::seq::proxy_dir_get(), proxy_thread_next_frame(), python_script_exec(), RE_RenderAnim(), RE_RenderFrame(), blender::bke::bake::DiskBlobReader::read(), blender::io::grease_pencil::SVGImporter::read(), recursive_operation(), relative_convert_foreach_path_cb(), relative_rebase_foreach_path_cb(), renamebutton_cb(), render_result_exr_file_cache_path(), rigidbody_world_export_exec(), RNA_api_image(), RNA_api_scene_render(), rna_def_collection_exporter_data(), rna_def_depsgraph(), rna_def_fluid_domain_settings(), RNA_def_main(), RNA_def_main_movieclips(), RNA_def_main_sounds(), RNA_def_main_texts(), rna_def_render_result(), run_pyfile_exec(), save_set_filepath(), scene_undo_depsgraph_gen_key(), screen_opengl_render_anim_step(), screen_opengl_render_write(), screenshot_exec(), screenshot_invoke(), SCRIPT_OT_python_file_run(), blender::seq::seq_proxy_get_custom_file_filepath(), blender::seq::seq_proxy_index_dir_set(), blender::seq::seq_proxy_multiview_context_invalid(), blender::seq::seq_render_image_strip(), blender::seq::seq_render_image_strip_view(), sequence_guess_offset(), blender::ed::vse::sequencer_add_image_strip_load_files(), blender::ed::vse::sequencer_add_movie_multiple_strips(), blender::ed::vse::sequencer_add_sound_multiple_strips(), blender::ed::vse::sequencer_change_path_exec(), blender::ed::vse::sequencer_change_path_invoke(), blender::ed::vse::sequencer_clipboard_copy_exec(), blender::ed::vse::sequencer_clipboard_paste_exec(), blender::ed::vse::sequencer_copybuffer_filepath_get(), blender::ed::vse::sequencer_drop_copy(), blender::ed::vse::sequencer_export_subtitles_exec(), blender::ed::vse::sequencer_generic_invoke_path__internal(), blender::ed::vse::sequencer_image_strip_reserve_frames(), blender::ed::asset::set_filepath_for_asset_lib(), blender::tests::FileOpsTest::SetUp(), sig_handle_crash_fn(), sound_mixdown_exec(), blender::seq::strip_doversion_250_sound_proxy_update_cb(), blender::seq::strip_open_anim_file(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::io::obj::TEST(), blender::io::obj::TEST(), blender::io::obj::TEST(), blender::tests::TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_env_path(), blender::tests::TEST_F(), text_jump_to_file_at_point_exec(), text_jump_to_file_at_point_internal(), text_open_exec(), text_open_invoke(), TEXT_OT_jump_to_file_at_point(), text_save_as_exec(), text_save_as_invoke(), texture_paint_image_from_view_exec(), thumb_create_ex(), blender::seq::thumbnail_cache_invalidate_strip(), thumbpathname_from_uri(), txt_write_file(), ui_but_menu_add_path_operators(), ui_popup_context_menu_for_button(), ui_tooltip_from_clip(), ui_tooltip_from_image(), ui_tooltip_from_vfont(), uiTemplateMovieclipInformation(), uiTemplateRecentFiles_tooltip_func(), blender::bke::bake::unpack_bake_to_disk(), unpack_generate_paths(), blender::bke::bake::unpack_geometry_nodes_bake(), unpack_menu(), uri_from_filepath(), blender::io::usd::USD_path_abs(), blender::io::hydra::USDSceneDelegate::USDSceneDelegate(), user_frame_to_cache_frame(), blender::nodes::FileOutputItemsAccessor::validate_name(), version_escape_curly_braces_in_compositor_file_output_nodes(), view3d_copybuffer_exec(), view3d_copybuffer_filepath_get(), VIEW3D_OT_camera_background_image_add(), view3d_pastebuffer_exec(), blender::ed::object::volume_import_exec(), wm_autosave_delete(), wm_autosave_location(), WM_autosave_write(), wm_autosave_write_try(), wm_block_splash_image(), WM_exit_ex(), WM_file_autoexec_init(), WM_file_recover_last_session(), wm_file_write_check_with_report_on_failure(), wm_filepath_default(), wm_history_file_read(), wm_history_file_write(), wm_homefile_read_ex(), wm_homefile_read_exec(), wm_homefile_write_exec(), wm_homefile_write_invoke(), wm_id_linked_relocate_exec(), wm_lib_relocate_exec_do(), wm_link_append_exec(), wm_link_append_invoke(), wm_open_mainfile__open(), wm_open_mainfile_check(), wm_open_mainfile_get_description(), WM_operator_drop_load_path(), WM_operator_filesel_ensure_ext_imtype(), WM_operator_properties_filesel(), WM_OT_drop_import_file(), WM_OT_read_homefile(), wm_platform_support_check_approval(), wm_read_factory_settings_invoke(), wm_recover_auto_save_exec(), wm_recover_auto_save_invoke(), wm_revert_mainfile_exec(), wm_save_as_mainfile_exec(), wm_save_mainfile_check(), wm_userpref_read_invoke(), WM_window_title(), workspace_add_invoke(), workspace_append_activate_exec(), workspace_config_file_read(), WORKSPACE_OT_append_activate(), workspace_system_file_read(), blender::io::usd::world_material_to_dome_light(), blender::bke::bake::DiskBlobWriter::write(), blender::bke::bake::DiskBlobWriter::write_as_stream(), write_crash_blend(), blender::io::obj::MTLWriter::write_materials(), blender::io::obj::write_materials(), and write_result().
| #define FILE_MAXDIR 768 |
These values need to be hard-coded in structs, DNA does not recognize defines (also defined in DNA_space_types.h).
Some parts of the API which use FILE_MAX which aren't specifically handling blend file paths, in most cases these can be updated to use PATH_MAX or a platform specific limit.
Definition at line 666 of file BLI_path_utils.hh.
Referenced by AS_asset_library_find_suitable_root_path_from_path(), BKE_appdir_folder_default(), BKE_appdir_folder_documents(), BKE_appdir_font_folder_default(), BKE_image_get_tile_info(), BKE_image_tile_filepath_exists(), BKE_main_merge(), BKE_preferences_asset_library_default_add(), bli_builddir(), BLI_dir_free_space(), BLI_file_alias_target(), BLI_file_attributes(), blender::io::hydra::cache_or_get_image_file(), do_versions_nodetree_multi_file_output_format_2_62_1(), FILE_OT_select_bookmark(), filelist_cache_previews_push(), filelist_readjob_list_dir(), fluid_validatepaths(), folderlist_popdir(), fsmenu_read_bookmarks(), fsmenu_read_system(), fsmenu_xdg_insert_entry(), fsmenu_xdg_user_dirs_parse(), get_index_dir(), get_proxy_filepath(), get_tc_filepath(), image_foreach_path(), image_sequence_get_frame_ranges(), blender::io::usd::import_asset(), lib_id_library_local_paths_callback(), blender::ed::outliner::lib_relocate(), blender::io::obj::MTLParser::MTLParser(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), blender::io::usd::temp_textures_dir(), ui_but_menu_add_path_operators(), ui_popup_context_menu_for_button(), unpack_generate_paths(), unpack_menu(), wm_id_linked_relocate_exec(), wm_lib_relocate_exec_do(), wm_link_append_exec(), and blender::io::obj::OBJWriter::write_mtllib_name().
| #define FILE_MAXFILE 256 |
Definition at line 667 of file BLI_path_utils.hh.
Referenced by blender::bke::asset_blendfile_path_for_save(), BKE_image_get_tile_info(), BKE_studiolight_create(), BKE_studiolight_find(), BKE_vfont_load(), blender::io::usd::copy_tiled_textures(), do_versions_nodetree_multi_file_output_format_2_62_1(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), file_directory_new_exec(), file_draw_string(), file_panel_execution_buttons_draw(), filelist_readjob_recursive_dir_add_items(), filenum_newname(), fsmenu_read_bookmarks(), fsmenu_read_system(), blender::io::usd::get_asset_base_name(), blender::bke::FileHandlerType::get_default_filename(), get_index_dir(), get_proxy_filepath(), get_tc_filepath(), image_foreach_path(), lib_id_library_local_paths_callback(), new_folder_path(), blender::io::obj::OBJParser::parse(), preferences_asset_library_add_exec(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), blender::seq::seq_proxy_index_dir_set(), studiolight_add_file(), ui_but_menu_add_path_operators(), blender::io::hydra::USDSceneDelegate::USDSceneDelegate(), wm_filepath_default(), wm_save_as_mainfile_exec(), and blender::io::obj::OBJWriter::write_mtllib_name().
| #define FILENAME_CURRENT "." |
Definition at line 790 of file BLI_path_utils.hh.
Referenced by bli_builddir().
| #define FILENAME_IS_CURRENT | ( | _n | ) |
Definition at line 794 of file BLI_path_utils.hh.
Referenced by bli_builddir(), compare_direntry_generic(), and direntry_cmp().
| #define FILENAME_IS_CURRPAR | ( | _n | ) |
Definition at line 795 of file BLI_path_utils.hh.
Referenced by autocomplete_directory(), BKE_appdir_app_templates(), bli_builddir(), blender::bke::bake::directory_is_empty(), file_box_select_modal(), file_draw_list(), filelist_get_details_column_string(), filelist_readjob_list_dir(), filelist_readjob_should_recurse_into_entry(), is_filtered_file_type(), missing_files_find__recursive(), blender::bke::bake::pack_files_from_directory(), and recursive_operation_impl().
| #define FILENAME_IS_PARENT | ( | _n | ) |
Definition at line 793 of file BLI_path_utils.hh.
Referenced by bli_builddir(), compare_direntry_generic(), direntry_cmp(), file_execute(), file_select_do(), filelist_geticon_file_type_ex(), and filelist_geticon_special_file_image_ex().
| #define FILENAME_PARENT ".." |
Definition at line 789 of file BLI_path_utils.hh.
Referenced by bli_builddir(), and filelist_readjob_list_lib_navigate_to_parent_entry_create().
| #define SEP '/' |
Definition at line 728 of file BLI_path_utils.hh.
Referenced by blender::bke::asset_blendfile_path_for_save(), blender::bke::asset_root_path_for_save(), blender::bke::asset_write_in_library(), blf_font_wrap_apply(), bli_builddir(), BLI_path_canonicalize_native(), BLI_path_extension_or_end(), BLI_path_join_array(), BLI_path_slash_ensure_ex(), BLI_path_slash_is_native_compat(), BLI_path_slash_native(), bpy_text_filepath_get(), current_relpath_append(), file_expand_directory(), fsmenu_insert_entry(), path_normalize_impl(), blender::asset_system::AssetLibraryService::resolve_asset_weak_reference_to_exploded_path(), strbuf_append_path(), blender::tests::TEST(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), and WM_window_title().
| #define SEP_STR "/" |
Definition at line 730 of file BLI_path_utils.hh.
| BLI_INLINE size_t _BLI_path_join_10 | ( | _BLI_PATH_JOIN_ARGS_8 | ) |
Definition at line 438 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_8, ARRAY_SIZE, b, BLI_INLINE, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_11 | ( | _BLI_PATH_JOIN_ARGS_9 | ) |
Definition at line 443 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_9, ARRAY_SIZE, b, BLI_INLINE, BLI_path_join_array(), e, and i.
| BLI_INLINE size_t _BLI_path_join_12 | ( | _BLI_PATH_JOIN_ARGS_10 | ) |
Definition at line 448 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_10, ARRAY_SIZE, b, BLI_INLINE, BLI_path_join_array(), e, and i.
| BLI_INLINE size_t _BLI_path_join_3 | ( | _BLI_PATH_JOIN_ARGS_1 | ) |
Definition at line 403 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_1, ARRAY_SIZE, BLI_INLINE, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_4 | ( | _BLI_PATH_JOIN_ARGS_2 | ) |
Definition at line 408 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_2, ARRAY_SIZE, b, BLI_INLINE, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_5 | ( | _BLI_PATH_JOIN_ARGS_3 | ) |
Definition at line 413 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_3, ARRAY_SIZE, b, BLI_INLINE, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_6 | ( | _BLI_PATH_JOIN_ARGS_4 | ) |
Definition at line 418 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_4, ARRAY_SIZE, b, BLI_INLINE, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_7 | ( | _BLI_PATH_JOIN_ARGS_5 | ) |
Definition at line 423 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_5, ARRAY_SIZE, b, BLI_INLINE, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_8 | ( | _BLI_PATH_JOIN_ARGS_6 | ) |
Definition at line 428 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_6, ARRAY_SIZE, b, BLI_INLINE, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_9 | ( | _BLI_PATH_JOIN_ARGS_7 | ) |
Definition at line 433 of file BLI_path_utils.hh.
References _BLI_PATH_JOIN_ARGS_7, ARRAY_SIZE, b, BLI_INLINE, BLI_path_join_array(), and e.
| const char * BLI_getenv | ( | const char * | env | ) |
Get an environment variable, result has to be used immediately.
On windows #getenv gets its variables from a static copy of the environment variables taken at process start-up, causing it to not pick up on environment variables created during runtime. This function uses an alternative method to get environment variables that does pick up on runtime environment variables. The result will be UTF8 encoded.
Definition at line 1380 of file path_utils.cc.
References alloc_utf16_from_8(), alloc_utf_8_from_16(), ARRAY_SIZE, free(), and result.
Referenced by BLI_dir_home(), BLI_path_program_search(), BLI_setenv_if_new(), BLI_temp_directory_path_get(), BLT_lang_init(), BPY_python_start(), colormanagement_init(), fsmenu_read_system(), get_path_environment_multiple(), get_thumb_dir(), GHOST_WindowWin32::GHOST_WindowWin32(), imb_init_dds(), blender::locale::Info::Info(), restore_ld_preload(), test_env_path(), wm_block_splash_banner_image(), wm_block_splash_create(), and wm_block_splash_image().
| bool BLI_path_abs | ( | char | path[FILE_MAX], |
| const char * | basepath ) |
If path begins with //, strips that and replaces it with basepath directory.
| path | The path to convert. |
| basepath | The directory to base relative paths with. |
References ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, BLI_path_abs_from_cwd(), BLI_path_is_abs_from_cwd(), and FILE_MAX.
Referenced by absolute_convert_foreach_path_cb(), add_ibuf_for_tile(), blender::seq::add_image_init_alpha_mode(), blender::seq::add_image_strip(), blender::seq::add_movie_strip(), blender::seq::add_reload_new_file(), blender::ed::object::bake_simulation::bake_simulation_get_path_users(), BKE_bpath_foreach_path_allocated_process(), BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_bpath_foreach_path_fixed_process(), BKE_cachefile_filepath_get(), BKE_image_load_exists_in_lib(), BKE_image_save_options_init(), BKE_image_signal(), BKE_image_user_file_path_ex(), BKE_library_filepath_set(), BKE_main_library_weak_reference_find(), BKE_movieclip_file_add(), BKE_movieclip_file_add_exists_ex(), BKE_movieclip_filepath_for_frame(), BKE_packedfile_compare_to_file(), BKE_packedfile_new(), BKE_packedfile_unpack_to_file(), BKE_packedfile_write_to_file(), BKE_sound_new_file(), BKE_sound_new_file_exists_ex(), BKE_text_file_modified_check(), BKE_text_file_modified_ignore(), BKE_text_load_ex(), BKE_text_reload(), BKE_vfont_load_exists_ex(), blo_find_main_for_library_and_idname(), bookmark_select_exec(), bpy_lib_load(), bpy_lib_write(), blender::seq::check_media_missing(), blender::seq::check_sound_media_missing(), blender::ed::object::collection_exporter_export(), customdata_external_filename(), detect_clip_source(), direct_link_library(), do_makepicstring(), dynamicPaint_outputSurfaceImage(), ED_image_filesel_detect_sequences(), blender::seq::effect_text_font_load(), blender::nodes::GeoNodeExecParams::ensure_absolute_path(), file_browse_exec(), file_execute(), file_expand_directory(), file_filename_enter_handle(), file_operator_to_sfile(), file_parent_exec(), file_select_do(), filelist_readjob_recursive_dir_add_items(), filelist_setdir(), fileselect_ensure_updated_file_params(), fluid_bake_startjob(), fluid_validatepaths(), blender::io::usd::get_absolute_path(), blender::ed::vse::get_drag_path(), blender::bke::bake::get_modifier_bake_path(), blender::bke::bake::get_node_bake_path(), blender::seq::get_path_from_strip(), get_proxy_filepath(), get_sequence_filepath(), image_abs_path(), image_file_browse_exec(), image_file_browse_invoke(), image_save_options_from_op(), image_update_views_format(), blender::io::usd::import_asset(), blender::io::usd::import_startjob(), lib_id_library_local_paths_callback(), meshcache_do(), movieclip_open_anim_file(), blender::ed::outliner::namebutton_fn(), open_invoke(), open_invoke(), blender::io::path_reference(), blender::seq::proxy_dir_get(), ptcache_path(), blender::io::grease_pencil::SVGImporter::read(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), screenshot_exec(), blender::seq::seq_proxy_get_custom_file_filepath(), blender::seq::seq_proxy_get_filepath(), blender::seq::seq_proxy_multiview_context_invalid(), blender::seq::seq_render_image_strip(), blender::ed::vse::sequencer_generic_invoke_path__internal(), sound_mixdown_exec(), blender::seq::strip_doversion_250_sound_proxy_update_cb(), blender::seq::strip_open_anim_file(), text_jump_to_file_at_point_exec(), text_jump_to_file_at_point_internal(), text_open_invoke(), text_save_as_invoke(), blender::seq::thumbnail_cache_invalidate_strip(), txt_write_file(), ui_tooltip_from_vfont(), blender::bke::bake::unpack_geometry_nodes_bake(), blender::io::usd::USD_path_abs(), wm_id_linked_relocate_exec(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| bool BLI_path_abs_from_cwd | ( | char * | path, |
| size_t | path_maxncpy ) |
Checks for relative path, expanding them relative to the current working directory.
Definition at line 1229 of file path_utils.cc.
References BLI_current_working_dir(), BLI_path_is_abs_from_cwd(), BLI_path_join, BLI_string_debug_size_after_nil, PATH_MAX, printf, and STRNCPY().
Referenced by BLI_path_abs(), BLI_path_canonicalize_native(), BLI_temp_directory_path_copy_if_valid(), and where_am_i().
| size_t BLI_path_append | ( | char *__restrict | dst, |
| size_t | dst_maxncpy, | ||
| const char *__restrict | file ) |
Append a filename to a dir, ensuring slash separates.
References ATTR_NONNULL, and BLI_path_append().
Referenced by BLI_path_append(), blender::nodes::node_composite_file_output_cc::compute_image_path(), file_directory_enter_handle(), blender::ed::asset::index::AssetLibraryIndex::init_indices_base_path(), blender::io::usd::process_usdz_textures(), and blender::io::usd::world_material_to_dome_light().
| size_t size_t BLI_path_append_dir | ( | char *__restrict | dst, |
| size_t | dst_maxncpy, | ||
| const char *__restrict | dir ) |
A version of BLI_path_append that ensures a trailing slash if there is space in dst.
References ATTR_NONNULL, and BLI_path_append_dir().
Referenced by BLI_path_append_dir(), file_execute(), file_select_do(), and blender::io::usd::world_material_to_dome_light().
| void void void const char * BLI_path_basename | ( | const char * | path | ) |
Like Python's os.path.basename()
Definition at line 1790 of file path_utils.cc.
References BLI_path_slash_rfind().
Referenced by blender::bke::path_templates::VariableMap::add_filename_only(), blender::bke::path_templates::VariableMap::add_path_up_to_file(), blender::ed::asset::asset_bundle_install_exec(), blender::bke::asset_weak_reference_for_essentials(), BKE_blender_globals_crash_path_get(), BKE_image_add_from_imbuf(), BKE_image_ensure_tile_token(), BKE_image_is_filename_tokenized(), BKE_image_load_in_lib(), BKE_movieclip_file_add(), BKE_preferences_extension_remote_to_name(), BKE_sound_new_file(), BKE_text_load_ex(), BKE_volume_load(), blf_font_new_impl(), BLI_path_filename_ensure(), BLI_path_frame_get(), BLI_path_frame_strip(), BLI_path_split_dir_file(), BLI_path_split_dir_part(), BLI_path_split_file_part(), BLI_path_split_file_part(), blo_add_main_for_library(), blender::io::hydra::cache_or_get_image_file(), cachefile_open_exec(), blender::ed::object::collection_exporter_export(), blender::io::obj::OBJExportRegressionTest::compare_obj_export_to_golden(), blender::io::stl::STLExportTest::compare_to_golden(), blender::io::fbx::create_placeholder_image(), blender::io::obj::create_placeholder_image(), blender::io::usd::create_temp_path_for_usdz_export(), ensure_digits(), blender::io::stl::export_frame(), fileentry_uiname(), blender::io::obj::get_image_filepath(), import_file(), blender::io::ply::import_mesh(), blender::io::usd::import_startjob(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), blender::ed::vse::load_data_init_from_operator(), blender::io::obj::load_texture_image(), missing_files_find_foreach_path_cb(), blender::io::obj::OBJParser::parse(), path_destination_ensure_filename(), blender::io::path_reference(), preferences_extension_repo_add_exec(), report_duration(), report_duration(), report_duration(), blender::io::obj::OBJCurvesTest::run_nurbs_test(), blender::ed::asset::set_filepath_for_asset_lib(), text_jump_to_file_at_point_external(), uiTemplateImageInfo(), uiTemplateMovieclipInformation(), uiTemplateRecentFiles(), wm_autosave_location(), wm_save_as_mainfile_exec(), WM_window_title(), and blender::io::obj::MTLWriter::write_header().
| int BLI_path_canonicalize_native | ( | char * | path, |
| int | path_maxncpy ) |
Convert path to a canonical representation. This is intended for system paths (passed in as command-line arguments of via scripts) which are valid in that they resolve to a file/directory but could be CWD relative or contain redundant slashes that cause absolute/relative conversion to fail. (specifically the // prefix used by Blender).
Perform the following operations:
Definition at line 395 of file path_utils.cc.
References ALTSEP, BLI_path_abs_from_cwd(), BLI_path_normalize_native(), BLI_path_slash_is_native_compat(), BLI_path_slash_native(), and SEP.
Referenced by arg_handle_python_file_run(), BKE_appdir_program_path_init(), handle_load_file(), wm_open_mainfile__open(), wm_recover_auto_save_exec(), and wm_save_as_mainfile_exec().
| int BLI_path_cmp_normalized | ( | const char * | p1, |
| const char * | p2 ) |
Returns the result of BLI_path_cmp with both paths normalized and slashes made native.
Checking the normalized paths is not a guarantee the paths reference different files. An equivalent to Python's os.path.samefile could be supported for checking if paths point to the same location on the file-system (following symbolic-links).
References ATTR_WARN_UNUSED_RESULT.
Referenced by blender::io::usd::UsdExportTest::compare_blender_image_to_usd_image_shader(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), blender::io::usd::export_in_memory_imbuf(), blender::asset_system::PreferencesOnDiskAssetLibrary::library_reference(), blender::ed::object::bake_simulation::PathStringEquality::operator()(), operator==(), blender::io::path_reference_copy(), TEST(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), and blender::tests::TEST_F().
| bool BLI_path_contains | ( | const char * | container_path, |
| const char * | containee_path ) |
Return true only if #containee_path is contained in #container_path.
References ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, and BLI_path_contains().
Referenced by BKE_packedfile_pack_all_libraries(), BKE_preferences_asset_library_containing_path(), BLI_path_contains(), filelist_contains_main(), blender::ed::asset::is_contained_in_selected_asset_library(), blender::io::path_reference(), TEST(), and ui_tooltip_data_from_button_or_extra_icon().
| const char * BLI_path_extension | ( | const char * | filepath | ) |
Returns a pointer to the last extension (e.g. the position of the last period). Returns NULL if there is no extension.
Definition at line 1661 of file path_utils.cc.
References BLI_path_extension_or_end().
Referenced by BLI_path_extension_strip(), blender::ed::object::collection_exporter_export(), drop_extension_path_poll(), drop_extension_url_poll(), ED_text_is_syntax_highlight_supported(), blender::bke::file_handlers_poll_file_drop(), blender::bke::FileHandlerType::filter_supported_paths(), and TEST().
| bool BLI_path_extension_check | ( | const char * | path, |
| const char * | ext ) |
References ATTR_NONNULL, ATTR_SENTINEL, ATTR_WARN_UNUSED_RESULT, BLI_path_extension_check(), and BLI_path_extension_check_n().
Referenced by BKE_image_is_openexr(), BKE_image_render_write(), BLI_file_alias_target(), BLI_file_attributes(), BLI_path_extension_check(), blo_do_versions_300(), blender::io::usd::create_temp_path_for_usdz_export(), ED_path_extension_type(), blender::io::stl::export_frame(), Freestyle::Controller::InsertStyleModule(), studiolight_add_file(), and thumb_create_ex().
| bool BLI_path_extension_check_array | ( | const char * | path, |
| const char ** | ext_array ) |
References ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, and BLI_path_extension_check_array().
Referenced by BKE_blendfile_extension_check(), BKE_image_load_in_lib(), BLI_path_extension_check_array(), do_ensure_image_extension(), ED_path_extension_type(), image_replace_exec(), and studiolight_add_file().
| bool BLI_path_extension_check_glob | ( | const char * | path, |
| const char * | ext_fnmatch ) |
Semicolon separated wildcards, eg: *.zip;*.py;*.exe does path match any of the semicolon-separated glob patterns in #fnmatch.
References ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, BLI_path_extension_check_glob(), and BLI_path_extension_glob_validate().
Referenced by BKE_cachefile_eval(), BLI_path_extension_check_glob(), and filelist_readjob_list_dir().
| bool BLI_path_extension_check_n | ( | const char * | path, |
| ... ) |
Definition at line 1426 of file path_utils.cc.
References path_extension_check_ex(), and ret.
Referenced by BKE_image_alpha_mode_from_extension_ex(), blf_load_datafiles_dir(), BLI_path_extension_check(), ED_path_extension_type(), and blender::io::usd::set_job_filepath().
| bool BLI_path_extension_ensure | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | ext ) |
Strip's trailing '.'s and adds the extension only when needed
References ATTR_NONNULL, and BLI_path_extension_ensure().
Referenced by BKE_cachefile_filepath_get(), BLI_path_extension_ensure(), do_ensure_image_extension(), blender::io::stl::export_frame(), blender::ed::vse::frame_filename_set(), blender::bke::FileHandlerType::get_default_filename(), save_set_filepath(), blender::ed::vse::sequencer_export_subtitles_exec(), and wm_save_mainfile_check().
| bool BLI_path_extension_glob_validate | ( | char * | ext_fnmatch | ) |
Does basic validation of the given glob string, to prevent common issues from string truncation.
For now, only forbids last group to be a wildcard-only one, if there are more than one group (i.e. things like *.txt;*.cpp;* are changed to *.txt;*.cpp;)
Definition at line 1489 of file path_utils.cc.
Referenced by BLI_path_extension_check_glob(), and fileselect_ensure_updated_file_params().
| const char * BLI_path_extension_or_end | ( | const char * | filepath | ) |
Returns a pointer to the last extension (e.g. the position of the last period). Returns a pointer to the nil byte when no extension is found.
Definition at line 1624 of file path_utils.cc.
References ALTSEP, BLI_assert, and SEP.
Referenced by blender::bke::path_templates::VariableMap::add_filename_only(), BLI_path_extension(), BLI_path_extension_ensure(), BLI_path_extension_replace(), BLI_path_frame_get(), BLI_path_frame_strip(), BLI_path_sequence_decode(), BLI_path_suffix(), blender::io::hydra::cache_image_file(), and WM_window_title().
| bool BLI_path_extension_replace | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | ext ) |
Removes any existing extension on the end of path and appends ext.
References ATTR_NONNULL, BLI_path_extension_replace(), and BLI_path_extension_strip().
Referenced by blender::io::obj::append_frame_to_filename(), BKE_blender_globals_crash_path_get(), BLI_path_extension_replace(), blender::io::usd::create_temp_path_for_usdz_export(), do_ensure_image_extension(), ED_fileselect_ensure_default_filepath(), blender::io::obj::MTLWriter::MTLWriter(), and write_crash_blend().
| bool bool BLI_path_extension_strip | ( | char * | path | ) |
Remove the file extension.
Definition at line 1529 of file path_utils.cc.
References BLI_path_extension().
Referenced by blender::io::obj::append_frame_to_filename(), BKE_image_save_options_init(), BLI_path_extension_replace(), BLI_path_to_display_name(), filelist_readjob_list_dir(), blender::io::ply::import_mesh(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), blender::io::obj::OBJParser::parse(), ptcache_path(), render_result_exr_file_cache_path(), screenshot_invoke(), and blender::ed::object::volume_import_exec().
| bool BLI_path_filename_ensure | ( | char * | filepath, |
| size_t | filepath_maxncpy, | ||
| const char * | filename ) |
Ensure filepath has a file component, adding filename when it's empty or ends with a slash.
Referenced by wm_filepath_default().
| bool BLI_path_frame | ( | char * | path, |
| size_t | path_maxncpy, | ||
| int | frame, | ||
| int | digits ) |
Replaces "#" character sequence in last slash-separated component of path with frame as decimal integer, with leading zeroes as necessary, to make digits.
Definition at line 962 of file path_utils.cc.
References BLI_string_debug_size_after_nil, BLI_string_replace_range(), ensure_digits(), FILENAME_FRAME_CHARS_MAX, path_frame_chars_find_range(), and SNPRINTF.
Referenced by blender::io::obj::append_frame_to_filename(), BKE_cachefile_filepath_get(), blender::nodes::node_composite_file_output_cc::compute_image_path(), do_makepicstring(), dynamicPaint_bakeImageSequence(), blender::ed::vse::frame_filename_set(), get_proxy_filepath(), blender::ed::vse::sequencer_image_strip_reserve_frames(), and TEST().
| bool void bool BLI_path_frame_check_chars | ( | const char * | path | ) |
Check if we have '#' chars, usable for BLI_path_frame, BLI_path_frame_range
Definition at line 1059 of file path_utils.cc.
References path_frame_chars_find_range().
| bool BLI_path_frame_get | ( | const char * | path, |
| int * | r_frame, | ||
| int * | r_digits_len ) |
Get the frame from a filename formatted by blender's frame scheme
Referenced by BKE_cachefile_filepath_get(), blender::ed::vse::sequencer_add_image_strip_load_files(), blender::ed::vse::sequencer_image_strip_get_minmax_frame(), and volume_sequence_frame().
| bool BLI_path_frame_range | ( | char * | path, |
| size_t | path_maxncpy, | ||
| int | sta, | ||
| int | end, | ||
| int | digits ) |
Replaces "#" character sequence in last slash-separated component of path with sta and end as decimal integers, with leading zeroes as necessary, to make digits digits each, with a hyphen in-between.
Definition at line 982 of file path_utils.cc.
References BLI_string_debug_size_after_nil, BLI_string_replace_range(), ensure_digits(), FILENAME_FRAME_CHARS_MAX, path_frame_chars_find_range(), and SNPRINTF.
| bool void BLI_path_frame_strip | ( | char * | path, |
| char * | r_ext, | ||
| size_t | ext_maxncpy ) |
Given a path with digits representing frame numbers, replace the digits with the '#' character and extract the extension. So: /some/path_123.jpeg Becomes: /some/path_### with r_ext set to .jpeg.
References ATTR_WARN_UNUSED_RESULT.
Referenced by BKE_cachefile_filepath_get(), blender::ed::vse::sequencer_add_image_strip_load_files(), and blender::ed::vse::sequencer_image_strip_reserve_frames().
| bool BLI_path_has_hidden_component | ( | const char * | path | ) |
Return true if any path component starts with a dot.
Definition at line 2031 of file path_utils.cc.
References ELEM.
Referenced by BLI_path_split_file_part(), filelist_readjob_list_dir(), and TEST().
| bool BLI_path_is_abs_from_cwd | ( | const char * | path | ) |
Checks for a relative path (ignoring Blender's //) prefix (unlike !BLI_path_is_rel(path)). When false, BLI_path_abs_from_cwd would expand the absolute path.
Definition at line 1213 of file path_utils.cc.
Referenced by BLI_path_abs(), BLI_path_abs_from_cwd(), BLO_read_from_file(), BLO_write_file_impl(), can_create_dir_from_user_input(), filelist_checkdir_dir(), parent_dir_until_exists_or_default_root(), blender::tests::TEST(), and TEST().
| bool BLI_path_is_rel | ( | const char * | path | ) |
Does path begin with the special // prefix that Blender uses to indicate a path relative to the .blend file.
Definition at line 533 of file path_utils.cc.
Referenced by absolute_convert_foreach_path_cb(), autocomplete_directory(), BKE_image_get_ibuf_with_name(), BKE_image_signal(), BKE_image_tile_filepath_exists(), BKE_library_filepath_set(), BKE_packedfile_pack_all_libraries(), BLI_access(), bli_builddir(), BLI_delete(), BLI_delete_soft(), BLI_delete_soft(), BLI_exists(), BLI_fopen(), BLI_gzopen(), BLI_open(), BLI_path_abs(), BLI_path_cmp_normalized(), BLI_path_rel(), BLO_read_from_file(), BLO_write_file_impl(), current_relpath_append(), blender::nodes::draw_common_bake_settings(), ED_image_filesel_detect_sequences(), blender::nodes::GeoNodeExecParams::ensure_absolute_path(), file_browse_exec(), file_browse_invoke(), file_directory_enter_handle(), file_expand_directory(), file_handler_import_operator_write_ptr(), fix_relpaths_library(), fsmenu_insert_entry(), blender::bke::bake::get_modifier_bake_path(), blender::bke::bake::get_node_bake_path(), blender::io::usd::get_relative_path(), image_detect_frame_range(), image_file_browse_exec(), image_replace_invoke(), image_sequence_get_frame_ranges(), IMB_load_image_from_filepath(), IMB_save_image(), imb_test_image_read_header_from_filepath(), blender::io::usd::import_asset(), blender::io::usd::import_startjob(), lib_id_library_local_paths_callback(), missing_files_find__recursive(), missing_files_find_foreach_path_cb(), MOV_is_movie_file(), MOV_open_file(), blender::io::path_reference(), blender::io::usd::paths_equal(), blender::ed::io::paths_from_operator_properties(), blender::ed::io::paths_to_operator_properties(), ptcache_path(), pyrna_py_to_prop(), blender::io::usd::USDVolumeReader::read_object_data(), relative_convert_foreach_path_cb(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), blender::io::usd::should_import_asset(), TEST(), text_jump_to_file_at_point_exec(), text_jump_to_file_at_point_internal(), text_open_invoke(), text_save_as_invoke(), ui_item_with_label(), ui_tooltip_data_from_button_or_extra_icon(), blender::io::usd::USD_path_abs(), wm_id_linked_relocate_exec(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| bool BLI_path_is_unc | ( | const char * | path | ) |
Return true if the path is a UNC share.
Definition at line 538 of file path_utils.cc.
Referenced by BLI_path_rel(), BLI_path_unc_prefix_len(), can_create_dir_from_user_input(), file_expand_directory(), TEST(), and uri_from_filepath().
| bool BLI_path_is_win32_drive | ( | const char * | path | ) |
Definition at line 573 of file path_utils.cc.
Referenced by path_normalize_impl(), TEST(), and uri_from_filepath().
| bool BLI_path_is_win32_drive_only | ( | const char * | path | ) |
Definition at line 578 of file path_utils.cc.
Referenced by dir_create_recursive(), file_expand_directory(), and TEST().
| bool BLI_path_is_win32_drive_with_slash | ( | const char * | path | ) |
Definition at line 583 of file path_utils.cc.
References ELEM.
Referenced by BLI_path_abs(), and TEST().
| size_t BLI_path_join_array | ( | char *__restrict | dst, |
| const size_t | dst_maxncpy, | ||
| const char * | path_array[], | ||
| const int | path_array_num ) |
See BLI_path_join doc-string.
References ATTR_NONNULL, and BLI_path_join_array().
Referenced by _BLI_path_join_10(), _BLI_path_join_11(), _BLI_path_join_12(), _BLI_path_join_3(), _BLI_path_join_4(), _BLI_path_join_5(), _BLI_path_join_6(), _BLI_path_join_7(), _BLI_path_join_8(), _BLI_path_join_9(), BLI_path_join_array(), get_path_local_ex(), and test_path().
| bool BLI_path_make_safe | ( | char * | path | ) |
Make given path OS-safe.
Definition at line 499 of file path_utils.cc.
References BLI_path_make_safe_filename(), and BLI_path_slash_find().
Referenced by MANTA::bakeData(), MANTA::bakeGuiding(), MANTA::bakeMesh(), MANTA::bakeNoise(), MANTA::bakeParticles(), MANTA::exportLiquidScript(), MANTA::exportSmokeScript(), and file_directory_new_exec().
| bool BLI_path_make_safe_filename | ( | char * | filename | ) |
Definition at line 494 of file path_utils.cc.
References BLI_path_make_safe_filename_ex().
Referenced by blender::bke::asset_blendfile_path_for_save(), BKE_image_save_options_init(), BLI_path_make_safe(), eval_template(), blender::io::stl::export_frame(), blender::bke::FileHandlerType::get_default_filename(), IMB_colormanagement_space_to_icc_profile(), renamebutton_cb(), unpack_generate_paths(), and blender::nodes::FileOutputItemsAccessor::validate_name().
| bool BLI_path_make_safe_filename_ex | ( | char * | filename, |
| bool | allow_tokens ) |
Make given name safe to be used in paths.
| allow_tokens | Permit the usage of '<' and '>' characters. This can be leveraged by higher layers to support "virtual filenames" which contain substitution markers delineated between the two characters. |
For now, simply replaces reserved chars (as listed in https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words ) by underscores ('_').
Definition at line 418 of file path_utils.cc.
References BLI_str_tolower_ascii(), BLI_strdupn(), INVALID_CHARS, INVALID_TOKENS, len, and MEM_freeN().
Referenced by BLI_path_make_safe_filename(), and file_filename_enter_handle().
| bool BLI_path_name_at_index | ( | const char *__restrict | path, |
| int | index, | ||
| int *__restrict | r_offset, | ||
| int *__restrict | r_len ) |
Get an element of the path at an index, eg: /some/path/file.txt where an index of:
Ignored elements in the path:
Referenced by fsmenu_entry_generate_name().
| int BLI_path_normalize | ( | char * | path | ) |
Remove redundant characters from path.
The following operations are performed:
Details:
| path | The path to a file or directory which can be absolute or relative. |
Definition at line 374 of file path_utils.cc.
References path_normalize_impl().
Referenced by blender::bke::asset_root_path_for_save(), BKE_preferences_extension_repo_add(), BLI_path_abs(), BLI_path_cmp_normalized(), BLI_path_contains(), BLI_path_normalize_dir(), BLI_path_rel(), BLI_path_to_display_name(), blo_find_main_for_library_and_idname(), BLO_write_file_impl(), bpy_lib_load(), blender::io::usd::copy_asset_to_directory(), direct_link_library(), blender::io::usd::get_absolute_path(), Freestyle::StringUtils::getPathName(), blender::io::usd::import_asset(), lib_id_library_local_paths_callback(), blender::io::obj::load_image_at_path(), blender::io::fbx::load_texture_image(), Freestyle::Controller::LoadMesh(), blender::io::obj::MTLParser::MTLParser(), blender::asset_system::utils::normalize_path(), blender::ed::object::bake_simulation::PathStringHash::operator()(), blender::io::path_reference(), blender::ed::io::paths_from_operator_properties(), relative_rebase_foreach_path_cb(), blender::io::obj::MTLWriter::write_materials(), and blender::io::obj::write_materials().
| int BLI_path_normalize_dir | ( | char * | dir, |
| size_t | dir_maxncpy ) |
Cleanup file-path ensuring a trailing slash.
Definition at line 384 of file path_utils.cc.
References BLI_path_normalize(), and BLI_path_slash_ensure_ex().
Referenced by BLI_path_to_display_name(), bookmark_select_exec(), file_directory_enter_handle(), file_filename_enter_handle(), file_parent_exec(), file_select_do(), filelist_readjob_recursive_dir_add_items(), filelist_setdir(), fileselect_ensure_updated_file_params(), and blender::asset_system::utils::normalize_directory_path().
| int BLI_path_normalize_native | ( | char * | path | ) |
A version of BLI_path_normalize without special handling of // blend file relative prefix.
Definition at line 379 of file path_utils.cc.
References path_normalize_impl().
Referenced by BKE_main_merge(), BLI_path_canonicalize_native(), BLI_path_to_display_name(), file_execute(), get_path_local_ex(), and where_am_i().
| bool BLI_path_parent_dir | ( | char * | path | ) |
Go back one directory.
Replaces path with the path of its parent directory, returning true if it was able to find a parent directory within the path.
On success, the resulting path will always have a trailing slash.
Definition at line 866 of file path_utils.cc.
References BLI_assert, and BLI_path_name_at_index().
Referenced by blender::bke::path_templates::VariableMap::add_path_up_to_file(), BKE_preferences_asset_library_path_set(), bli_builddir(), BLI_path_parent_dir_until_exists(), can_create_dir_from_user_input(), file_execute(), file_parent_exec(), file_select_do(), and open_invoke().
| const char * BLI_path_parent_dir_end | ( | const char * | path, |
| size_t | path_len ) |
In the simple case this is similar to BLI_path_slash_rfind(dirname) however it behaves differently when there are redundant characters:
/test///dir/./file ^ /test/dir/subdir//file ^
Definition at line 839 of file path_utils.cc.
References BLI_path_slash_is_native_compat().
Referenced by dir_create_recursive(), and blender::io::fbx::load_texture_image().
| bool BLI_path_parent_dir_until_exists | ( | char * | path | ) |
Go back until the directory is found.
Strips off nonexistent (or non-accessible) sub-directories from the end of dir, leaving the path of the lowest-level directory that does exist and we can read.
Definition at line 892 of file path_utils.cc.
References BLI_access(), and BLI_path_parent_dir().
Referenced by can_create_dir_from_user_input(), and parent_dir_until_exists_or_default_root().
| bool BLI_path_program_search | ( | char * | program_filepath, |
| size_t | program_filepath_maxncpy, | ||
| const char * | program_name ) |
Search for a binary (executable)
References program_filepath.
Referenced by BKE_appdir_program_python_search(), and where_am_i().
| bool void BLI_path_rel | ( | char | path[FILE_MAX], |
| const char * | basepath ) |
Replaces path with a relative version (prefixed by //) such that BLI_path_abs, given the same basepath, will convert it back to its original value.
Definition at line 669 of file path_utils.cc.
References BLI_assert_msg, BLI_path_is_rel(), BLI_path_is_unc(), BLI_path_normalize(), BLI_path_slash_rfind(), BLI_path_unc_prefix_len(), BLI_string_debug_size_after_nil, BLI_string_replace_char(), BLI_strncpy(), BLI_strncpy_rlen(), BLI_strnlen(), BLI_windows_get_default_root_dir(), ELEM, FILE_MAX, STRNCPY(), and UNUSED_VARS.
Referenced by blender::bke::asset_weak_reference_for_user_library(), BKE_image_signal(), blender::nodes::draw_common_bake_settings(), blender::ed::vse::draw_strip_in_view(), ED_image_filesel_detect_sequences(), file_browse_exec(), file_handler_import_operator_write_ptr(), file_sfile_to_operator_ex(), filelist_readjob_recursive_dir_add_items(), fix_relpaths_library(), fluid_validatepaths(), blender::io::usd::get_relative_path(), image_file_browse_exec(), image_save_update_filepath(), blender::io::usd::import_startjob(), lib_id_library_local_paths_callback(), library_link_end(), blender::ed::vse::load_data_init_from_operator(), blender::io::obj::load_image_at_path(), missing_files_find_foreach_path_cb(), blender::ed::object::multires_external_save_exec(), open_exec(), blender::io::path_reference(), blender::ed::io::paths_from_operator_properties(), blender::ed::io::paths_to_operator_properties(), blender::io::usd::USDVolumeReader::read_object_data(), relative_convert_foreach_path_cb(), relative_rebase_foreach_path_cb(), blender::ed::vse::sequencer_change_path_exec(), blender::ed::object::volume_import_exec(), and WM_operator_drop_load_path().
| int BLI_path_sequence_decode | ( | const char * | path, |
| char * | head, | ||
| size_t | head_maxncpy, | ||
| char * | tail, | ||
| size_t | tail_maxncpy, | ||
| unsigned short * | r_digits_len ) |
Looks for a sequence of decimal digits in path, preceding any filename extension, returning the integer value if found, or 0 if not.
| path | String to scan. |
| head | Optional area to return copy of part of path prior to digits, or before dot if no digits. |
| tail | Optional area to return copy of part of path following digits, or from dot if no digits. |
| r_digits_len | Optional to return number of digits found. |
Definition at line 58 of file path_utils.cc.
References BLI_path_extension_or_end(), BLI_path_slash_rfind(), BLI_string_debug_size, BLI_strncpy(), i, and ret.
Referenced by BKE_image_sequence_guess_offset(), BKE_image_user_file_path_ex(), build_pict_list_from_image_sequence(), filenum_newname(), blender::io::obj::get_image_filepath(), get_sequence_filepath(), image_sequence_get_frame_ranges(), movieclip_calc_length(), put_imbuf_cache(), blender::io::usd::USDVolumeReader::read_object_data(), ui_do_but_text_value_cycle(), user_frame_to_cache_frame(), and wm_save_as_mainfile_exec().
| void BLI_path_sequence_encode | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | head, | ||
| const char * | tail, | ||
| unsigned short | numlen, | ||
| int | pic ) |
Returns in area pointed to by path a string of the form <head><pic><tail>, where pic is formatted as numlen digits with leading zeroes.
Definition at line 128 of file path_utils.cc.
References BLI_snprintf(), and BLI_string_debug_size.
Referenced by BKE_image_user_file_path_ex(), build_pict_list_from_image_sequence(), filenum_newname(), blender::io::obj::get_image_filepath(), get_sequence_filepath(), ui_do_but_text_value_cycle(), and wm_save_as_mainfile_exec().
| int BLI_path_slash_ensure | ( | char * | path, |
| size_t | path_maxncpy ) |
Appends a slash to path if there isn't one there already.
Definition at line 1952 of file path_utils.cc.
References BLI_path_slash_ensure_ex().
Referenced by blender::bke::asset_weak_reference_for_user_library(), autocomplete_directory(), BKE_blendfile_userdef_from_defaults(), BLI_path_append(), BLI_path_contains(), BLI_path_suffix(), BLI_temp_directory_path_copy_if_valid(), file_browse_exec(), file_browse_invoke(), file_sfile_to_operator_ex(), filelist_geticon_file_type_ex(), filelist_readjob_list_dir(), open_invoke(), blender::io::usd::process_usdz_textures(), ptcache_path(), tempdir_session_create(), blender::asset_system::tests::TEST_F(), and ui_but_menu_add_path_operators().
| int BLI_path_slash_ensure_ex | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const size_t | path_len ) |
Appends a slash to path if there isn't one there already.
| path_len | The length of path. |
Definition at line 1937 of file path_utils.cc.
References BLI_assert, BLI_path_slash_is_native_compat(), BLI_string_debug_size_after_nil, and SEP.
Referenced by BLI_path_append_dir(), BLI_path_normalize_dir(), BLI_path_slash_ensure(), and BLI_path_suffix().
| const char * BLI_path_slash_find | ( | const char * | path | ) |
Definition at line 1907 of file path_utils.cc.
Referenced by BKE_image_ensure_tile_token_filename_only(), BLI_path_make_safe(), blender::asset_system::AssetCatalogPath::iterate_components(), and TEST().
| BLI_INLINE bool BLI_path_slash_is_native_compat | ( | const char | ch | ) |
Return true if the slash can be used as a separator on this platform.
Definition at line 737 of file BLI_path_utils.hh.
References ALTSEP, BLI_INLINE, and SEP.
Referenced by bli_builddir(), BLI_dir_create_recursive(), BLI_path_canonicalize_native(), BLI_path_join_array(), BLI_path_parent_dir_end(), BLI_path_slash_ensure_ex(), BLI_path_slash_rstrip(), BLI_path_slash_skip(), dir_create_recursive(), path_has_trailing_slash(), path_len_no_trailing_slash(), path_name_at_index_backward(), path_name_at_index_forward(), and strbuf_append_path().
| void BLI_path_slash_native | ( | char * | path | ) |
Changes to the path separators to the native ones for this OS.
Definition at line 1980 of file path_utils.cc.
References ALTSEP, BLI_path_unc_prefix_len(), BLI_string_replace_char(), BLI_strnlen(), and SEP.
Referenced by blender::bke::asset_root_path_for_save(), BKE_preferences_extension_remote_to_name(), BLI_path_canonicalize_native(), BLI_path_cmp_normalized(), BLI_path_contains(), BLI_path_suffix(), clean_paths(), fileselect_refresh_asset_params(), foreach_path_clean_cb(), blender::ed::object::is_smooth_by_angle_modifier(), blender::asset_system::utils::normalize_directory_path(), blender::asset_system::utils::normalize_path(), blender::ed::object::bake_simulation::PathStringHash::operator()(), blender::asset_system::tests::AssetCatalogTest::save_from_memory_into_existing_asset_lib(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::io::obj::MTLWriter::write_materials(), and blender::io::obj::write_materials().
| const char * BLI_path_slash_rfind | ( | const char * | path | ) |
Definition at line 1922 of file path_utils.cc.
Referenced by BKE_blendfile_library_path_explode(), BLI_path_abs(), BLI_path_basename(), BLI_path_rel(), BLI_path_sequence_decode(), BLI_path_suffix(), file_browse_invoke(), groupname_to_code(), image_file_browse_invoke(), TEST(), where_am_i(), and wm_open_mainfile_check().
| void BLI_path_slash_rstrip | ( | char * | path | ) |
Removes the last slash and everything after it to the end of path, if there is one.
Definition at line 1957 of file path_utils.cc.
References BLI_path_slash_is_native_compat(), and len.
Referenced by BKE_preferences_extension_repo_add(), BLI_path_cmp_normalized(), BLI_path_suffix(), file_path_to_ui_path(), blender::ed::object::bake_simulation::PathStringHash::operator()(), path_destination_ensure_filename(), preferences_asset_library_add_exec(), and preferences_extension_repo_add_exec().
| const char * BLI_path_slash_skip | ( | const char * | path | ) |
Definition at line 1971 of file path_utils.cc.
References BLI_path_slash_is_native_compat().
Referenced by BLI_path_abs(), BLI_path_suffix(), and uri_from_filepath().
| void BLI_path_split_dir_file | ( | const char * | filepath, |
| char * | dir, | ||
| size_t | dir_maxncpy, | ||
| char * | file, | ||
| size_t | file_maxncpy ) |
Copies directory and file components from filepath into dir and file, e.g. /foo/bar.txt to /foo/ and bar.txt
References ATTR_NONNULL, and BLI_path_split_dir_file().
Referenced by blender::seq::add_movie_strip(), blender::ed::asset::asset_tooltip(), BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_image_get_tile_info(), BLI_path_split_dir_file(), clip_drop_copy(), do_version_file_output_node(), do_versions_nodetree_multi_file_output_format_2_62_1(), file_directory_enter_handle(), file_execute(), file_operator_to_sfile(), file_sfile_filepath_set(), fileselect_ensure_updated_file_params(), get_index_dir(), get_proxy_filepath(), blender::ed::outliner::lib_relocate(), blender::io::usd::perform_usdz_conversion(), render_result_exr_file_cache_path(), blender::ed::vse::sequencer_drop_copy(), TEST(), ui_but_menu_add_path_operators(), uiTemplateRecentFiles_tooltip_func(), unpack_generate_paths(), and blender::io::obj::OBJWriter::write_mtllib_name().
| void void BLI_path_split_dir_part | ( | const char * | filepath, |
| char * | dir, | ||
| size_t | dir_maxncpy ) |
Copies the parent directory part of filepath into dir, max length dir_maxncpy.
References ATTR_NONNULL, and BLI_path_split_dir_part().
Referenced by AS_asset_library_find_suitable_root_path_from_path(), autocomplete_directory(), BKE_appdir_program_path_init(), BKE_image_tile_filepath_exists(), BKE_main_merge(), BLI_file_ensure_parent_dir_exists(), BLI_file_is_writable(), BLI_path_split_dir_part(), BLO_write_file_impl(), cachefile_layer_open_invoke(), cachefile_open_invoke(), blender::io::obj::OBJExportRegressionTest::compare_obj_export_to_golden(), blender::io::usd::export_endjob_usdz_cleanup(), blender::io::fbx::FbxImportContext::FbxImportContext(), file_draw_tooltip_custom_func(), file_handler_import_operator_write_ptr(), file_sfile_filepath_set(), fileselect_initialize_params_common(), blender::asset_system::AssetCatalogService::find_suitable_cdf_path_for_writing(), blender::io::usd::get_relative_path(), blender::io::usd::get_tex_image_asset_filepath(), image_foreach_path(), image_save_sequence_exec(), blender::io::obj::MTLParser::MTLParser(), blender::io::usd::parent_dir_exists_on_file_system(), blender::ed::io::paths_to_operator_properties(), blender::ed::vse::sequencer_add_image_strip_exec(), ui_popup_context_menu_for_button(), ui_tooltip_from_clip(), ui_tooltip_from_image(), WM_file_autoexec_init(), wm_link_append_invoke(), blender::io::usd::world_material_to_dome_light(), blender::io::obj::MTLWriter::write_materials(), blender::io::obj::write_materials(), and blender::asset_system::AssetCatalogDefinitionFile::write_to_disk_unsafe().
| void void void BLI_path_split_file_part | ( | const char * | filepath, |
| char * | file, | ||
| size_t | file_maxncpy ) |
Copies the leaf filename part of filepath into file, max length file_maxncpy.
References ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, BLI_path_basename(), BLI_path_has_hidden_component(), and BLI_path_split_file_part().
Referenced by BKE_studiolight_create(), BKE_vfont_load(), BLI_path_split_file_part(), block_create__close_file_dialog(), block_create_save_file_overwrite_dialog(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), blender::ed::vse::draw_strip_in_view(), blender::io::usd::export_in_memory_texture(), blender::io::usd::export_packed_texture(), blender::io::usd::get_asset_base_name(), blender::bke::bake::get_blend_file_name(), blender::ed::asset::index::BlendFile::get_filename(), blender::io::usd::get_in_memory_texture_filename(), blender::io::usd::get_tex_image_asset_filepath(), image_foreach_path(), MOV_get_filename(), blender::io::usd::perform_usdz_conversion(), preferences_asset_library_add_exec(), ptcache_path(), blender::io::grease_pencil::SVGImporter::read(), blender::ed::vse::sequencer_add_image_strip_exec(), blender::ed::vse::sequencer_add_image_strip_load_files(), studiolight_add_file(), unpack_menu(), blender::ed::object::volume_import_exec(), and blender::io::usd::world_material_to_dome_light().
| bool bool BLI_path_suffix | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | suffix, | ||
| const char * | sep ) |
Appends a suffix to the path, fitting it before the extension
path = Foo.png, suffix = 123, separator = _. Foo.png -> Foo_123.png.
| path | original (and final) string. |
| path_maxncpy | Maximum length of path. |
| suffix | String to append to the original path. |
| sep | Optional separator character. |
References ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, BLI_path_slash_ensure(), BLI_path_slash_ensure_ex(), BLI_path_slash_native(), BLI_path_slash_rfind(), BLI_path_slash_rstrip(), and BLI_path_slash_skip().
Referenced by blender::ed::object::bake_targets_output_external(), BKE_image_memorypack(), BKE_scene_multiview_filepath_get(), BKE_scene_multiview_view_filepath_get(), do_makepicstring(), and blender::io::stl::export_frame().
| void BLI_path_to_display_name | ( | char * | display_name, |
| int | display_name_maxncpy, | ||
| const char * | name ) |
Creates a display string from path to be used menus and the user interface. Like bpy.path.display_name().
The resulting path is guaranteed to be valid UTF8, even if the input path is not.
References ATTR_NONNULL, BLI_path_normalize(), BLI_path_normalize_dir(), BLI_path_normalize_native(), BLI_path_to_display_name(), and name.
Referenced by BLI_path_to_display_name(), blender::io::usd::import_startjob(), wm_homefile_write_invoke(), wm_read_factory_settings_invoke(), wm_userpref_read_invoke(), and workspace_add_invoke().
| void BLI_setenv | ( | const char * | env, |
| const char * | val ) |
Sets the specified environment variable to the specified value, and clears it if val == NULL.
Definition at line 1357 of file path_utils.cc.
References uputenv().
Referenced by arg_handle_env_system_set(), BLI_setenv_if_new(), BPY_python_start(), colormanagement_init(), blender::gpu::VKBackend::is_supported(), and restore_ld_preload().
| void BLI_setenv_if_new | ( | const char * | env, |
| const char * | val ) |
Only set an environment variable if already not there. Like Unix setenv(env, val, 0);
(not used anywhere).
Definition at line 1373 of file path_utils.cc.
References BLI_getenv(), and BLI_setenv().
| bool ATTR_WARN_UNUSED_RESULT |
Definition at line 34 of file BLI_path_utils.hh.