diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-01 10:26:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-01 10:26:55 +0400 |
commit | e3f03d72b6e0a24a2c87e94c68c5f6452ad91e94 (patch) | |
tree | 4afd7238aee332f7198d6ef9c4059bf7f103db48 /source/blender/blenkernel/intern/library.c | |
parent | f3f3a42566810185f22752428931c4d7584a67be (diff) |
added path traversal flag - BPATH_TRAVERSE_SKIP_MULTIFILE,
so path manipulation functions dont run multiple times on the same path in the case of sequence strips where the one directory is used as the base for many images.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 9d8acc44e88..35b50730a31 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -127,6 +127,21 @@ /* ************* general ************************ */ + +/* this has to be called from each make_local_* func, we could call + * from id_make_local() but then the make local functions would not be self + * contained. + * also note that the id _must_ have a library - campbell */ +void BKE_id_lib_local_paths(Main *bmain, ID *id) +{ + char *bpath_user_data[2]= {bmain->name, (id)->lib->filepath}; + + bpath_traverse_id(bmain, id, + bpath_relocate_visitor, + BPATH_TRAVERSE_SKIP_MULTIFILE, + bpath_user_data); +} + void id_lib_extern(ID *id) { if(id) { @@ -1252,8 +1267,8 @@ int new_id(ListBase *lb, ID *id, const char *tname) don't have other library users. */ void id_clear_lib_data(Main *bmain, ID *id) { - char *bpath_user_data[2]= {bmain->name, id->lib->filepath}; - bpath_traverse_id(bmain, id, bpath_relocate_visitor, 0, bpath_user_data); + BKE_id_lib_local_paths(bmain, id); + id->lib= NULL; id->flag= LIB_LOCAL; new_id(which_libbase(bmain, GS(id->name)), id, NULL); |