diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-31 01:33:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-31 01:33:47 +0300 |
commit | f749d0361f8a2cf8ba7d515c31cec1dcf8fe96a5 (patch) | |
tree | 6a510ba82bba9795faf1ffacf53e529dd0e4e196 /source/blender/blenkernel | |
parent | 1943a73439f04f65d721c8e58270d29498ff6b96 (diff) |
- hash characters in the path would confuse the output file name and not add numbers to it (when rendering animations).
- added an option to BLI_convertstringframe and BLI_convertstringframe_range to add digits if not found.
- removed BLI_convertstringframe where its obviously not needed - such as loading movies and sounds.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeavi.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 7 |
4 files changed, 6 insertions, 30 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index cca3d561ed4..a05e8516260 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -392,7 +392,6 @@ Image *BKE_add_image_file(const char *name, int frame) BLI_strncpy(str, name, sizeof(str)); BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, frame); /* exists? */ file= open(str, O_BINARY|O_RDONLY); @@ -404,7 +403,6 @@ Image *BKE_add_image_file(const char *name, int frame) if(ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) { BLI_strncpy(strtest, ima->name, sizeof(ima->name)); BLI_convertstringcode(strtest, G.sce); - BLI_convertstringframe(strtest, frame); if( strcmp(strtest, str)==0 ) { if(ima->anim==NULL || ima->id.us==0) { @@ -1412,15 +1410,9 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt void BKE_makepicstring(char *string, char *base, int frame, int imtype, int use_ext) { if (string==NULL) return; - BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */ - - /* if we dont have any #'s to insert numbers into, use 4 numbers by default */ - if (strchr(string, '#')==NULL) - strcat(string, "####"); /* 4 numbers */ - BLI_convertstringcode(string, G.sce); - BLI_convertstringframe(string, frame); + BLI_convertstringframe(string, frame, 4); if(use_ext) BKE_add_image_extension(string, imtype); @@ -1675,8 +1667,6 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) else BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, frame); /* TODO - should this be here? */ - /* read ibuf */ ibuf = IMB_loadiffname(name, IB_rect|IB_multilayer); if(G.f & G_DEBUG) printf("loaded %s\n", name); @@ -1838,7 +1828,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) else BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, cfra); + BLI_convertstringframe(str, cfra, 0); /* read ibuf */ ibuf = IMB_loadiffname(str, IB_rect|IB_multilayer|IB_imginfo); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index ad32f578a10..9fde0730011 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -583,8 +583,6 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq) seq->type != SEQ_IMAGE) { BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, scene->r.cfra); - } if (seq->type == SEQ_IMAGE) { @@ -1190,7 +1188,6 @@ static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * na if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { BLI_join_dirfile(name, dir, seq->strip->proxy->file); BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, cfra); return TRUE; } @@ -1220,8 +1217,8 @@ static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * na } BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, frameno); - + BLI_convertstringframe(name, frameno, 0); + strcat(name, ".jpg"); @@ -1988,7 +1985,6 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int StripElem * s_elem = give_stripelem(seq, cfra); BLI_join_dirfile(name, seq->strip->dir, s_elem->name); BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, scene->r.cfra); if (!build_proxy_run) { se->ibuf = seq_proxy_fetch(scene, seq, cfra, render_size); } @@ -2023,7 +2019,6 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int if(seq->anim==0) { BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name); BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, scene->r.cfra); seq->anim = openanim( name, IB_rect | diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 0d057525f38..a6092790706 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -129,11 +129,7 @@ static void filepath_avi (char *string, RenderData *rd) BLI_make_existing_file(string); if (!BLI_testextensie(string, ".avi")) { - /* if we dont have any #'s to insert numbers into, use 4 numbers by default */ - if (strchr(string, '#')==NULL) - strcat(string, "####"); /* 4 numbers */ - - BLI_convertstringframe_range(string, rd->sfra, rd->efra); + BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); strcat(string, ".avi"); } } diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 56924cb0dfa..9c38f84aa26 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -781,7 +781,6 @@ void filepath_ffmpeg(char* string, RenderData* rd) { strcpy(string, rd->pic); BLI_convertstringcode(string, G.sce); - BLI_convertstringframe(string, rd->cfra); BLI_make_existing_file(string); @@ -802,11 +801,7 @@ void filepath_ffmpeg(char* string, RenderData* rd) { if (!*fe) { strcat(string, autosplit); - /* if we dont have any #'s to insert numbers into, use 4 numbers by default */ - if (strchr(string, '#')==NULL) - strcat(string, "####"); /* 4 numbers */ - - BLI_convertstringframe_range(string, rd->sfra, rd->efra); + BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); strcat(string, *exts); } else { *(string + strlen(string) - strlen(*fe)) = 0; |