Configurable start frame for movie clip datablocks as alternative to automatic start frame number

Number of start frame in opened image sequence used to be distinguished automatically
in a way that file name used on open would be displayed at scene frame #1.

But sometimes it's useful to have it manually configurable (like in cases when you're
processing image sequence and replacing clip's filepath to postprocessed image sequence
and want new clip to show at the same frame range as it was rendered from).

Added Custom Start Frame flag to movie clip (could be accessed from Footage panel in
clip editor) and Start Frame which means number of frame from sequence which would
be displayed at scene frame #1.

For example if you've got clip pointing to file render_00100.png and Start Frame of 100
this file would be displayed at scene frame #1, if Start Frame is 1 then this image
would be displayed at scene frame #100,
This commit is contained in:
Sergey Sharybin
2012-06-05 18:38:09 +00:00
parent da38a0348a
commit 0d61876ed0
5 changed files with 51 additions and 9 deletions

View File

@@ -153,9 +153,15 @@ static void get_sequence_fname(MovieClip *clip, int framenr, char *name)
BLI_strncpy(name, clip->name, sizeof(clip->name));
BLI_stringdec(name, head, tail, &numlen);
/* movieclips always points to first image from sequence,
* autoguess offset for now. could be something smarter in the future */
offset = sequence_guess_offset(clip->name, strlen(head), numlen);
if (clip->flag & MCLIP_CUSTOM_START_FRAME) {
offset = clip->start_frame;
}
else {
/* movieclips always points to first image from sequence,
* autoguess offset for now. could be something smarter in the future
*/
offset = sequence_guess_offset(clip->name, strlen(head), numlen);
}
if (numlen)
BLI_stringenc(name, head, tail, numlen, offset + framenr - 1);
@@ -250,6 +256,10 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, in
dur = IMB_anim_get_duration(clip->anim, tc);
fra = framenr - 1;
if (clip->flag & MCLIP_CUSTOM_START_FRAME) {
fra += clip->start_frame - 1;
}
if (fra < 0)
fra = 0;
@@ -443,6 +453,8 @@ static MovieClip *movieclip_alloc(const char *name)
IMB_TC_RECORD_RUN_NO_GAPS;
clip->proxy.quality = 90;
clip->start_frame = 1;
return clip;
}