diff options
Diffstat (limited to 'source/blender')
33 files changed, 80 insertions, 105 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 34ad6660294..07960dd2fa0 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -2315,7 +2315,7 @@ static void customdata_external_filename(char filename[FILE_MAX], ID *id, Custom char *path = (id->lib)? id->lib->filename: G.sce; BLI_strncpy(filename, external->filename, FILE_MAX); - BLI_convertstringcode(filename, path); + BLI_path_abs(filename, path); } void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int totelem) diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index 7d1f0510d71..22eb0578f72 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -431,8 +431,8 @@ DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, FluidsimModifie strcat(targetDir,"fluidsurface_final_####"); } - BLI_convertstringcode(targetDir, G.sce); - BLI_convertstringframe(targetDir, curFrame, 0); // fixed #frame-no + BLI_path_abs(targetDir, G.sce); + BLI_path_frame(targetDir, curFrame, 0); // fixed #frame-no strcpy(targetFile,targetDir); strcat(targetFile, ".bobj.gz"); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index a0337704c2d..ee3d685938b 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -391,7 +391,7 @@ Image *BKE_add_image_file(const char *name, int frame) } BLI_strncpy(str, name, sizeof(str)); - BLI_convertstringcode(str, G.sce); + BLI_path_abs(str, G.sce); /* exists? */ file= open(str, O_BINARY|O_RDONLY); @@ -402,7 +402,7 @@ Image *BKE_add_image_file(const char *name, int frame) for(ima= G.main->image.first; ima; ima= ima->id.next) { if(ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) { BLI_strncpy(strtest, ima->name, sizeof(ima->name)); - BLI_convertstringcode(strtest, G.sce); + BLI_path_abs(strtest, G.sce); if( strcmp(strtest, str)==0 ) { if(ima->anim==NULL || ima->id.us==0) { @@ -1428,8 +1428,8 @@ void BKE_makepicstring(char *string, char *base, int frame, int imtype, int use_ { if (string==NULL) return; BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */ - BLI_convertstringcode(string, G.sce); - BLI_convertstringframe(string, frame, 4); + BLI_path_abs(string, G.sce); + BLI_path_frame(string, frame, 4); if(use_ext) BKE_add_image_extension(string, imtype); @@ -1684,9 +1684,9 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) BLI_strncpy(name, ima->name, sizeof(name)); if(ima->id.lib) - BLI_convertstringcode(name, ima->id.lib->filename); + BLI_path_abs(name, ima->id.lib->filename); else - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); /* read ibuf */ ibuf = IMB_loadiffname(name, IB_rect|IB_multilayer); @@ -1791,9 +1791,9 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame) BLI_strncpy(str, ima->name, FILE_MAX); if(ima->id.lib) - BLI_convertstringcode(str, ima->id.lib->filename); + BLI_path_abs(str, ima->id.lib->filename); else - BLI_convertstringcode(str, G.sce); + BLI_path_abs(str, G.sce); ima->anim = openanim(str, IB_cmap | IB_rect); @@ -1845,11 +1845,11 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* get the right string */ BLI_strncpy(str, ima->name, sizeof(str)); if(ima->id.lib) - BLI_convertstringcode(str, ima->id.lib->filename); + BLI_path_abs(str, ima->id.lib->filename); else - BLI_convertstringcode(str, G.sce); + BLI_path_abs(str, G.sce); - BLI_convertstringframe(str, cfra, 0); + BLI_path_frame(str, cfra, 0); /* read ibuf */ ibuf = IMB_loadiffname(str, IB_rect|IB_multilayer|IB_imginfo); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 79bc92bdbfb..83268a0a165 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1244,8 +1244,8 @@ static void image_fix_relative_path(Image *ima) { if(ima->id.lib==NULL) return; if(strncmp(ima->name, "//", 2)==0) { - BLI_convertstringcode(ima->name, ima->id.lib->filename); - BLI_makestringcode(G.sce, ima->name); + BLI_path_abs(ima->name, ima->id.lib->filename); + BLI_path_rel(ima->name, G.sce); } } diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 55f09eede91..cdcdcc07eef 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -186,7 +186,7 @@ PackedFile *newPackedFile(ReportList *reports, char *filename) // convert relative filenames to absolute filenames strcpy(name, filename); - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); // open the file // and create a PackedFile structure @@ -274,7 +274,7 @@ int writePackedFile(ReportList *reports, char *filename, PackedFile *pf, int gui if (guimode); //XXX waitcursor(1); strcpy(name, filename); - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); if (BLI_exists(name)) { for (number = 1; number <= 999; number++) { @@ -339,7 +339,7 @@ int checkPackedFile(char *filename, PackedFile *pf) char name[FILE_MAXDIR + FILE_MAXFILE]; strcpy(name, filename); - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); if (stat(name, &st)) { ret_val = PF_NOFILE; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 9b1d48ac8c3..491ecd6011b 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3567,8 +3567,8 @@ static void particles_fluid_step(ParticleSimulationData *sim, int cfra) // ok, start loading strcpy(filename, fss->surfdataPath); strcat(filename, suffix); - BLI_convertstringcode(filename, G.sce); - BLI_convertstringframe(filename, curFrame, 0); // fixed #frame-no + BLI_path_abs(filename, G.sce); + BLI_path_frame(filename, curFrame, 0); // fixed #frame-no strcat(filename, suffix2); gzf = gzopen(filename, "rb"); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 2dbdfd06551..3908429e606 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1064,7 +1064,7 @@ static int ptcache_path(PTCacheID *pid, char *filename) file[i-6] = '\0'; snprintf(filename, MAX_PTCACHE_PATH, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */ - BLI_convertstringcode(filename, blendfilename); + BLI_path_abs(filename, blendfilename); return BLI_add_slash(filename); /* new strlen() */ } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 481c1ef29cf..601ead8654e 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -586,7 +586,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq) if (seq->type != SEQ_SCENE && seq->type != SEQ_META && seq->type != SEQ_IMAGE) { BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); - BLI_convertstringcode(str, G.sce); + BLI_path_abs(str, G.sce); } if (seq->type == SEQ_IMAGE) { @@ -1247,7 +1247,7 @@ static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * na if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { BLI_join_dirfile(name, dir, seq->strip->proxy->file); - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); return TRUE; } @@ -1276,8 +1276,8 @@ static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * na render_size); } - BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, frameno, 0); + BLI_path_abs(name, G.sce); + BLI_path_frame(name, frameno, 0); strcat(name, ".jpg"); @@ -2044,7 +2044,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int if(se->ok == STRIPELEM_OK && se->ibuf == 0) { StripElem * s_elem = give_stripelem(seq, cfra); BLI_join_dirfile(name, seq->strip->dir, s_elem->name); - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); if (!build_proxy_run) { se->ibuf = seq_proxy_fetch(scene, seq, cfra, render_size); } @@ -2078,7 +2078,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int if (se->ibuf == 0) { if(seq->anim==0) { BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name); - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); seq->anim = openanim( name, IB_rect | diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 23df930aa84..9d189237ba0 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -127,7 +127,7 @@ struct bSound* sound_new_file(struct Main *bmain, char* filename) int len; strcpy(str, filename); - BLI_convertstringcode(str, bmain->name); + BLI_path_abs(str, bmain->name); len = strlen(filename); while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\') @@ -262,7 +262,7 @@ void sound_load(struct Main *bmain, struct bSound* sound) else path = bmain ? bmain->name : G.sce; - BLI_convertstringcode(fullpath, path); + BLI_path_abs(fullpath, path); /* but we need a packed file then */ if (pf) diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index a7f80953f22..37c583943c6 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -246,7 +246,7 @@ int reopen_text(Text *text) if (!text || !text->name) return 0; BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_convertstringcode(str, G.sce); + BLI_path_abs(str, G.sce); BLI_split_dirfile(str, NULL, sfile); fp= fopen(str, "r"); @@ -344,7 +344,7 @@ Text *add_text(char *file, const char *relpath) BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE); if (relpath) /* can be NULL (bg mode) */ - BLI_convertstringcode(str, relpath); + BLI_path_abs(str, relpath); BLI_split_dirfile(str, NULL, sfile); fp= fopen(str, "r"); diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index d67a79154d2..f4bcb6d412f 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -124,12 +124,12 @@ static void filepath_avi (char *string, RenderData *rd) if (string==NULL) return; strcpy(string, rd->pic); - BLI_convertstringcode(string, G.sce); + BLI_path_abs(string, G.sce); BLI_make_existing_file(string); if (!BLI_testextensie(string, ".avi")) { - BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); + BLI_path_frame_range(string, rd->sfra, rd->efra, 4); strcat(string, ".avi"); } } diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 6e94602c0c9..8aa9282937c 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -789,7 +789,7 @@ void filepath_ffmpeg(char* string, RenderData* rd) { if (!string || !exts) return; strcpy(string, rd->pic); - BLI_convertstringcode(string, G.sce); + BLI_path_abs(string, G.sce); BLI_make_existing_file(string); @@ -810,7 +810,7 @@ void filepath_ffmpeg(char* string, RenderData* rd) { if (!*fe) { strcat(string, autosplit); - BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); + BLI_path_frame_range(string, rd->sfra, rd->efra, 4); strcat(string, *exts); } else { *(string + strlen(string) - strlen(*fe)) = 0; diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 36a540e4d97..91e0bbb138b 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -96,12 +96,12 @@ int BLI_has_parent(char *path); * @a framenum The framenumber to replace the frame code with. * @retval Returns true if the path was relative (started with "//"). */ -int BLI_convertstringcode(char *path, const char *basepath); -int BLI_convertstringframe(char *path, int frame, int digits); -int BLI_convertstringframe_range(char *path, int sta, int end, int digits); -int BLI_convertstringcwd(char *path); +int BLI_path_abs(char *path, const char *basepath); +int BLI_path_frame(char *path, int frame, int digits); +int BLI_path_frame_range(char *path, int sta, int end, int digits); +int BLI_path_cwd(char *path); -void BLI_makestringcode(const char *relfile, char *file); +void BLI_path_rel(char *file, const char *relfile); /** * Change every @a from in @a string into @a to. The diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 71d16adeab5..8e294395c86 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -137,9 +137,9 @@ void BLI_bpathIterator_getPathExpanded( struct BPathIterator *bpi, char *path_ex libpath = BLI_bpathIterator_getLib(bpi); if (libpath) { /* check the files location relative to its library path */ - BLI_convertstringcode(path_expanded, libpath); + BLI_path_abs(path_expanded, libpath); } else { /* local data, use the blend files path */ - BLI_convertstringcode(path_expanded, bpi->base_path); + BLI_path_abs(path_expanded, bpi->base_path); } } char* BLI_bpathIterator_getLib( struct BPathIterator *bpi) { @@ -533,7 +533,7 @@ void makeFilesRelative(char *basepath, ReportList *reports) { /* Important BLI_cleanup_dir runs before the path is made relative * because it wont work for paths that start with "//../" */ BLI_cleanup_file(bpi.base_path, filepath_relative); /* fix any /foo/../foo/ */ - BLI_makestringcode(bpi.base_path, filepath_relative); + BLI_path_rel(filepath_relative, bpi.base_path); /* be safe and check the length */ if (BLI_bpathIterator_getPathMaxLen(&bpi) <= strlen(filepath_relative)) { bpath_as_report(&bpi, "couldn't make path relative (too long)", reports); @@ -709,7 +709,7 @@ void findMissingFiles(char *basepath, char *str) { } else { /* copy the found path into the old one */ if (G.relbase_valid) - BLI_makestringcode(bpi.base_path, filename_new); + BLI_path_rel(filename_new, bpi.base_path); BLI_bpathIterator_setPath( &bpi, filename_new ); } diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 2346b172e87..3fe9a387a54 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -270,7 +270,7 @@ void BLI_cleanup_file(const char *relabase, char *dir) short a; char *start, *eind; if (relabase) { - BLI_convertstringcode(dir, relabase); + BLI_path_abs(dir, relabase); } else { if (dir[0]=='/' && dir[1]=='/') { if (dir[2]== '\0') { @@ -369,7 +369,7 @@ void BLI_cleanup_file(const char *relabase, char *dir) } -void BLI_makestringcode(const char *relfile, char *file) +void BLI_path_rel(char *file, const char *relfile) { char * p; char * q; @@ -542,7 +542,7 @@ static void ensure_digits(char *path, int digits) } } -int BLI_convertstringframe(char *path, int frame, int digits) +int BLI_path_frame(char *path, int frame, int digits) { int ch_sta, ch_end; @@ -559,7 +559,7 @@ int BLI_convertstringframe(char *path, int frame, int digits) return 0; } -int BLI_convertstringframe_range(char *path, int sta, int end, int digits) +int BLI_path_frame_range(char *path, int sta, int end, int digits) { int ch_sta, ch_end; @@ -576,7 +576,7 @@ int BLI_convertstringframe_range(char *path, int sta, int end, int digits) return 0; } -int BLI_convertstringcode(char *path, const char *basepath) +int BLI_path_abs(char *path, const char *basepath) { int wasrelative = (strncmp(path, "//", 2)==0); char tmp[FILE_MAX]; @@ -677,7 +677,7 @@ int BLI_convertstringcode(char *path, const char *basepath) * Should only be done with command line paths. * this is NOT somthing blenders internal paths support like the // prefix */ -int BLI_convertstringcwd(char *path) +int BLI_path_cwd(char *path) { int wasrelative = 1; int filelen = strlen(path); @@ -1249,7 +1249,7 @@ int BKE_rebase_path(char *abs, int abs_size, char *rel, int rel_size, const char BLI_strncpy(path, src_dir, sizeof(path)); /* expand "//" in filename and get absolute path */ - BLI_convertstringcode(path, base_dir); + BLI_path_abs(path, base_dir); /* get the directory part */ BLI_split_dirfile(path, dir, base); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7ba8386e9cf..2bb03f35edd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5210,7 +5210,7 @@ static void fix_relpaths_library(const char *basepath, Main *main) * relative to the blend file since indirectly linked libs will be relative to their direct linked library */ if (strncmp(lib->name, "//", 2)==0) { /* if this is relative to begin with? */ strncpy(lib->name, lib->filename, sizeof(lib->name)); - BLI_makestringcode(basepath, lib->name); + BLI_path_rel(lib->name, basepath); } } } @@ -9614,7 +9614,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) { char str[FILE_MAX]; BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); - BLI_convertstringcode(str, G.sce); + BLI_path_abs(str, G.sce); seq->sound = sound_new_file(main, str); } } @@ -11957,13 +11957,13 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in read_libraries(*fd, &(*fd)->mainlist); /* make the lib path relative if required */ - if(flag & FILE_STRINGCODE) { + if(flag & FILE_RELPATH) { /* use the full path, this could have been read by other library even */ BLI_strncpy(mainl->curlib->name, mainl->curlib->filename, sizeof(mainl->curlib->name)); /* uses current .blend file as reference */ - BLI_makestringcode(G.sce, mainl->curlib->name); + BLI_path_rel(mainl->curlib->name, G.sce); } blo_join_main(&(*fd)->mainlist); diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index a4c45358417..dfc41074ae6 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -1441,7 +1441,7 @@ public: // make absolute source path BLI_strncpy(src, image->name, sizeof(src)); - BLI_convertstringcode(src, G.sce); + BLI_path_abs(src, G.sce); // make dest directory if it doesn't exist BLI_make_existing_file(abs); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index aaf9ba6e214..f57d7a8367a 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -565,7 +565,7 @@ static void ui_draw_but_CHARTAB(uiBut *but) int err; strcpy(tmpStr, G.selfont->name); - BLI_convertstringcode(tmpStr, G.sce); + BLI_path_abs(tmpStr, G.sce); err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0); } } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index f02cefecaaa..8f7f3806bbd 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -891,7 +891,7 @@ static int multires_save_external_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "path", path); if(G.save_over) - BLI_makestringcode(G.sce, path); /* make relative */ + BLI_path_rel(path, G.sce); CustomData_external_add(&me->fdata, &me->id, CD_MDISPS, me->totface, path); CustomData_external_write(&me->fdata, &me->id, CD_MASK_MESH, me->totface, 0); diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 1af2fa9f5b8..191fe2bd388 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -563,7 +563,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob) // prepare names... strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR); strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR); - BLI_convertstringcode(targetDir, G.sce); // fixed #frame-no + BLI_path_abs(targetDir, G.sce); // fixed #frame-no strcpy(targetFile, targetDir); strcat(targetFile, suffixConfig); @@ -615,7 +615,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *ob) if(selection<1) return 0; // 0 from menu, or -1 aborted strcpy(targetDir, newSurfdataPath); strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR); - BLI_convertstringcode(targetDir, G.sce); // fixed #frame-no + BLI_path_abs(targetDir, G.sce); // fixed #frame-no } // -------------------------------------------------------------------------------------------- diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 4427155885d..585a600c579 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -80,7 +80,7 @@ static int screenshot_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "path", path); strcpy(G.ima, path); - BLI_convertstringcode(path, G.sce); + BLI_path_abs(path, G.sce); /* BKE_add_image_extension() checks for if extension was already set */ if(scene->r.scemode & R_EXTENSION) diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 175220f6690..4d9a045e252 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -592,7 +592,7 @@ int file_exec(bContext *C, wmOperator *exec_op) if(RNA_struct_find_property(op->ptr, "relative_path")) if(RNA_boolean_get(op->ptr, "relative_path")) - BLI_makestringcode(G.sce, name); + BLI_path_rel(name, G.sce); RNA_string_set(op->ptr, "path", name); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index a82e4ba6fed..51058c0e90b 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -136,7 +136,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) BLI_cleanup_dir(G.sce, params->dir); } else { /* if operator has path set, use it, otherwise keep the last */ - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); BLI_split_dirfile(name, dir, file); BLI_strncpy(params->file, file, sizeof(params->file)); BLI_make_file_string(G.sce, params->dir, dir, ""); /* XXX needed ? - also solve G.sce */ diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c index 07eb58bffbc..2ffbd2da959 100644 --- a/source/blender/editors/space_file/writeimage.c +++ b/source/blender/editors/space_file/writeimage.c @@ -105,7 +105,7 @@ static void save_rendered_image_cb_real(char *name, int confirm) BKE_add_image_extension(name, scene->r.imtype); strcpy(str, name); - BLI_convertstringcode(str, G.sce); + BLI_path_abs(str, G.sce); if (confirm) overwrite = saveover(str); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 59d6b2e30b7..ed75b6dcef0 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -817,7 +817,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera if (ibuf) { int relative= RNA_boolean_get(op->ptr, "relative_path"); - BLI_convertstringcode(path, G.sce); + BLI_path_abs(path, G.sce); if(scene->r.scemode & R_EXTENSION) { BKE_add_image_extension(path, sima->imtypenr); @@ -837,7 +837,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera RE_WriteRenderResult(rr, path, scene->r.quality); if(relative) - BLI_makestringcode(G.sce, path); /* only after saving */ + BLI_path_rel(path, G.sce); /* only after saving */ BLI_strncpy(ima->name, path, sizeof(ima->name)); BLI_strncpy(ibuf->name, path, sizeof(ibuf->name)); @@ -855,7 +855,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera char *name; if(relative) - BLI_makestringcode(G.sce, path); /* only after saving */ + BLI_path_rel(path, G.sce); /* only after saving */ BLI_strncpy(ima->name, path, sizeof(ima->name)); BLI_strncpy(ibuf->name, path, sizeof(ibuf->name)); @@ -1094,7 +1094,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; BLI_strncpy(name, ibuf->name, sizeof(name)); - BLI_convertstringcode(name, G.sce); + BLI_path_abs(name, G.sce); if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) { BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s.", name); diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 8a07e99e280..541b3802249 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -4816,7 +4816,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) if (te->idcode == ID_LI) { char expanded[FILE_MAXDIR + FILE_MAXFILE]; BLI_strncpy(expanded, ((Library *)tselem->id)->name, FILE_MAXDIR + FILE_MAXFILE); - BLI_convertstringcode(expanded, G.sce); + BLI_path_abs(expanded, G.sce); if (!BLI_exists(expanded)) { error("This path does not exist, correct this before saving"); } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index be1151219a2..daf0a070619 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -420,7 +420,7 @@ static void txt_write_file(Text *text, ReportList *reports) char file[FILE_MAXDIR+FILE_MAXFILE]; BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_convertstringcode(file, G.sce); + BLI_path_abs(file, G.sce); fp= fopen(file, "w"); if(fp==NULL) { @@ -2542,7 +2542,7 @@ int text_file_modified(Text *text) return 0; BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_convertstringcode(file, G.sce); + BLI_path_abs(file, G.sce); if(!BLI_exists(file)) return 2; @@ -2570,7 +2570,7 @@ static void text_ignore_modified(Text *text) if(!text || !text->name) return; BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_convertstringcode(file, G.sce); + BLI_path_abs(file, G.sce); if(!BLI_exists(file)) return; diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index c57931fa0a9..293eac3c5a5 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -655,7 +655,7 @@ enum FileSortTypeE { /* sfile->flag and simasel->flag */ #define FILE_SHOWSHORT 1 -#define FILE_STRINGCODE 2 +#define FILE_RELPATH 2 /* was FILE_STRINGCODE */ #define FILE_LINK 4 #define FILE_HIDE_DOT 8 #define FILE_AUTOSELECT 16 @@ -814,31 +814,6 @@ enum { #define C_HI 0xCBBBBB #define C_LO 0x544444 -/* queue settings */ -#define IMS_KNOW_WIN 1 -#define IMS_KNOW_BIP 2 -#define IMS_KNOW_DIR 4 -#define IMS_DOTHE_INF 8 -#define IMS_KNOW_INF 16 -#define IMS_DOTHE_IMA 32 -#define IMS_KNOW_IMA 64 -#define IMS_FOUND_BIP 128 -#define IMS_DOTHE_BIP 256 -#define IMS_WRITE_NO_BIP 512 - -/* imasel->mode */ -#define IMS_NOIMA 0 -#define IMS_IMA 1 -#define IMS_ANIM 2 -#define IMS_DIR 4 -#define IMS_FILE 8 -#define IMS_STRINGCODE 16 - -#define IMS_INDIR 1 -#define IMS_INDIRSLI 2 -#define IMS_INFILE 3 -#define IMS_INFILESLI 4 - /* nla->flag */ /* flags (1<<0), (1<<1), and (1<<3) are depreceated flags from old blenders */ /* draw timing in seconds instead of frames */ diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index ef7fa3360d4..3e5b6bd6030 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -87,7 +87,7 @@ static void rna_Image_save(Image *image, ReportList *reports) if(ibuf) { char filename[FILE_MAXDIR + FILE_MAXFILE]; BLI_strncpy(filename, image->name, sizeof(filename)); - BLI_convertstringcode(filename, G.sce); + BLI_path_abs(filename, G.sce); if(image->packedfile) { if (writePackedFile(reports, image->name, image->packedfile, 0) != RET_OK) { diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index d22fbcdeacf..a4190b54273 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -166,7 +166,7 @@ void filepath_qt(char *string, RenderData *rd) { if (strchr(string, '#')==NULL) strcat(string, "####"); /* 4 numbers */ - BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); + BLI_path_frame_range(string, rd->sfra, rd->efra, 4); strcat(string, ".mov"); } } diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index 8f12e40b04a..5bea41b105a 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -494,7 +494,7 @@ void filepath_qt(char *string, RenderData *rd) { if (string==0) return; strcpy(string, rd->pic); - BLI_convertstringcode(string, G.sce); + BLI_path_abs(string, G.sce); BLI_make_existing_file(string); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 385191f93bc..b049e2484e4 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2120,8 +2120,8 @@ static void load_backbuffer(Render *re) char name[256]; strcpy(name, re->r.backbuf); - BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, re->r.cfra, 0); + BLI_path_abs(name, G.sce); + BLI_path_frame(name, re->r.cfra, 0); if(re->backbuf) { re->backbuf->id.us--; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 06e9078276d..f45d3dfb6cb 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1410,7 +1410,7 @@ static short wm_link_append_flag(wmOperator *op) if(RNA_boolean_get(op->ptr, "autoselect")) flag |= FILE_AUTOSELECT; if(RNA_boolean_get(op->ptr, "active_layer")) flag |= FILE_ACTIVELAY; - if(RNA_boolean_get(op->ptr, "relative_path")) flag |= FILE_STRINGCODE; + if(RNA_boolean_get(op->ptr, "relative_path")) flag |= FILE_RELPATH; if(RNA_boolean_get(op->ptr, "link")) flag |= FILE_LINK; if(RNA_boolean_get(op->ptr, "instance_groups")) flag |= FILE_GROUP_INSTANCE; return flag; |