Blender  V2.93
Typedefs | Enumerations | Functions
BKE_bpath.h File Reference

Go to the source code of this file.

Typedefs

typedef bool(* BPathVisitor) (void *userdata, char *path_dst, const char *path_src)
 

Enumerations

enum  {
  BKE_BPATH_TRAVERSE_ABS = (1 << 0) , BKE_BPATH_TRAVERSE_SKIP_LIBRARY = (1 << 1) , BKE_BPATH_TRAVERSE_SKIP_PACKED = (1 << 2) , BKE_BPATH_TRAVERSE_SKIP_MULTIFILE = (1 << 3) ,
  BKE_BPATH_TRAVERSE_RELOAD_EDITED = (1 << 4)
}
 

Functions

void BKE_bpath_traverse_id (struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
 
void BKE_bpath_traverse_id_list (struct Main *bmain, struct ListBase *lb, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
 
void BKE_bpath_traverse_main (struct Main *bmain, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
 
bool BKE_bpath_relocate_visitor (void *oldbasepath, char *path_dst, const char *path_src)
 
void * BKE_bpath_list_backup (struct Main *bmain, const int flag)
 
void BKE_bpath_list_restore (struct Main *bmain, const int flag, void *ls_handle)
 
void BKE_bpath_list_free (void *ls_handle)
 
void BKE_bpath_missing_files_check (struct Main *bmain, struct ReportList *reports)
 
void BKE_bpath_missing_files_find (struct Main *bmain, const char *searchpath, struct ReportList *reports, const bool find_all)
 
void BKE_bpath_relative_rebase (struct Main *bmain, const char *basedir_src, const char *basedir_dst, struct ReportList *reports)
 
void BKE_bpath_relative_convert (struct Main *bmain, const char *basedir, struct ReportList *reports)
 
void BKE_bpath_absolute_convert (struct Main *bmain, const char *basedir, struct ReportList *reports)
 

Detailed Description

Attention
Based on ghash, difference is ghash is not a fixed size, so for BPath we don't need to malloc

Definition in file BKE_bpath.h.

Typedef Documentation

◆ BPathVisitor

typedef bool(* BPathVisitor) (void *userdata, char *path_dst, const char *path_src)

Definition at line 36 of file BKE_bpath.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BKE_BPATH_TRAVERSE_ABS 
BKE_BPATH_TRAVERSE_SKIP_LIBRARY 
BKE_BPATH_TRAVERSE_SKIP_PACKED 
BKE_BPATH_TRAVERSE_SKIP_MULTIFILE 
BKE_BPATH_TRAVERSE_RELOAD_EDITED 

Definition at line 59 of file BKE_bpath.h.

Function Documentation

◆ BKE_bpath_absolute_convert()

void BKE_bpath_absolute_convert ( struct Main bmain,
const char *  basedir,
struct ReportList reports 
)

◆ BKE_bpath_list_backup()

void* BKE_bpath_list_backup ( struct Main bmain,
const int  flag 
)

Definition at line 873 of file bpath.c.

References BKE_bpath_traverse_main(), bpath_list_append(), and MEM_callocN.

Referenced by BKE_blendfile_write_partial(), and BLO_write_file().

◆ BKE_bpath_list_free()

void BKE_bpath_list_free ( void *  ls_handle)

Definition at line 889 of file bpath.c.

References BLI_assert, BLI_freelistN(), BLI_listbase_is_empty(), and MEM_freeN.

Referenced by BKE_blendfile_write_partial(), and BLO_write_file().

◆ BKE_bpath_list_restore()

void BKE_bpath_list_restore ( struct Main bmain,
const int  flag,
void *  ls_handle 
)

Definition at line 882 of file bpath.c.

References BKE_bpath_traverse_main(), and bpath_list_restore().

Referenced by BKE_blendfile_write_partial(), and BLO_write_file().

◆ BKE_bpath_missing_files_check()

void BKE_bpath_missing_files_check ( struct Main bmain,
struct ReportList reports 
)

◆ BKE_bpath_missing_files_find()

void BKE_bpath_missing_files_find ( struct Main bmain,
const char *  searchpath,
struct ReportList reports,
const bool  find_all 
)

◆ BKE_bpath_relative_convert()

void BKE_bpath_relative_convert ( struct Main bmain,
const char *  basedir,
struct ReportList reports 
)

◆ BKE_bpath_relative_rebase()

void BKE_bpath_relative_rebase ( struct Main bmain,
const char *  basedir_src,
const char *  basedir_dst,
struct ReportList reports 
)

◆ BKE_bpath_relocate_visitor()

bool BKE_bpath_relocate_visitor ( void *  pathbase_v,
char *  path_dst,
const char *  path_src 
)

Rewrites a relative path to be relative to the main file - unless the path is absolute, in which case it is not altered.

Definition at line 797 of file bpath.c.

References BLI_path_abs(), BLI_path_is_rel(), BLI_path_normalize(), BLI_path_rel(), BLI_strncpy(), CLOG_ERROR, FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, and LOG.

Referenced by lib_id_library_local_paths().

◆ BKE_bpath_traverse_id()

void BKE_bpath_traverse_id ( Main bmain,
ID id,
BPathVisitor  visit_cb,
const int  flag,
void *  bpath_user_data 
)

Run visitor function 'visit' on all paths contained in 'id'.

Definition at line 540 of file bpath.c.

References BKE_BPATH_TRAVERSE_ABS, BKE_BPATH_TRAVERSE_RELOAD_EDITED, BKE_BPATH_TRAVERSE_SKIP_LIBRARY, BKE_BPATH_TRAVERSE_SKIP_MULTIFILE, BKE_BPATH_TRAVERSE_SKIP_PACKED, BKE_image_has_packedfile(), BKE_image_is_dirty(), BKE_image_signal(), BKE_library_filepath_set(), BKE_vfont_is_builtin(), BPATH_TRAVERSE_POINTCACHE, FluidDomainSettings::cache_directory, OceanModifierData::cachepath, Strip::dir, FluidModifierData::domain, Scene::ed, ELEM, eModifierType_Cloth, eModifierType_Fluid, eModifierType_Fluidsim, eModifierType_MeshCache, eModifierType_Ocean, CustomData::external, CustomDataExternal::filename, CacheFile::filepath, Image::filepath, MeshCacheModifierData::filepath, MovieClip::filepath, NodeShaderScript::filepath, NodeShaderTexIES::filepath, bSound::filepath, Volume::filepath, ListBase::first, FluidsimModifierData::fss, GS, Brush::icon_filepath, id, ID_BLEND_PATH, ID_BR, ID_CF, ID_IM, ID_IS_LINKED, ID_LI, ID_MA, ID_MC, ID_ME, ID_NT, ID_OB, ID_SCE, ID_SO, ID_TXT, ID_VF, ID_VO, IMA_SIGNAL_RELOAD, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMA_SRC_TILED, Mesh::ldata, len, lib, MEM_allocN_len, MIN2, MOD_FLUID_TYPE_DOMAIN, Object::modifiers, StripElem::name, ID::name, ModifierData::next, ParticleSystem::next, node, bNodeTree::nodes, Material::nodetree, ntree, NTREE_SHADER, NULL, bSound::packedfile, VFont::packedfile, Volume::packedfile, Object::particlesystem, ClothModifierData::ptcaches, SoftBody_Shared::ptcaches, ParticleSystem::ptcaches, rewrite_path_alloc(), rewrite_path_fixed(), rewrite_path_fixed_dirfile(), scene, SEQ_ALL_BEGIN, SEQ_ALL_END, SEQ_HAS_PATH, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM, SH_NODE_SCRIPT, SH_NODE_TEX_IES, SoftBody::shared, Object::soft, Image::source, Sequence::strip, Strip::stripdata, FluidsimSettings::surfdataPath, ModifierData::type, FluidModifierData::type, bNodeTree::type, and Sequence::type.

Referenced by BKE_bpath_traverse_id_list(), and lib_id_library_local_paths().

◆ BKE_bpath_traverse_id_list()

void BKE_bpath_traverse_id_list ( struct Main bmain,
struct ListBase lb,
BPathVisitor  visit_cb,
const int  flag,
void *  bpath_user_data 
)

Definition at line 772 of file bpath.c.

References BKE_bpath_traverse_id(), ListBase::first, id, and ID::next.

Referenced by BKE_bpath_traverse_main().

◆ BKE_bpath_traverse_main()

void BKE_bpath_traverse_main ( struct Main bmain,
BPathVisitor  visit_cb,
const int  flag,
void *  bpath_user_data 
)