diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 16:10:33 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 17:33:46 +0300 |
commit | 481cdb08ed6f33a09d0e6843d1024db93c301178 (patch) | |
tree | 77166d130bfff2d5dca884676aaeff6bc0758f96 /source/blender/blenloader/intern/readfile.c | |
parent | 1d97e948d2c4867306e7fb5ce5fccf8b72c13391 (diff) |
Cleanup: use new accessors to blendfile path (Main.name).
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5a7151a7477..4df79250125 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8409,11 +8409,11 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead) if (bfd->filename[0] == 0) { if (fd->fileversion < 265 || (fd->fileversion == 265 && fg->subversion < 1)) if ((G.fileflags & G_FILE_RECOVER)==0) - BLI_strncpy(bfd->filename, bfd->main->name, sizeof(bfd->filename)); + BLI_strncpy(bfd->filename, BKE_main_blendfile_path(bfd->main), sizeof(bfd->filename)); /* early 2.50 version patch - filename not in FileGlobal struct at all */ if (fd->fileversion <= 250) - BLI_strncpy(bfd->filename, bfd->main->name, sizeof(bfd->filename)); + BLI_strncpy(bfd->filename, BKE_main_blendfile_path(bfd->main), sizeof(bfd->filename)); } if (G.fileflags & G_FILE_RECOVER) @@ -10309,7 +10309,7 @@ static Main *library_link_begin(Main *mainvar, FileData **fd, const char *filepa blo_split_main((*fd)->mainlist, mainvar); /* which one do we need? */ - mainl = blo_find_main(*fd, filepath, G.main->name); + mainl = blo_find_main(*fd, filepath, BKE_main_blendfile_path(mainvar)); /* needed for do_version */ mainl->versionfile = (*fd)->fileversion; @@ -10384,7 +10384,7 @@ static void library_link_end(Main *mainl, FileData **fd, const short flag, Scene BLI_strncpy(curlib->name, curlib->filepath, sizeof(curlib->name)); /* uses current .blend file as reference */ - BLI_path_rel(curlib->name, G.main->name); + BLI_path_rel(curlib->name, BKE_main_blendfile_path_from_global()); } blo_join_main((*fd)->mainlist); @@ -10412,7 +10412,7 @@ static void library_link_end(Main *mainl, FileData **fd, const short flag, Scene BKE_main_id_tag_all(mainvar, LIB_TAG_NEW, false); lib_verify_nodetree(mainvar, false); - fix_relpaths_library(G.main->name, mainvar); /* make all relative paths, relative to the open blend file */ + fix_relpaths_library(BKE_main_blendfile_path(mainvar), mainvar); /* make all relative paths, relative to the open blend file */ /* Give a base to loose objects. If group append, do it for objects too. * Only directly linked objects & groups are instantiated by `BLO_library_link_named_part_ex()` & co, @@ -10535,7 +10535,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) while (fd == NULL) { char newlib_path[FILE_MAX] = {0}; printf("Missing library...'\n"); - printf(" current file: %s\n", G.main->name); + printf(" current file: %s\n", BKE_main_blendfile_path_from_global()); printf(" absolute lib: %s\n", mainptr->curlib->filepath); printf(" relative lib: %s\n", mainptr->curlib->name); printf(" enter a new path:\n"); @@ -10543,7 +10543,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) if (scanf("%1023s", newlib_path) > 0) { /* Warning, keep length in sync with FILE_MAX! */ BLI_strncpy(mainptr->curlib->name, newlib_path, sizeof(mainptr->curlib->name)); BLI_strncpy(mainptr->curlib->filepath, newlib_path, sizeof(mainptr->curlib->filepath)); - BLI_cleanup_path(G.main->name, mainptr->curlib->filepath); + BLI_cleanup_path(BKE_main_blendfile_path_from_global(), mainptr->curlib->filepath); fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports); |