Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

bpath.c File Reference

#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)

Detailed Description

Definition in file bpath.c.


Define Documentation

#define BPATH_TRAVERSE_POINTCACHE (   ptcaches)
Value:
{                                                                          \
        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 Documentation


Function Documentation

int bpath_relocate_visitor ( void *  pathbase_v,
char *  path_dst,
const char *  path_src 
)
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 
)
void checkMissingFiles ( Main bmain,
ReportList reports 
)
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 
)
static int findMissingFiles_visit_cb ( void *  userdata,
char *  path_dst,
const char *  path_src 
) [static]
void makeFilesAbsolute ( Main bmain,
const char *  basedir,
ReportList reports 
)
static int makeFilesAbsolute_visit_cb ( void *  userdata,
char *  path_dst,
const char *  path_src 
) [static]
void makeFilesRelative ( Main bmain,
const char *  basedir,
ReportList reports 
)
static int makeFilesRelative_visit_cb ( void *  userdata,
char *  path_dst,
const char *  path_src 
) [static]
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().