added a new Sequence Effect: Sweep.

this consists of 22 different ways to sweep from 1 strip to another. For you windows lovers: it's like "Blinds" in Powerpoint :)
- in the NKEY menu you can choose which type you want perform, vertical, horizontal, in/out etc. it's too much to decribe.

Credits for this go to Kent 'Sirdude" Mein who coded the sequence plugin I stole the code from.

To allow certain sequence effects to have settings, I also added a "varstr" void pointer to the Sequence DNA, that can point to a special struct for each effect. This is similar to how plugins are handles.

more neat effects to come....
This commit is contained in:
Roel Spruit 2004-06-18 22:53:06 +00:00
parent 35382146be
commit a31dec3712
6 changed files with 768 additions and 532 deletions

View File

@ -28,7 +28,7 @@
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*
*
*/
#ifndef BSE_SEQUENCE_H
@ -95,6 +95,18 @@ void do_mul_effect(float facf0, float facf1,
int x, int y,
unsigned int *rect1, unsigned int *rect2,
unsigned int *out);
/* Sweep effect */
enum {DO_LEFT_RIGHT, DO_RIGHT_LEFT, DO_DOWN_UP, DO_UP_DOWN,
DO_LOWER_LEFT_UPPER_RIGHT, DO_UPPER_RIGHT_LOWER_LEFT,
DO_UPPER_LEFT_LOWER_RIGHT, DO_LOWER_RIGHT_UPPER_LEFT,
DO_HORZ_OUT, DO_HORZ_IN, DO_VERT_OUT, DO_VERT_IN,
DO_HORZ_VERT_OUT, DO_HORZ_VERT_IN, DO_LEFT_DOWN_RIGHT_UP_OUT,
DO_LEFT_DOWN_RIGHT_UP_IN, DO_LEFT_UP_RIGHT_DOWN_OUT,
DO_LEFT_UP_RIGHT_DOWN_IN, DO_DIAG_OUT, DO_DIAG_IN, DO_DIAG_OUT_2,
DO_DIAG_IN_2};
int check_zone(int x, int y, int xo, int yo, struct Sequence *seq, float facf0);
void do_sweep_effect(struct Sequence *seq, float facf0, float facf1, int x, int y, unsigned int *rect1, unsigned int *rect2, unsigned int *out);
void make_black_ibuf(struct ImBuf *ibuf);
void multibuf(struct ImBuf *ibuf, float fmul);
void do_effect(int cfra, struct Sequence *seq, struct StripElem *se);

View File

@ -1,7 +1,7 @@
/**
* blenlib/DNA_sequence_types.h (mar-2001 nzc)
*
* $Id$
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
@ -48,7 +48,7 @@ typedef struct StripElem {
struct StripElem *se1, *se2, *se3;
short ok, nr;
int pad;
} StripElem;
typedef struct Strip {
@ -58,21 +58,21 @@ typedef struct Strip {
char dir[80];
short orx, ory;
int pad;
} Strip;
typedef struct PluginSeq {
char name[80];
void *handle;
char *pname;
int vars, version;
void *varstr;
float *cfra;
float data[32];
void (*doit)(void);
@ -88,7 +88,7 @@ typedef struct Sequence {
struct Sequence *next, *prev, *newseq;
void *lib;
char name[24];
short flag, type;
int len;
int start, startofs, endofs;
@ -97,28 +97,30 @@ typedef struct Sequence {
int startdisp, enddisp;
float mul, handsize;
int sfra;
Strip *strip;
StripElem *curelem;
struct Ipo *ipo;
struct Scene *scene;
struct anim *anim;
float facf0, facf1;
PluginSeq *plugin;
/* pointers for effects: */
struct Sequence *seq1, *seq2, *seq3;
/* meta */
ListBase seqbase;
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;
void *varstr; /* Struct pointer for effect settings */
} Sequence;
#
#
@ -136,6 +138,12 @@ typedef struct Editing {
int pad;
} Editing;
/* ************* Effect Variable Structs ********* */
typedef struct SweepVars {
short sweeptype;
} SweepVars;
/* ***************** SEQUENCE ****************** */
/* seq->flag */
@ -162,6 +170,7 @@ typedef struct Editing {
#define SEQ_MUL 14
#define SEQ_OVERDROP 15
#define SEQ_PLUGIN 24
#define SEQ_SWEEP 25
#endif

View File

@ -120,6 +120,7 @@ static char *give_seqname(Sequence *seq)
else if(seq->type==SEQ_ALPHAOVER) return "ALPHAOVER";
else if(seq->type==SEQ_ALPHAUNDER) return "ALPHAUNDER";
else if(seq->type==SEQ_OVERDROP) return "OVER DROP";
else if(seq->type==SEQ_SWEEP) return "SWEEP";
else if(seq->type==SEQ_PLUGIN) {
if(seq->plugin && seq->plugin->doit) return seq->plugin->pname;
return "PLUGIN";
@ -164,6 +165,8 @@ static unsigned int seq_color(Sequence *seq)
return 0x9080A0;
case SEQ_OVERDROP:
return 0x5080B0;
case SEQ_SWEEP:
return 0x2080B0;
case SEQ_PLUGIN:
return 0x906000;
case SEQ_SOUND:
@ -701,6 +704,15 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
uiDefBut(block, LABEL, 0, "Striptype: Effect", 10,140,150,20, 0, 0, 0, 0, 0, "");
uiDefBut(block, TEX, 0, "Stripname: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, "");
if(last_seq->type==SEQ_SWEEP){
SweepVars *sweep = (SweepVars *)last_seq->varstr;
char formatstring[1024];
strcpy(formatstring, "Select Sweep Type %t|Left to Right %x0|Right to Left %x1|Bottom to Top %x2|Top to Bottom %x3|Top left to Bottom right%x4|Bottom right to Top left %x5|Bottom left to Top right %x6|Top right to Bottom left %x7|Horizontal out %x8|Horizontal in %x9|Vertical out %x10|Vertical in %x11|Hor/Vert out %x12|Hor/Vert in %x13|Bottom left to Top right out %x14|Top left to Bottom right in %x15|Top left to Bottom right out %x16|Bottom left to Top right in %x17|Diagonal out %x18|Diagonal in %x19|Diagonal out 2 %x20|Diagonal in 2 %x21|");
uiDefButS(block, MENU,SEQ_BUT_MOVIE, formatstring, 10,90,220,22, &sweep->sweeptype, 0, 0, 0, 0, "What type of sweep should be performed");
}
}

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
*
* Functions to draw the "Video Sequence Editor" window header
* and handle user events sent to it.
*
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
@ -79,7 +79,7 @@ extern Sequence *last_seq;
static void do_seq_viewmenu(void *arg, int event)
{
extern int play_anim(int mode);
switch(event)
{
case 1: /* Play Back Animation */
@ -110,7 +110,7 @@ static uiBlock *seq_viewmenu(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "seq_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
uiBlockSetButmFunc(block, do_seq_viewmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20,
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
@ -206,6 +206,9 @@ static void do_seq_addmenu_effectmenu(void *arg, int event)
case 8:
add_sequence(SEQ_PLUGIN);
break;
case 9:
add_sequence(SEQ_SWEEP);
break;
}
}
@ -225,13 +228,14 @@ static uiBlock *seq_addmenu_effectmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Over", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Under", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Over Drop", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Sweep", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plugin...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
@ -263,7 +267,7 @@ static uiBlock *seq_addmenu(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "seq_addmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
uiBlockSetButmFunc(block, do_seq_addmenu, NULL);
uiDefIconTextBlockBut(block, seq_addmenu_effectmenu, NULL, ICON_RIGHTARROW_THIN, "Effect", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, seq_addmenu_effectmenu, NULL, ICON_RIGHTARROW_THIN, "Effect", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -271,7 +275,7 @@ static uiBlock *seq_addmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scene", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Images", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
}
@ -470,23 +474,23 @@ void seq_buttons()
xmax= GetButStringLength("View");
uiDefBlockBut(block,seq_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
xco+=xmax;
xmax= GetButStringLength("Select");
uiDefBlockBut(block,seq_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
xco+=xmax;
xmax= GetButStringLength("Add");
uiDefBlockBut(block, seq_addmenu, NULL, "Add", xco, -2, xmax-3, 24, "");
xco+= xmax;
xmax= GetButStringLength("Strip");
uiDefBlockBut(block, seq_editmenu, NULL, "Strip", xco, -2, xmax-3, 24, "");
xco+= xmax;
/* end of pull down menus */
uiBlockSetEmboss(block, UI_EMBOSS);
}
/* IMAGE */
uiDefIconButS(block, TOG, B_REDR, ICON_IMAGE_COL, xco,0,XIC,YIC, &sseq->mainb, 0, 0, 0, 0, "Shows the sequence output image preview");
@ -498,6 +502,6 @@ void seq_buttons()
/* CLEAR MEM */
xco+= 8;
uiDefBut(block, BUT, B_SEQCLEAR, "Refresh", xco+=XIC,0,3*XIC,YIC, 0, 0, 0, 0, 0, "Clears all buffered images in memory");
uiDrawBlock(block);
}

File diff suppressed because it is too large Load Diff