== Sequencer ==

Fixes: [#17315] Sequencer: after undo there's no active object
closes: [#17357] fix for bug #17315 - Sequencer: after undo there's no active object
(kiemdoder: thanks for the patch, had to do it in a little bit different way,
since sort_seq will kill your sort order idea...)
This commit is contained in:
Peter Schlaile
2008-07-23 07:11:23 +00:00
parent 1e7523ea44
commit ab722cf7b1
3 changed files with 33 additions and 4 deletions

View File

@@ -303,7 +303,7 @@ void set_scene_bg(Scene *sce)
int flag;
// Note: this here is defined in editseq.c (BIF_editseq.h), NOT in blenkernel!
set_last_seq(NULL);
clear_last_seq();
G.scene= sce;

View File

@@ -257,6 +257,7 @@ typedef struct SpeedControlVars {
#define SEQ_USE_CROP 131072
#define SEQ_USE_COLOR_BALANCE 262144
#define SEQ_USE_PROXY_CUSTOM_DIR 524288
#define SEQ_ACTIVE 1048576
#define SEQ_COLOR_BALANCE_INVERSE_GAIN 1
#define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2

View File

@@ -122,13 +122,28 @@ Sequence *get_last_seq()
if(!_last_seq_init) {
Editing *ed;
Sequence *seq;
Sequence *l_sel = NULL;
Sequence *l_act = NULL;
ed= G.scene->ed;
if(!ed) return NULL;
for(seq= ed->seqbasep->first; seq; seq=seq->next)
for(seq= ed->seqbasep->first; seq; seq=seq->next) {
if(seq->flag & SEQ_ACTIVE)
l_act = seq;
if(seq->flag & SELECT)
_last_seq= seq;
l_sel = seq;
}
if (l_act) {
_last_seq = l_act;
} else {
_last_seq = l_sel;
}
if (_last_seq) {
_last_seq->flag |= SEQ_ACTIVE;
}
_last_seq_init = 1;
}
@@ -138,12 +153,23 @@ Sequence *get_last_seq()
void set_last_seq(Sequence *seq)
{
if (_last_seq_init && _last_seq) {
_last_seq->flag &= ~SEQ_ACTIVE;
}
_last_seq = seq;
_last_seq_init = 1;
if (_last_seq) {
_last_seq->flag |= SEQ_ACTIVE;
}
}
void clear_last_seq(Sequence *seq)
void clear_last_seq()
{
if (_last_seq_init && _last_seq) {
_last_seq->flag &= ~SEQ_ACTIVE;
}
_last_seq = NULL;
_last_seq_init = 0;
}
@@ -2261,6 +2287,8 @@ static Sequence *dupli_seq(Sequence *seq)
"handled in duplicate!\nExpect a crash"
" now...\n");
}
seqn->flag &= ~SEQ_ACTIVE;
return seqn;
}