|
Blender
V2.59
|
#include <sys/stat.h>#include <string.h>#include <assert.h>#include <dirent.h>#include <unistd.h>#include "MEM_guardedalloc.h"#include "DNA_mesh_types.h"#include "DNA_scene_types.h"#include "DNA_image_types.h"#include "DNA_texture_types.h"#include "DNA_text_types.h"#include "DNA_sound_types.h"#include "DNA_sequence_types.h"#include "DNA_vfont_types.h"#include "DNA_windowmanager_types.h"#include "BLI_blenlib.h"#include "BLI_bpath.h"#include "BLI_utildefines.h"#include "BKE_global.h"#include "BKE_image.h"#include "BKE_sequencer.h"#include "BKE_main.h"#include "BKE_utildefines.h"#include "BKE_report.h"Go to the source code of this file.
Classes | |
| struct | BPathIteratorSeqData |
| struct | BPathIterator |
Defines | |
| #define | FILE_MAX 240 |
| #define | MAX_RECUR 16 |
Typedefs | |
| typedef struct BPathIteratorSeqData | BPathIteratorSeqData |
| typedef struct BPathIterator | BPathIterator |
Enumerations | |
| enum | BPathTypes { BPATH_IMAGE = 0, BPATH_TEXTURE, BPATH_TEXT, BPATH_SOUND, BPATH_FONT, BPATH_LIB, BPATH_SEQ, BPATH_CDATA, BPATH_DONE } |
Functions | |
| void | BLI_bpathIterator_init (struct BPathIterator **bpi_pt, Main *bmain, const char *basedir, const int flag) |
| void | BLI_bpathIterator_free (struct BPathIterator *bpi) |
| void | BLI_bpathIterator_getPath (struct BPathIterator *bpi, char *path) |
| void | BLI_bpathIterator_setPath (struct BPathIterator *bpi, const char *path) |
| void | BLI_bpathIterator_getPathExpanded (struct BPathIterator *bpi, char *path_expanded) |
| const char * | BLI_bpathIterator_getLib (struct BPathIterator *bpi) |
| const char * | BLI_bpathIterator_getName (struct BPathIterator *bpi) |
| int | BLI_bpathIterator_getType (struct BPathIterator *bpi) |
| unsigned int | BLI_bpathIterator_getPathMaxLen (struct BPathIterator *bpi) |
| const char * | BLI_bpathIterator_getBasePath (struct BPathIterator *bpi) |
| static struct Image * | ima_stepdata__internal (struct Image *ima, const int step_next, const int flag) |
| static struct Tex * | tex_stepdata__internal (struct Tex *tex, const int step_next, const int UNUSED(flag)) |
| static struct Text * | text_stepdata__internal (struct Text *text, const int step_next, const int UNUSED(flag)) |
| static struct VFont * | vf_stepdata__internal (struct VFont *vf, const int step_next, const int flag) |
| static struct bSound * | snd_stepdata__internal (struct bSound *snd, int step_next, const int flag) |
| static struct Sequence * | seq_stepdata__internal (struct BPathIterator *bpi, int step_next) |
| static void | seq_getpath (struct BPathIterator *bpi, char *path) |
| static void | seq_setpath (struct BPathIterator *bpi, const char *path) |
| static void | text_getpath (struct BPathIterator *bpi, char *path) |
| static void | text_setpath (struct BPathIterator *bpi, const char *path) |
| static struct Mesh * | cdata_stepdata__internal (struct Mesh *me, int step_next) |
| static void | bpi_type_step__internal (struct BPathIterator *bpi) |
| void | BLI_bpathIterator_step (struct BPathIterator *bpi) |
| int | BLI_bpathIterator_isDone (struct BPathIterator *bpi) |
| static void | bpath_as_report (struct BPathIterator *bpi, const char *message, ReportList *reports) |
| void | checkMissingFiles (Main *bmain, ReportList *reports) |
| void | makeFilesRelative (Main *bmain, const char *basedir, ReportList *reports) |
| 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) |
| void | findMissingFiles (Main *bmain, const char *str) |
Definition in file bpath.c.
| #define FILE_MAX 240 |
Definition at line 100 of file bpath.c.
Referenced by BLI_bpathIterator_step(), findFileRecursive(), findMissingFiles(), makeFilesAbsolute(), makeFilesRelative(), and seq_getpath().
| #define MAX_RECUR 16 |
Definition at line 838 of file bpath.c.
Referenced by findFileRecursive().
| typedef struct BPathIterator BPathIterator |
| typedef struct BPathIteratorSeqData BPathIteratorSeqData |
| enum BPathTypes |
| void BLI_bpathIterator_free | ( | struct BPathIterator * | bpi | ) |
Definition at line 151 of file bpath.c.
References MEM_freeN(), NULL, BPathIteratorSeqData::scene, BPathIteratorSeqData::seqar, and BPathIterator::seqdata.
Referenced by bpy_blend_paths(), checkMissingFiles(), clean_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| const char* BLI_bpathIterator_getBasePath | ( | struct BPathIterator * | bpi | ) |
Definition at line 212 of file bpath.c.
References BPathIterator::base_path.
Referenced by bpy_blend_paths().
| const char* BLI_bpathIterator_getLib | ( | struct BPathIterator * | bpi | ) |
Definition at line 196 of file bpath.c.
References BPathIterator::_lib.
Referenced by BLI_bpathIterator_getPathExpanded(), bpy_blend_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| const char* BLI_bpathIterator_getName | ( | struct BPathIterator * | bpi | ) |
Definition at line 200 of file bpath.c.
References BPathIterator::_name.
Referenced by bpath_as_report().
| void BLI_bpathIterator_getPath | ( | struct BPathIterator * | bpi, |
| char * | path | ||
| ) |
Definition at line 161 of file bpath.c.
References BPathIterator::_path, and BPathIterator::getpath_callback.
Referenced by BLI_bpathIterator_getPathExpanded(), bpy_blend_paths(), clean_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| void BLI_bpathIterator_getPathExpanded | ( | struct BPathIterator * | bpi, |
| char * | path_expanded | ||
| ) |
Definition at line 181 of file bpath.c.
References BPathIterator::base_path, BLI_bpathIterator_getLib(), BLI_bpathIterator_getPath(), BLI_cleanup_file(), BLI_path_abs(), and NULL.
Referenced by bpath_as_report(), bpy_blend_paths(), checkMissingFiles(), findMissingFiles(), and makeFilesAbsolute().
| unsigned int BLI_bpathIterator_getPathMaxLen | ( | struct BPathIterator * | bpi | ) |
Definition at line 208 of file bpath.c.
References BPathIterator::len.
Referenced by findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| int BLI_bpathIterator_getType | ( | struct BPathIterator * | bpi | ) |
Definition at line 204 of file bpath.c.
References BPathIterator::type.
Referenced by bpath_as_report().
| void BLI_bpathIterator_init | ( | struct BPathIterator ** | bpi_pt, |
| Main * | bmain, | ||
| const char * | basedir, | ||
| const int | flag | ||
| ) |
Definition at line 117 of file bpath.c.
References BPathIterator::base_path, BLI_bpathIterator_step(), BPathIterator::bmain, BPATH_IMAGE, BPathIterator::data, BPathIterator::flag, BPathIterator::getpath_callback, MEM_mallocN(), NULL, BPathIteratorSeqData::scene, BPathIteratorSeqData::seq, BPathIteratorSeqData::seqar, BPathIterator::seqdata, BPathIterator::setpath_callback, BPathIteratorSeqData::totseq, and BPathIterator::type.
Referenced by bpy_blend_paths(), checkMissingFiles(), clean_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| int BLI_bpathIterator_isDone | ( | struct BPathIterator * | bpi | ) |
Definition at line 647 of file bpath.c.
References BPATH_DONE, and BPathIterator::type.
Referenced by bpy_blend_paths(), checkMissingFiles(), clean_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| void BLI_bpathIterator_setPath | ( | struct BPathIterator * | bpi, |
| const char * | path | ||
| ) |
Definition at line 171 of file bpath.c.
References BPathIterator::_path, and BPathIterator::setpath_callback.
Referenced by clean_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| void BLI_bpathIterator_step | ( | struct BPathIterator * | bpi | ) |
Definition at line 475 of file bpath.c.
References BPathIterator::_lib, BPathIterator::_name, BPathIterator::_path, assert, BPathIterator::bmain, BPATH_CDATA, BPATH_DONE, BPATH_FONT, BPATH_IMAGE, BPATH_LIB, BPATH_SEQ, BPATH_SOUND, BPATH_TEXT, BPATH_TEXTURE, bpi_type_step__internal(), cdata_stepdata__internal(), BPathIterator::data, Strip::dir, CustomData::external, Mesh::fdata, FILE_MAX, CustomDataExternal::filename, Library::filepath, ListBase::first, BPathIterator::flag, VFont::id, bSound::id, Mesh::id, Text::id, Image::id, Tex::id, ima_stepdata__internal(), Main::image, BPathIterator::len, ID::lib, Main::library, Main::mesh, VFont::name, StripElem::name, bSound::name, Image::name, PluginSeq::name, ID::name, Library::name, Sequence::name, NULL, Sequence::plugin, seq_stepdata__internal(), snd_stepdata__internal(), Main::sound, VoxelData::source_path, Sequence::strip, Strip::stripdata, Main::tex, tex_stepdata__internal(), TEX_VOXELDATA, Main::text, text_stepdata__internal(), BPathIterator::type, Tex::type, Tex::vd, vf_stepdata__internal(), and Main::vfont.
Referenced by BLI_bpathIterator_init(), bpy_blend_paths(), checkMissingFiles(), clean_paths(), findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| static void bpath_as_report | ( | struct BPathIterator * | bpi, |
| const char * | message, | ||
| ReportList * | reports | ||
| ) | [static] |
Definition at line 652 of file bpath.c.
References BKE_reportf(), BLI_bpathIterator_getName(), BLI_bpathIterator_getPathExpanded(), BLI_bpathIterator_getType(), BPATH_CDATA, BPATH_FONT, BPATH_IMAGE, BPATH_LIB, BPATH_SEQ, BPATH_SOUND, BPATH_TEXT, BPATH_TEXTURE, FILE_MAXDIR, NULL, and RPT_WARNING.
Referenced by checkMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().
| static void bpi_type_step__internal | ( | struct BPathIterator * | bpi | ) | [static] |
Definition at line 454 of file bpath.c.
References BPATH_SEQ, BPATH_TEXT, BPathIterator::data, BPathIterator::getpath_callback, NULL, seq_getpath(), seq_setpath(), BPathIterator::setpath_callback, text_getpath(), text_setpath(), and BPathIterator::type.
Referenced by BLI_bpathIterator_step().
Definition at line 436 of file bpath.c.
References CustomData::external, Mesh::fdata, Mesh::id, ID::next, and NULL.
Referenced by BLI_bpathIterator_step().
| void checkMissingFiles | ( | Main * | bmain, |
| ReportList * | reports | ||
| ) |
Definition at line 702 of file bpath.c.
References BLI_bpathIterator_free(), BLI_bpathIterator_getPathExpanded(), BLI_bpathIterator_init(), BLI_bpathIterator_isDone(), BLI_bpathIterator_step(), BLI_exists(), bpath_as_report(), FILE_MAXDIR, and Main::name.
Referenced by report_missing_files_exec().
| static int findFileRecursive | ( | char * | filename_new, |
| const char * | dirname, | ||
| const char * | filename, | ||
| int * | filesize, | ||
| int * | recur_depth | ||
| ) | [static] |
Definition at line 839 of file bpath.c.
References BLI_join_dirfile(), BLI_strncpy(), FILE_MAX, MAX_RECUR, NULL, and size().
Referenced by findMissingFiles().
| void findMissingFiles | ( | Main * | bmain, |
| const char * | str | ||
| ) |
Definition at line 889 of file bpath.c.
References BPathIterator::base_path, BLI_bpathIterator_free(), BLI_bpathIterator_getLib(), BLI_bpathIterator_getPath(), BLI_bpathIterator_getPathExpanded(), BLI_bpathIterator_getPathMaxLen(), BLI_bpathIterator_init(), BLI_bpathIterator_isDone(), BLI_bpathIterator_setPath(), BLI_bpathIterator_step(), BLI_exists(), BLI_path_basename(), BLI_path_rel(), BLI_split_dirfile(), FILE_MAX, FILE_MAXDIR, findFileRecursive(), G, Main::name, NULL, and Global::relbase_valid.
Referenced by find_missing_files_exec().
| static struct Image* ima_stepdata__internal | ( | struct Image * | ima, |
| const int | step_next, | ||
| const int | flag | ||
| ) | [static, read] |
Definition at line 218 of file bpath.c.
References BPATH_USE_PACKED, ELEM3, Image::id, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, ID::next, NULL, Image::packedfile, and Image::source.
Referenced by BLI_bpathIterator_step().
| void makeFilesAbsolute | ( | Main * | bmain, |
| const char * | basedir, | ||
| ReportList * | reports | ||
| ) |
Definition at line 778 of file bpath.c.
References BPathIterator::base_path, BKE_reportf(), BLI_bpathIterator_free(), BLI_bpathIterator_getLib(), BLI_bpathIterator_getPath(), BLI_bpathIterator_getPathExpanded(), BLI_bpathIterator_getPathMaxLen(), BLI_bpathIterator_init(), BLI_bpathIterator_isDone(), BLI_bpathIterator_setPath(), BLI_bpathIterator_step(), BLI_cleanup_file(), bpath_as_report(), FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, RPT_ERROR, and RPT_INFO.
Referenced by BLO_write_file(), and make_paths_absolute_exec().
| void makeFilesRelative | ( | Main * | bmain, |
| const char * | basedir, | ||
| ReportList * | reports | ||
| ) |
Definition at line 721 of file bpath.c.
References BPathIterator::base_path, BKE_reportf(), BLI_bpathIterator_free(), BLI_bpathIterator_getLib(), BLI_bpathIterator_getPath(), BLI_bpathIterator_getPathMaxLen(), BLI_bpathIterator_init(), BLI_bpathIterator_isDone(), BLI_bpathIterator_setPath(), BLI_bpathIterator_step(), BLI_cleanup_file(), BLI_path_rel(), BLI_strncpy(), bpath_as_report(), FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, RPT_ERROR, and RPT_INFO.
Referenced by BLO_write_file(), and make_paths_relative_exec().
| static void seq_getpath | ( | struct BPathIterator * | bpi, |
| char * | path | ||
| ) | [static] |
Definition at line 370 of file bpath.c.
References BLI_add_slash(), BLI_strncpy(), BPathIterator::data, Strip::dir, ELEM3, FILE_MAX, if(), StripElem::name, PluginSeq::name, NULL, Sequence::plugin, SEQ_HAS_PATH, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND, Sequence::strip, Strip::stripdata, and Sequence::type.
Referenced by bpi_type_step__internal().
| static void seq_setpath | ( | struct BPathIterator * | bpi, |
| const char * | path | ||
| ) | [static] |
Definition at line 396 of file bpath.c.
References BLI_split_dirfile(), BLI_strncpy(), BPathIterator::data, Strip::dir, ELEM3, if(), StripElem::name, PluginSeq::name, NULL, Sequence::plugin, SEQ_HAS_PATH, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND, Sequence::strip, Strip::stripdata, and Sequence::type.
Referenced by bpi_type_step__internal().
| static struct Sequence* seq_stepdata__internal | ( | struct BPathIterator * | bpi, |
| int | step_next | ||
| ) | [static, read] |
Definition at line 312 of file bpath.c.
References BPathIterator::bmain, ListBase::first, Scene::id, MEM_freeN(), ID::next, NULL, Sequence::plugin, Main::scene, BPathIteratorSeqData::scene, BPathIteratorSeqData::seq, seq_array(), seq_give_editing(), SEQ_HAS_PATH, BPathIteratorSeqData::seqar, BPathIterator::seqdata, and BPathIteratorSeqData::totseq.
Referenced by BLI_bpathIterator_step().
| static struct bSound* snd_stepdata__internal | ( | struct bSound * | snd, |
| int | step_next, | ||
| const int | flag | ||
| ) | [static, read] |
Definition at line 293 of file bpath.c.
References BPATH_USE_PACKED, bSound::id, ID::next, NULL, and bSound::packedfile.
Referenced by BLI_bpathIterator_step().
| static struct Tex* tex_stepdata__internal | ( | struct Tex * | tex, |
| const int | step_next, | ||
| const int | UNUSEDflag | ||
| ) | [static, read] |
Definition at line 238 of file bpath.c.
References VoxelData::file_format, Tex::id, ID::next, NULL, TEX_VD_IS_SOURCE_PATH, TEX_VOXELDATA, Tex::type, and Tex::vd.
Referenced by BLI_bpathIterator_step().
| static void text_getpath | ( | struct BPathIterator * | bpi, |
| char * | path | ||
| ) | [static] |
Definition at line 415 of file bpath.c.
References BPathIterator::data, and Text::name.
Referenced by bpi_type_step__internal().
| static void text_setpath | ( | struct BPathIterator * | bpi, |
| const char * | path | ||
| ) | [static] |
Definition at line 424 of file bpath.c.
References BLI_strdup(), BPathIterator::data, if(), MEM_freeN(), Text::name, and NULL.
Referenced by bpi_type_step__internal().
| static struct Text* text_stepdata__internal | ( | struct Text * | text, |
| const int | step_next, | ||
| const int | UNUSEDflag | ||
| ) | [static, read] |
Definition at line 255 of file bpath.c.
References Text::id, Text::name, ID::next, and NULL.
Referenced by BLI_bpathIterator_step().
| static struct VFont* vf_stepdata__internal | ( | struct VFont * | vf, |
| const int | step_next, | ||
| const int | flag | ||
| ) | [static, read] |
Definition at line 272 of file bpath.c.
References BPATH_USE_PACKED, FO_BUILTIN_NAME, VFont::id, VFont::name, ID::next, NULL, and VFont::packedfile.
Referenced by BLI_bpathIterator_step().