Blender V2.61 - r43446
|
#include <sys/stat.h>
#include <string.h>
#include <assert.h>
#include <dirent.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
#include "DNA_image_types.h"
#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_object_fluidsim.h"
#include "DNA_object_force.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
#include "DNA_text_types.h"
#include "DNA_texture_types.h"
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
#include "DNA_smoke_types.h"
#include "BLI_blenlib.h"
#include "BLI_bpath.h"
#include "BLI_utildefines.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_sequencer.h"
#include "BKE_utildefines.h"
#include "BKE_image.h"
Go to the source code of this file.
Classes | |
struct | BPathRemap_Data |
struct | BPathFind_Data |
Defines | |
#define | MAX_RECUR 16 |
#define | BPATH_TRAVERSE_POINTCACHE(ptcaches) |
Typedefs | |
typedef struct BPathRemap_Data | BPathRemap_Data |
typedef struct BPathFind_Data | BPathFind_Data |
Functions | |
static int | checkMissingFiles_visit_cb (void *userdata, char *UNUSED(path_dst), const char *path_src) |
void | checkMissingFiles (Main *bmain, ReportList *reports) |
static int | makeFilesRelative_visit_cb (void *userdata, char *path_dst, const char *path_src) |
void | makeFilesRelative (Main *bmain, const char *basedir, ReportList *reports) |
static int | makeFilesAbsolute_visit_cb (void *userdata, char *path_dst, const char *path_src) |
void | makeFilesAbsolute (Main *bmain, const char *basedir, ReportList *reports) |
static int | findFileRecursive (char *filename_new, const char *dirname, const char *filename, int *filesize, int *recur_depth) |
static int | findMissingFiles_visit_cb (void *userdata, char *path_dst, const char *path_src) |
void | findMissingFiles (Main *bmain, const char *searchpath, ReportList *reports) |
static int | rewrite_path_fixed (char *path, BPathVisitor visit_cb, const char *absbase, void *userdata) |
static int | rewrite_path_fixed_dirfile (char path_dir[FILE_MAXDIR], char path_file[FILE_MAXFILE], BPathVisitor visit_cb, const char *absbase, void *userdata) |
static int | rewrite_path_alloc (char **path, BPathVisitor visit_cb, const char *absbase, void *userdata) |
void | bpath_traverse_id (Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data) |
void | bpath_traverse_id_list (Main *bmain, ListBase *lb, BPathVisitor visit_cb, const int flag, void *bpath_user_data) |
void | bpath_traverse_main (Main *bmain, BPathVisitor visit_cb, const int flag, void *bpath_user_data) |
int | bpath_relocate_visitor (void *pathbase_v, char *path_dst, const char *path_src) |
Definition in file bpath.c.
#define BPATH_TRAVERSE_POINTCACHE | ( | ptcaches | ) |
{ \ PointCache *cache; \ for(cache= (ptcaches).first; cache; cache= cache->next) { \ if(cache->flag & PTCACHE_DISK_CACHE) { \ rewrite_path_fixed(cache->path, \ visit_cb, \ absbase, \ bpath_user_data); \ } \ } \ } \
Referenced by bpath_traverse_id().
#define MAX_RECUR 16 |
Definition at line 201 of file bpath.c.
Referenced by findFileRecursive().
typedef struct BPathFind_Data BPathFind_Data |
typedef struct BPathRemap_Data BPathRemap_Data |
int bpath_relocate_visitor | ( | void * | pathbase_v, |
char * | path_dst, | ||
const char * | path_src | ||
) |
Definition at line 585 of file bpath.c.
References BLI_cleanup_file(), BLI_path_abs(), BLI_path_rel(), BLI_strncpy(), FALSE, FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, and TRUE.
Referenced by BKE_id_lib_local_paths().
void bpath_traverse_id | ( | Main * | bmain, |
ID * | id, | ||
BPathVisitor | visit_cb, | ||
const int | flag, | ||
void * | bpath_user_data | ||
) |
Definition at line 371 of file bpath.c.
References BKE_library_filepath_set(), BPATH_TRAVERSE_ABS, BPATH_TRAVERSE_POINTCACHE, BPATH_TRAVERSE_SKIP_LIBRARY, BPATH_TRAVERSE_SKIP_MULTIFILE, BPATH_TRAVERSE_SKIP_PACKED, OceanModifierData::cachepath, Strip::dir, SmokeModifierData::domain, Scene::ed, ELEM, ELEM3, eModifierType_Cloth, eModifierType_Fluidsim, eModifierType_Ocean, eModifierType_Smoke, CustomData::external, Mesh::fdata, VoxelData::file_format, CustomDataExternal::filename, ListBase::first, Object::fluidsimSettings, FO_BUILTIN_NAME, FluidsimModifierData::fss, GS, i, Brush::icon_filepath, ID_BLEND_PATH, ID_BR, ID_IM, ID_LI, ID_MC, ID_ME, ID_OB, ID_SCE, ID_SO, ID_TE, ID_TXT, ID_VF, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, len(), MEM_allocN_len(), MIN2, MOD_SMOKE_TYPE_DOMAIN, Object::modifiers, Library::name, MovieClip::name, PluginSeq::name, bSound::name, StripElem::name, ID::name, Image::name, VFont::name, ModifierData::next, ParticleSystem::next, NULL, Image::packedfile, bSound::packedfile, VFont::packedfile, Object::particlesystem, Sequence::plugin, Tex::plugin, SoftBody::ptcaches, SmokeDomainSettings::ptcaches, ParticleSystem::ptcaches, ClothModifierData::ptcaches, rewrite_path_alloc(), rewrite_path_fixed(), rewrite_path_fixed_dirfile(), SEQ_BEGIN, SEQ_END, SEQ_HAS_PATH, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND, Object::soft, Image::source, VoxelData::source_path, Sequence::strip, Strip::stripdata, FluidsimSettings::surfdataPath, TEX_VD_IS_SOURCE_PATH, TEX_VOXELDATA, ModifierData::type, SmokeModifierData::type, Tex::type, Sequence::type, and Tex::vd.
Referenced by BKE_id_lib_local_paths(), and bpath_traverse_id_list().
void bpath_traverse_id_list | ( | Main * | bmain, |
ListBase * | lb, | ||
BPathVisitor | visit_cb, | ||
const int | flag, | ||
void * | bpath_user_data | ||
) |
Definition at line 568 of file bpath.c.
References bpath_traverse_id(), ListBase::first, and ID::next.
Referenced by bpath_traverse_main().
void bpath_traverse_main | ( | Main * | bmain, |
BPathVisitor | visit_cb, | ||
const int | flag, | ||
void * | bpath_user_data | ||
) |
Definition at line 576 of file bpath.c.
References bpath_traverse_id_list(), MAX_LIBARRAY, and set_listbasepointers().
Referenced by bpy_blend_paths(), checkMissingFiles(), clean_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
void checkMissingFiles | ( | Main * | bmain, |
ReportList * | reports | ||
) |
Definition at line 95 of file bpath.c.
References BPATH_TRAVERSE_ABS, bpath_traverse_main(), and checkMissingFiles_visit_cb().
Referenced by report_missing_files_exec().
static int checkMissingFiles_visit_cb | ( | void * | userdata, |
char * | UNUSEDpath_dst, | ||
const char * | path_src | ||
) | [static] |
Definition at line 83 of file bpath.c.
References BKE_reportf(), BLI_exists(), FALSE, and RPT_WARNING.
Referenced by checkMissingFiles().
static int findFileRecursive | ( | char * | filename_new, |
const char * | dirname, | ||
const char * | filename, | ||
int * | filesize, | ||
int * | recur_depth | ||
) | [static] |
Definition at line 202 of file bpath.c.
References BLI_join_dirfile(), BLI_strncpy(), FILE_MAX, MAX_RECUR, NULL, and size().
Referenced by findMissingFiles_visit_cb().
void findMissingFiles | ( | Main * | bmain, |
const char * | searchpath, | ||
ReportList * | reports | ||
) |
Definition at line 286 of file bpath.c.
References BLI_split_dir_part(), bpath_traverse_main(), findMissingFiles_visit_cb(), NULL, BPathFind_Data::reports, and BPathFind_Data::searchdir.
Referenced by find_missing_files_exec().
static int findMissingFiles_visit_cb | ( | void * | userdata, |
char * | path_dst, | ||
const char * | path_src | ||
) | [static] |
Definition at line 262 of file bpath.c.
References BKE_reportf(), BLI_path_basename(), data, FALSE, FILE_MAX, findFileRecursive(), BPathFind_Data::reports, RPT_WARNING, BPathFind_Data::searchdir, and TRUE.
Referenced by findMissingFiles().
void makeFilesAbsolute | ( | Main * | bmain, |
const char * | basedir, | ||
ReportList * | reports | ||
) |
Definition at line 176 of file bpath.c.
References BPathRemap_Data::basedir, BKE_reportf(), bpath_traverse_main(), data, makeFilesAbsolute_visit_cb(), NULL, BPathRemap_Data::reports, RPT_INFO, and RPT_WARNING.
Referenced by BLO_write_file(), and make_paths_absolute_exec().
static int makeFilesAbsolute_visit_cb | ( | void * | userdata, |
char * | path_dst, | ||
const char * | path_src | ||
) | [static] |
Definition at line 152 of file bpath.c.
References BPathRemap_Data::basedir, BKE_reportf(), BLI_path_abs(), BPathRemap_Data::count_changed, BPathRemap_Data::count_failed, BPathRemap_Data::count_tot, data, FALSE, BPathRemap_Data::reports, RPT_WARNING, and TRUE.
Referenced by makeFilesAbsolute().
void makeFilesRelative | ( | Main * | bmain, |
const char * | basedir, | ||
ReportList * | reports | ||
) |
Definition at line 133 of file bpath.c.
References BPathRemap_Data::basedir, BKE_reportf(), bpath_traverse_main(), data, makeFilesRelative_visit_cb(), NULL, BPathRemap_Data::reports, RPT_INFO, and RPT_WARNING.
Referenced by BLO_write_file(), and make_paths_relative_exec().
static int makeFilesRelative_visit_cb | ( | void * | userdata, |
char * | path_dst, | ||
const char * | path_src | ||
) | [static] |
Definition at line 110 of file bpath.c.
References BPathRemap_Data::basedir, BKE_reportf(), BLI_path_rel(), BPathRemap_Data::count_changed, BPathRemap_Data::count_failed, BPathRemap_Data::count_tot, data, FALSE, BPathRemap_Data::reports, RPT_WARNING, and TRUE.
Referenced by makeFilesRelative().
static int rewrite_path_alloc | ( | char ** | path, |
BPathVisitor | visit_cb, | ||
const char * | absbase, | ||
void * | userdata | ||
) | [static] |
Definition at line 345 of file bpath.c.
References BLI_path_abs(), BLI_strdup(), BLI_strncpy(), FALSE, FILE_MAX, MEM_freeN(), and TRUE.
Referenced by bpath_traverse_id().
static int rewrite_path_fixed | ( | char * | path, |
BPathVisitor | visit_cb, | ||
const char * | absbase, | ||
void * | userdata | ||
) | [static] |
Definition at line 297 of file bpath.c.
References BLI_path_abs(), BLI_strncpy(), FALSE, FILE_MAX, and TRUE.
Referenced by bpath_traverse_id().
static int rewrite_path_fixed_dirfile | ( | char | path_dir[FILE_MAXDIR], |
char | path_file[FILE_MAXFILE], | ||
BPathVisitor | visit_cb, | ||
const char * | absbase, | ||
void * | userdata | ||
) | [static] |
Definition at line 321 of file bpath.c.
References BLI_join_dirfile(), BLI_path_abs(), BLI_split_dirfile(), FALSE, FILE_MAX, and TRUE.
Referenced by bpath_traverse_id().