diff options
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 5ef39e8d48e..96adadebb48 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -897,6 +897,12 @@ int BKE_copybuffer_save(const char *filename, ReportList *reports) ListBase *lbarray[MAX_LIBARRAY], *fromarray[MAX_LIBARRAY]; int a, retval; + /* path backup/restore */ + void *path_list_backup; + const int path_list_flag = (BKE_BPATH_TRAVERSE_SKIP_LIBRARY | BKE_BPATH_TRAVERSE_SKIP_MULTIFILE); + + path_list_backup = BKE_bpath_list_backup(G.main, path_list_flag); + BLO_main_expander(copybuffer_doit); BLO_expand_main(NULL, G.main); @@ -918,7 +924,7 @@ int BKE_copybuffer_save(const char *filename, ReportList *reports) /* save the buffer */ - retval = BLO_write_file(mainb, filename, 0, reports, NULL); + retval = BLO_write_file(mainb, filename, G_FILE_RELATIVE_REMAP, reports, NULL); /* move back the main, now sorted again */ set_listbasepointers(G.main, lbarray); @@ -938,6 +944,11 @@ int BKE_copybuffer_save(const char *filename, ReportList *reports) /* set id flag to zero; */ flag_all_listbases_ids(LIB_NEED_EXPAND | LIB_DOIT, 0); + if (path_list_backup) { + BKE_bpath_list_restore(G.main, path_list_flag, path_list_backup); + BKE_bpath_list_free(path_list_backup); + } + return retval; } |