rename some functions to use easier to understand names.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 9 Mar 2010 17:36:23 +0000 (17:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 9 Mar 2010 17:36:23 +0000 (17:36 +0000)
'BLI_makestringcode' --> 'BLI_path_rel'
'BLI_convertstringcwd' --> 'BLI_path_cwd'
'BLI_convertstringframe' --> 'BLI_path_frame'
'BLI_convertstringframe_range' --> 'BLI_path_frame_range'
'BLI_make_cwdpath' --> 'BLI_path_cwd'

37 files changed:
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/fluidsim.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/path_util.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/DocumentExporter.cpp
source/blender/editors/interface/interface_draw.c
source/blender/editors/object/object_modifier.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/screen/screendump.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/writeimage.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_text/text_ops.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_image_api.c
source/blender/quicktime/apple/qtkit_export.m
source/blender/quicktime/apple/quicktime_export.c
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_operators.c
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp

index 34ad666029460d48d2542c8727da6e04c11437a7..07960dd2fa09e0cdf2436f67eea6d54f16d53d04 100644 (file)
@@ -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)
index 7d1f0510d710e972a3ea6cfba73ccd7ba92740fb..22eb0578f72a2d9b2222160d96ae01f6302edd36 100644 (file)
@@ -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");
index a0337704c2d592421efb34903fb6c051a0f8ff27..ee3d685938bb6830413c3957dccc04fdba06bfb1 100644 (file)
@@ -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);
index 79bc92bdbfb1c614e658471ba9b2660eebd797f0..83268a0a16589c50de643213ac058df258520a2d 100644 (file)
@@ -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);
        }
 }
 
index 55f09eede91f6600f9a5f664035a3a0e84662a3e..cdcdcc07eef78bfac0c5be02b6165d5ad77789bb 100644 (file)
@@ -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;
index 9b1d48ac8c3ef715bb69b1d58b2b89c98779d016..491ecd6011b916e3124d723e8e31ec46fbbfe227 100644 (file)
@@ -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");
index 2dbdfd06551043a1209b1a4fecea85cd3cc08541..3908429e60675d820447eebf21abf0619ad0f40b 100644 (file)
@@ -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() */
        }
        
index 481c1ef29cfef7b5c0e2d94d76e6b1973decd34e..601ead8654e26991d77ddf15cbeadfef54b23937 100644 (file)
@@ -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 | 
index 23df930aa8466d614373e7ae3424041d7025277c..9d189237ba016af02847a9b9c09823de9a4d6473 100644 (file)
@@ -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)
index a7f80953f22c30eb506421f5b5e8d21238d41446..37c583943c61caaec6f3ad1fd650bfbb93f33dd8 100644 (file)
@@ -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");
index d67a79154d2be1a0a477e17d76afecdc1a0610bb..f4bcb6d412fb616327a2fe4ad1c9343e3a7f405b 100644 (file)
@@ -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");
        }
 }
index 6e94602c0c9bd2091ed02ca803af9714520f6a96..8aa9282937c02482f04ba797351014f6fac848ef 100644 (file)
@@ -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;
index 36a540e4d976d04bb4955b6bced7261e988b7931..91e0bbb138bf6aa951a61254ddb7ad5908ec4282 100644 (file)
@@ -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
index 71d16adeab50bcd9ddb86b5571922bbed2523bbd..8e294395c86d2926a77b896773ffebb873c308ab 100644 (file)
@@ -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 );
                                        }
index 2346b172e872f3681dc82abd822761891e8f6dba..3fe9a387a546e65f28b9e1abd584c7fbd6e672b9 100644 (file)
@@ -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);
index 7ba8386e9cffef0df00b39c5472e46b18450dc73..2bb03f35eddbb6c204000fbac2699770e059359c 100644 (file)
@@ -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);
index a4c4535841716031b9f79ee6da0183c15421688f..dfc41074ae65b03c0edd87eb8c2e2e57b2cdedd5 100644 (file)
@@ -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);
index aaf9ba6e214f69540bd3c20b29b5ba72a99cdcfe..f57d7a8367af68cd7f9f50268dd5669af1c5d359 100644 (file)
@@ -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);
                }
        }
index f02cefecaaa31c4aa27495dbfbc91985bac5f128..8f7f3806bbd5157be468aef992ff09ca22105c85 100644 (file)
@@ -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);
index 1af2fa9f5b8bfb0445391840c405d23a96b0cb59..191fe2bd388a48979027a45f0eb9f84b2ae41ff2 100644 (file)
@@ -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 
        }
        
        // --------------------------------------------------------------------------------------------
index 4427155885dd4335ae236872526da022a89675a6..585a600c579c7c8574cfb174b131c55481d7e7a9 100644 (file)
@@ -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) 
index 175220f6690c1eaa37fb70ef028d11d38f715c72..4d9a045e2529825becc00be2ba6d232aebf15a84 100644 (file)
@@ -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);
                
index a82e4ba6fed6d4f49908188258cc7055ab657cb0..51058c0e90be60b908b9de9d1971ff048375337d 100644 (file)
@@ -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 */
index 07eb58bffbcc5fa2afdf60ee38bcee45ed6c5c66..2ffbd2da959cee3c297b1bb5951edf3aec590ecb 100644 (file)
@@ -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);
index 59d6b2e30b7e95410ea623a7c9a17955cc49cab1..ed75b6dcef06d44cf3117eda281c21693910650d 100644 (file)
@@ -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);
index 8a07e99e2807e136f2ea9c1638879c3efa6017df..541b3802249cd5f010484e751b52dd8ad596703b 100644 (file)
@@ -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");
                                }
index be1151219a297efcbdd72d81e3aef32eab932490..daf0a070619cc3e5fa8cccdf9c0e83b6abd6bcfc 100644 (file)
@@ -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;
 
index c57931fa0a9bc8f77c6b73cf99a4673cb3253a57..293eac3c5a5c678fc3e40eae241f33a7c67341fe 100644 (file)
@@ -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 */
index ef7fa3360d4519a28b45fa82bd0b094ef3761516..3e5b6bd6030ddd7038b9768a58a18011a88a1a38 100644 (file)
@@ -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) {
index d22fbcdeacf4206653d2ec25e0e8d9960eef50c9..a4190b5427359b54e14c9fddee7817fbe3315109 100644 (file)
@@ -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");
        }
 }
index 8f12e40b04ade06e4a1c120918ba84efcc5e79ea..5bea41b105aa67ea60d155b96c26d56b7e0bdf0c 100644 (file)
@@ -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);
 
index 385191f93bc0838c240f662a755e5a606359417a..b049e2484e427313f1684e4bb1b330dbc6db6c2f 100644 (file)
@@ -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--;
index 06e9078276df0a542e749bd51fa010084707e44e..f45d3dfb6cb53a6abea0c81f5397a5b71abe7402 100644 (file)
@@ -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;
index fd669c36cd49fb5d7551083abe6c6f0a3288dae8..61079057c8fe03710bc5bd7dfd2290839a2338a9 100644 (file)
@@ -776,7 +776,7 @@ static int run_python(int argc, char **argv, void *data)
        /* Make the path absolute because its needed for relative linked blends to be found */
        char filename[FILE_MAXDIR + FILE_MAXFILE];
        BLI_strncpy(filename, argv[1], sizeof(filename));
-       BLI_convertstringcwd(filename);
+       BLI_path_cwd(filename);
 
        /* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */
        if (argc > 1) {
@@ -813,7 +813,7 @@ static int load_file(int argc, char **argv, void *data)
        /* Make the path absolute because its needed for relative linked blends to be found */
        char filename[FILE_MAXDIR + FILE_MAXFILE];
        BLI_strncpy(filename, argv[0], sizeof(filename));
-       BLI_convertstringcwd(filename);
+       BLI_path_cwd(filename);
 
        if (G.background) {
                int retval = BKE_read_file(C, filename, NULL, NULL);
index 1688be6d5281c0175d4d2d980fa5756d96406cbe..00f556b3e9680c1519287ce4d2d048d14d38cd1b 100644 (file)
@@ -283,7 +283,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
                        // to the first file but that makes no sense, relative paths in
                        // blend files should be relative to that file, not some other file
                        // that happened to be loaded first
-                       BLI_convertstringcode(basedpath, pathname);
+                       BLI_path_abs(basedpath, pathname);
                        bfd = load_game_data(basedpath);
                        
                        // if it wasn't loaded, try it forced relative
@@ -294,7 +294,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
                                strcpy(temppath, "//");
                                strcat(temppath, basedpath);
                                
-                               BLI_convertstringcode(temppath, pathname);
+                               BLI_path_abs(temppath, pathname);
                                bfd = load_game_data(temppath);
                        }
                        
index 95370beeeb33fff5dc4d700073f27ccedecad746..9d87adb7400e70549af64257905a09ad9137ace5 100644 (file)
@@ -681,7 +681,7 @@ int main(int argc, char** argv)
 
                                get_filename(argc_py_clamped, argv, filename);
                                if(filename[0])
-                                       BLI_convertstringcwd(filename);
+                                       BLI_path_cwd(filename);
                                
                                do
                                {
@@ -695,7 +695,7 @@ int main(int argc, char** argv)
                                                
                                                // base the actuator filename relative to the last file
                                                strcpy(basedpath, exitstring.Ptr());
-                                               BLI_convertstringcode(basedpath, pathname);
+                                               BLI_path_abs(basedpath, pathname);
                                                
                                                bfd = load_game_data(basedpath);
 
@@ -706,7 +706,7 @@ int main(int argc, char** argv)
                                                        strcpy(temppath, "//");
                                                        strcat(temppath, basedpath);
                                
-                                                       BLI_convertstringcode(temppath, pathname);
+                                                       BLI_path_abs(temppath, pathname);
                                                        bfd = load_game_data(temppath);
                                                }
                                        }
index c30939fba54baa2103a44d372c5546feccfd036e..7dec4e4f97f85550c90bfcf789a75249db532b3b 100644 (file)
@@ -209,7 +209,7 @@ static PyObject* gPyExpandPath(PyObject*, PyObject* args)
                return NULL;
 
        BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE);
-       BLI_convertstringcode(expanded, gp_GamePythonPath);
+       BLI_path_abs(expanded, gp_GamePythonPath);
        return PyUnicode_FromString(expanded);
 }
 
@@ -471,7 +471,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
        
        if (searchpath) {
                BLI_strncpy(cpath, searchpath, FILE_MAXDIR + FILE_MAXFILE);
-               BLI_convertstringcode(cpath, gp_GamePythonPath);
+               BLI_path_abs(cpath, gp_GamePythonPath);
        } else {
                /* Get the dir only */
                BLI_split_dirfile(gp_GamePythonPath, cpath, NULL);
@@ -1787,7 +1787,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename)
        char expanded[FILE_MAXDIR + FILE_MAXFILE];
        
        BLI_split_dirfile(filename, expanded, NULL); /* get the dir part of filename only */
-       BLI_convertstringcode(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */
+       BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */
        BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */
        item= PyUnicode_FromString(expanded);