diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-03-25 14:05:34 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-03-25 14:05:34 +0300 |
commit | a180c8e2ed6ce62e6a15d28a0bb7f60bb58bc0cb (patch) | |
tree | 70d50ea80ac6aa47e561538338dd08ff322fbb82 /source/blender/imbuf/intern | |
parent | 22dfb506229258e293d7ab32a2c495ce93084e9d (diff) |
Allow multiple strips to use the same directory when custom proxy
directory is used.
This is done by appending the name of the file as extra folder. Existing
projects may need to regenerate their proxies but it should be possible
now to have all proxies nicely in the same custom folder.
Next commits will include operators to copy directory settings between
selected strips, making the process faster.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index d0281744830..183159f7d6c 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -374,6 +374,13 @@ static void get_index_dir(struct anim *anim, char *index_dir, size_t index_dir_l } } +void IMB_anim_get_fname(struct anim *anim, char *file, int size) +{ + char fname[FILE_MAXFILE]; + BLI_split_dirfile(anim->name, file, fname, size, sizeof(fname)); + BLI_strncpy(file, fname, size); +} + static void get_proxy_filename(struct anim *anim, IMB_Proxy_Size preview_size, char *fname, bool temp) { @@ -381,8 +388,8 @@ static void get_proxy_filename(struct anim *anim, IMB_Proxy_Size preview_size, int i = IMB_proxy_size_to_array_index(preview_size); char proxy_name[256]; - char proxy_temp_name[256]; char stream_suffix[20]; + const char *name = (temp) ? "proxy_%d%s_part.avi" : "proxy_%d%s.avi"; stream_suffix[0] = 0; @@ -390,15 +397,12 @@ static void get_proxy_filename(struct anim *anim, IMB_Proxy_Size preview_size, BLI_snprintf(stream_suffix, sizeof(stream_suffix), "_st%d", anim->streamindex); } - BLI_snprintf(proxy_name, sizeof(proxy_name), "proxy_%d%s.avi", - (int) (proxy_fac[i] * 100), stream_suffix); - BLI_snprintf(proxy_temp_name, sizeof(proxy_temp_name), "proxy_%d%s_part.avi", + BLI_snprintf(proxy_name, sizeof(proxy_name), name, (int) (proxy_fac[i] * 100), stream_suffix); get_index_dir(anim, index_dir, sizeof(index_dir)); - BLI_join_dirfile(fname, FILE_MAXFILE + FILE_MAXDIR, index_dir, - temp ? proxy_temp_name : proxy_name); + BLI_join_dirfile(fname, FILE_MAXFILE + FILE_MAXDIR, index_dir, proxy_name); } static void get_tc_filename(struct anim *anim, IMB_Timecode_Type tc, |