== Sequencer ==

Bugfixes:
* The speed controller changes now dynamically the IPO-curve range to
  it's needs. (Frame matching and negative velocities didn't work...
  Obviously nobody tried ;-)
* Fixed some redraw bugs. The IPO window is correctly updated if one pushes
  the IPO Frame locking button.
This commit is contained in:
Peter Schlaile 2006-12-31 15:38:14 +00:00
parent d63a2760b0
commit 1834540830
6 changed files with 84 additions and 9 deletions

@ -41,6 +41,7 @@ void borderselect_seq(void);
void boundbox_seq(void);
void change_sequence(void);
void update_seq_ipo_rect(struct Sequence * seq);
void update_seq_icu_rects(struct Sequence * seq);
struct Sequence* get_last_seq();
void set_last_seq(struct Sequence * seq);
void clear_last_seq();

@ -68,6 +68,10 @@ struct SeqEffectHandle {
int (*early_out)(struct Sequence *seq,
float facf0, float facf1);
/* stores the y-range of the effect IPO */
void (*store_icu_yrange)(struct Sequence * seq,
short adrcode, float * ymin, float * ymax);
/* stores the default facf0 and facf1 if no IPO is present */
void (*get_default_fac)(struct Sequence * seq, int cfra,
float * facf0, float * facf1);

@ -1014,6 +1014,7 @@ void seq_viewmove(SpaceSeq *sseq)
#define SEQ_BUT_PLUGIN 1
#define SEQ_BUT_RELOAD 2
#define SEQ_BUT_EFFECT 3
#define SEQ_BUT_RELOAD_ALL 4
void do_seqbuttons(short val)
{
@ -1026,11 +1027,20 @@ void do_seqbuttons(short val)
break;
case SEQ_BUT_RELOAD:
case SEQ_BUT_RELOAD_ALL:
update_seq_ipo_rect(last_seq);
update_seq_icu_rects(last_seq);
free_imbuf_seq(); // frees all
break;
}
allqueue(REDRAWSEQ, 0);
if (val == SEQ_BUT_RELOAD_ALL) {
allqueue(REDRAWALL, 0);
} else {
allqueue(REDRAWSEQ, 0);
}
}
static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
@ -1065,7 +1075,7 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
}
}
uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED,
SEQ_BUT_RELOAD, "IPO Frame locked",
SEQ_BUT_RELOAD_ALL, "IPO Frame locked",
10,-40,150,19, &last_seq->flag,
0.0, 1.0, 0, 0,
"Lock the IPO coordinates to the "
@ -1122,7 +1132,7 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
uiBlockBeginAlign(block);
uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED,
SEQ_BUT_RELOAD, "IPO Frame locked",
SEQ_BUT_RELOAD_ALL, "IPO Frame locked",
10,90,150,19, &last_seq->flag,
0.0, 1.0, 0, 0,
"Lock the IPO coordinates to the "
@ -1138,7 +1148,7 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, "");
uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED,
SEQ_BUT_RELOAD, "IPO Frame locked",
SEQ_BUT_RELOAD_ALL, "IPO Frame locked",
10,90,150,19, &last_seq->flag,
0.0, 1.0, 0, 0,
"Lock the IPO coordinates to the "
@ -1195,10 +1205,10 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
SpeedControlVars *sp =
(SpeedControlVars *)last_seq->effectdata;
uiDefButF(block, NUM, SEQ_BUT_EFFECT, "Global Speed:", 10,70,150,19, &sp->globalSpeed, 0.0, 100.0, 0, 0, "Global Speed");
uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Global Speed:", 10,70,150,19, &sp->globalSpeed, 0.0, 100.0, 0, 0, "Global Speed");
uiDefButBitI(block, TOG, SEQ_SPEED_INTEGRATE,
SEQ_BUT_EFFECT,
SEQ_BUT_RELOAD,
"IPO is velocity",
10,50,150,19, &sp->flags,
0.0, 1.0, 0, 0,
@ -1206,7 +1216,7 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
"velocity instead of a frame number");
uiDefButBitI(block, TOG, SEQ_SPEED_BLEND,
SEQ_BUT_EFFECT,
SEQ_BUT_RELOAD,
"Enable frame blending",
10,30,150,19, &sp->flags,
0.0, 1.0, 0, 0,
@ -1214,7 +1224,7 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
"target for a smoother result");
uiDefButBitI(block, TOG, SEQ_SPEED_COMPRESS_IPO_Y,
SEQ_BUT_EFFECT,
SEQ_BUT_RELOAD,
"IPO value runs from [0..1]",
10,10,150,19, &sp->flags,
0.0, 1.0, 0, 0,

@ -1861,8 +1861,17 @@ IpoCurve *verify_ipocurve(ID *from, short blocktype, char *actname, char *constn
icu->adrcode= adrcode;
set_icu_vars(icu);
BLI_addtail( &(ipo->curve), icu);
switch (GS(from->name)) {
case ID_SEQ: {
Sequence *seq= (Sequence *)from;
update_seq_icu_rects(seq);
break;
}
}
}
}

@ -55,6 +55,7 @@
#include "IMB_imbuf.h"
#include "DNA_ipo_types.h"
#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@ -276,6 +277,26 @@ void update_seq_ipo_rect(Sequence * seq)
seq->ipo->cur.xmax= end;
}
void update_seq_icu_rects(Sequence * seq)
{
IpoCurve *icu= NULL;
struct SeqEffectHandle sh;
if (!seq || !seq->ipo) {
return;
}
if(!(seq->type & SEQ_EFFECT)) {
return;
}
sh = get_sequence_effect(seq);
for(icu= seq->ipo->curve.first; icu; icu= icu->next) {
sh.store_icu_yrange(seq, icu->adrcode, &icu->ymin, &icu->ymax);
}
}
static int test_overlap_seq(Sequence *test)
{
Sequence *seq;

@ -2837,6 +2837,28 @@ static int early_out_speed(struct Sequence *seq,
return 1;
}
static void store_icu_yrange_speed(struct Sequence * seq,
short adrcode, float * ymin, float * ymax)
{
SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
/* if not already done, load / initialize data */
get_sequence_effect(seq);
if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) {
*ymin = -100.0;
*ymax = 100.0;
} else {
if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
*ymin = 0.0;
*ymax = 1.0;
} else {
*ymin = 0.0;
*ymax = seq->len;
}
}
}
void sequence_effect_speed_rebuild_map(struct Sequence * seq, int force)
{
float facf0 = seq->facf0;
@ -3016,6 +3038,12 @@ static int early_out_mul_input2(struct Sequence *seq,
return 0;
}
static void store_icu_yrange_noop(struct Sequence * seq,
short adrcode, float * ymin, float * ymax)
{
/* defaults are fine */
}
static void get_default_fac_noop(struct Sequence *seq, int cfra,
float * facf0, float * facf1)
{
@ -3056,6 +3084,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
rval.free = free_noop;
rval.early_out = early_out_noop;
rval.get_default_fac = get_default_fac_noop;
rval.store_icu_yrange = store_icu_yrange_noop;
rval.execute = NULL;
rval.copy = NULL;
@ -3127,6 +3156,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
rval.copy = copy_speed_effect;
rval.execute = do_cross_effect;
rval.early_out = early_out_speed;
rval.store_icu_yrange = store_icu_yrange_speed;
break;
case SEQ_COLOR:
rval.init = init_solid_color;