very very bad hack to have sequencer strips fcurve data transform with them.

ifdef'd so its not kept in by accident.
Committing because without this animating with the sequencer isnt really usable and am not interensted in having many patches applied on artists systems.
This commit is contained in:
Campbell Barton 2009-12-09 16:46:41 +00:00
parent 2cc8ef127e
commit 00b8e65f0a
3 changed files with 47 additions and 0 deletions

@ -181,6 +181,7 @@ int seq_tx_test(struct Sequence * seq);
int check_single_seq(struct Sequence *seq);
void fix_single_seq(struct Sequence *seq);
int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test);
void seq_offset_animdata(struct Scene *scene, struct Sequence *seq, int ofs);
int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test);
int shuffle_seq_time(ListBase * seqbasep);
void free_imbuf_seq(struct Scene *scene, struct ListBase * seqbasep, int check_mem_usage);

@ -3529,6 +3529,31 @@ void seq_update_muting(Editing *ed)
}
}
/* XXX - hackish function needed for transforming strips! TODO - have some better solution */
void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs)
{
if(scene->adt==NULL || ofs==0)
return;
char str[32];
sprintf(str, "[\"%s\"]", seq->name+2);
FCurve *fcu;
for (fcu= scene->adt->action->curves.first; fcu; fcu= fcu->next) {
if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) {
int i;
for (i = 0; i < fcu->totvert; i++) {
BezTriple *bezt= &fcu->bezt[i];
bezt->vec[0][0] += ofs;
bezt->vec[1][0] += ofs;
bezt->vec[2][0] += ofs;
}
}
}
}
Sequence *active_seq_get(Scene *scene)
{
Editing *ed= seq_give_editing(scene, FALSE);

@ -2346,6 +2346,7 @@ void flushTransNodes(TransInfo *t)
}
/* *** SEQUENCE EDITOR *** */
#define XXX_DURIAN_ANIM_TX_HACK
void flushTransSeq(TransInfo *t)
{
ListBase *seqbasep= seq_give_editing(t->scene, FALSE)->seqbasep; /* Editing null check alredy done */
@ -2374,6 +2375,13 @@ void flushTransSeq(TransInfo *t)
if (seq->type != SEQ_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */
seq->start= new_frame - tdsq->start_offset;
#ifdef XXX_DURIAN_ANIM_TX_HACK
if (seq->type != SEQ_META && seq != seq_prev) {
int ofs = (new_frame - tdsq->start_offset) - seq->start;
seq_offset_animdata(t->scene, seq, ofs);
}
#endif
if (seq->depth==0) {
seq->machine= (int)floor(td2d->loc[1] + 0.5f);
CLAMP(seq->machine, 1, MAXSEQ);
@ -3828,6 +3836,19 @@ static short constraints_list_needinv(TransInfo *t, ListBase *list)
*/
static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count, int *flag)
{
#ifdef XXX_DURIAN_ANIM_TX_HACK
/* hack */
if((seq->flag & SELECT)==0 && seq->type & SEQ_EFFECT) {
Sequence *seq_t[3] = {seq->seq1, seq->seq2, seq->seq3};
int i;
for(i=0; i<3; i++) {
if (seq_t[i] && ((seq_t[i])->flag & SELECT) && !(seq_t[i]->flag & SEQ_LOCK) && !(seq_t[i]->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)))
seq->flag |= SELECT;
}
}
#endif
/* for extend we need to do some tricks */
if (t->mode == TFM_TIME_EXTEND) {