diff options
author | Alexander Ewering <blender@instinctive.de> | 2005-11-08 02:13:00 +0300 |
---|---|---|
committer | Alexander Ewering <blender@instinctive.de> | 2005-11-08 02:13:00 +0300 |
commit | 543f54aa1dd60f67b46ba860ebc905bfcd0db1ed (patch) | |
tree | b22788b6e132129c119fff2585e94b718462027c /source | |
parent | f09a3611be65c8fa8581a87c3d80a10e5c6eb65a (diff) |
New 'feature' for image/movie strips: Strobe
In the NKEY flying panel, you can set "Strobe" to something other than 1
for only displaying each nth picture of the strip. You know the effect
from movies :)
(I put this into the NKEY panel rather than as a effect because effects
only affect single frames (?) while this rather has to do with the
timing... like "Reverse")
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 3 | ||||
-rw-r--r-- | source/blender/src/drawseq.c | 3 | ||||
-rw-r--r-- | source/blender/src/sequence.c | 9 |
3 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index d5731c0bd86..09bb4b4c61a 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -119,7 +119,8 @@ typedef struct Sequence { struct bSound *sound; /* the linked "bSound" object */ float level, pan; /* level in dB (0=full), pan -1..1 */ int curpos; /* last sample position in audio_fill() */ - int pad; + short pad; + short strobe; void *effectdata; /* Struct pointer for effect settings */ diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index 3b409af2814..bf222042375 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -674,6 +674,7 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES uiDefButBitS(block, TOG, SEQ_FILTERY, SEQ_BUT_RELOAD, "FilterY", 10,70,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields"); uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Mul:", 10,50,150,19, &last_seq->mul, 0.001, 5.0, 100, 0, "Multiply colors"); uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,30,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order"); + uiDefButS(block, NUM, SEQ_BUT_RELOAD, "Strobe:", 10,10,150,19, &last_seq->strobe, 1.0, 30.0, 100, 0, "Only display every nth frame"); } else if(last_seq->type==SEQ_META) { @@ -699,7 +700,7 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Mul:", 10,50,150,19, &last_seq->mul, 0.001, 5.0, 100, 0, "Multiply colors"); uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,30,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order"); - + uiDefButS(block, NUM, SEQ_BUT_RELOAD, "Strobe:", 10,10,150,19, &last_seq->strobe, 1.0, 30.0, 100, 0, "Only display every nth frame"); } else if(last_seq->type==SEQ_SOUND) { diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index da6c1197951..619212ea419 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1716,11 +1716,12 @@ StripElem *give_stripelem(Sequence *seq, int cfra) else if(cfra >= seq->start+seq->len-1) nr= 0; else nr= (seq->start + seq->len) - cfra; } else { - if(cfra <= seq->start) nr= 0; - else if(cfra >= seq->start+seq->len-1) nr= seq->len-1; - else nr= cfra-seq->start; + if(cfra <= seq->start) nr= 0; + else if(cfra >= seq->start+seq->len-1) nr= seq->len-1; + else nr= cfra-seq->start; } - + if (seq->strobe == 0) seq->strobe = 1; + nr -= nr % seq->strobe; se+= nr; /* don't get confused by the increment, this is the same as strip->stripdata[nr], which works on some compilers...*/ se->nr= nr; |