diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-10-09 04:22:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-10-09 04:22:59 +0400 |
commit | 80af4ce69d0e050aef3654977638a6613654a60b (patch) | |
tree | f3f45b99c9238326cd4615bc115abc9404964234 /source/blender/src/editseq.c | |
parent | 7d82b7720993fcf0eda749bf52c83dd2ddcd3c20 (diff) |
Sequencer
changed teh way single images operate,
* they dont act like a sequence of 1 image - so you can drag and resize without the trouble of having teh center image.
* they draw without the single frame in them. and no 'gutter?' strip drawing.
* the start frame is always set to be where the handles start.
This is done in the transform and draw areas of the sequencer. added 2 functions,
fix_single_image_seq - moves the seq start without any visible change - so it will load in older blend's
check_single_image_seq - quick way to check for single image.
Diffstat (limited to 'source/blender/src/editseq.c')
-rw-r--r-- | source/blender/src/editseq.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index f4ece844e52..7a6d0aa2766 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -145,7 +145,7 @@ void clear_last_seq(Sequence *seq) /* used so we can do a quick check for single image seq since they work a bit differently to normal image seq's (during transform) */ -static int check_single_image_seq(Sequence *seq) +int check_single_image_seq(Sequence *seq) { if (seq->type == SEQ_IMAGE && seq->len == 1 ) return 1; @@ -155,23 +155,22 @@ static int check_single_image_seq(Sequence *seq) static void fix_single_image_seq(Sequence *seq) { + int left, start, offset; if (!check_single_image_seq(seq)) return; - /* locks image to the start */ - if (seq->startstill != 0) { - seq->endstill += seq->startstill; - seq->start -= seq->startstill; - seq->startstill = 0; + /* make sure the image is always at the start since there is only one, + adjusting its start should be ok */ + left = SEQ_GET_FINAL_LEFT(seq); + start = seq->start; + if (start != left) { + offset = left - start; + SEQ_SET_FINAL_LEFT( seq, SEQ_GET_FINAL_LEFT(seq) - offset ); + SEQ_SET_FINAL_RIGHT( seq, SEQ_GET_FINAL_RIGHT(seq) - offset ); + seq->start += offset; } - - - - } - - static void change_plugin_seq(char *str) /* called from fileselect */ { struct SeqEffectHandle sh; @@ -1584,7 +1583,7 @@ void add_sequence(int type) } else { event= pupmenu("Add Sequence Strip%t" - "|Images%x1" + "|Image Sequence%x1" "|Movie%x102" #ifdef WITH_FFMPEG "|Movie + Audio (HD)%x105" @@ -2556,11 +2555,11 @@ void transform_seq(int mode, int context) if (SEQ_GET_FINAL_LEFT(seq) >= SEQ_GET_FINAL_RIGHT(seq)) { SEQ_SET_FINAL_LEFT(seq, SEQ_GET_FINAL_RIGHT(seq)-1); } - //if (check_single_image_seq(seq)==0) { + if (check_single_image_seq(seq)==0) { if (SEQ_GET_FINAL_LEFT(seq) >= SEQ_GET_END(seq)) { SEQ_SET_FINAL_LEFT(seq, SEQ_GET_END(seq)-1); } - //} + } } if(seq->flag & SEQ_RIGHTSEL) { myofs = (ts->endstill - ts->endofs); @@ -2569,11 +2568,11 @@ void transform_seq(int mode, int context) SEQ_SET_FINAL_RIGHT(seq, SEQ_GET_FINAL_LEFT(seq)+1); } - //if (check_single_image_seq(seq)==0) { + if (check_single_image_seq(seq)==0) { if (SEQ_GET_FINAL_RIGHT(seq) <= SEQ_GET_START(seq)) { SEQ_SET_FINAL_RIGHT(seq, SEQ_GET_START(seq)+1); } - //} + } } if (seq->type == SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND) { @@ -2685,7 +2684,7 @@ void transform_seq(int mode, int context) /* fixes single image strips - makes sure their start is not out of bounds ideally this would be done during transform since data is rendered at that time however it ends up being a lot messier! - Campbell */ - //fix_single_image_seq(seq); + fix_single_image_seq(seq); if(seq->type == SEQ_META) { calc_sequence(seq); |