diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-01 13:05:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-01 13:05:38 +0400 |
commit | 9aa901ccccb81da3cacf4acad34ba67020b5da7a (patch) | |
tree | 402b7a6c013800bbac79b06588db87c6adad762d /source/blender/blenlib | |
parent | b6e445a61f69f5e288389eb6026fc23d7a9c9c1e (diff) | |
parent | 2ad80bf3bb807a5d433406794becb6aaafd415f9 (diff) |
svn merge -r41422:41431 ^/trunk/blender
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_bpath.h | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 5 |
2 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h index 89ba4b2675e..e850db5a171 100644 --- a/source/blender/blenlib/BLI_bpath.h +++ b/source/blender/blenlib/BLI_bpath.h @@ -48,9 +48,13 @@ void bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVisito void bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *userdata); int bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src); -#define BPATH_TRAVERSE_ABS (1<<0) /* convert paths to absolute */ -#define BPATH_TRAVERSE_SKIP_LIBRARY (1<<2) /* skip library paths */ -#define BPATH_TRAVERSE_SKIP_PACKED (1<<3) /* skip packed data */ +#define BPATH_TRAVERSE_ABS (1<<0) /* convert paths to absolute */ +#define BPATH_TRAVERSE_SKIP_LIBRARY (1<<2) /* skip library paths */ +#define BPATH_TRAVERSE_SKIP_PACKED (1<<3) /* skip packed data */ +#define BPATH_TRAVERSE_SKIP_MULTIFILE (1<<4) /* skip paths where a single dir is used with an array of files, eg. + * sequence strip images and pointcache. in this case only use the first + * file, this is needed for directory manipulation functions which might + * otherwise modify the same directory multiple times */ /* high level funcs */ diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index b7fe7ef5efd..259b25e67dd 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -499,6 +499,11 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla int len= MEM_allocN_len(se) / sizeof(*se); int i; + if (flag & BPATH_TRAVERSE_SKIP_MULTIFILE) { + /* only operate on one path */ + len= MIN2(1, len); + } + for(i= 0; i < len; i++, se++) { rewrite_path_fixed_dirfile(seq->strip->dir, se->name, visit_cb, absbase, bpath_user_data); } |