- sequence strips without scenes would crash on display
- appending scenes would not append the sound and scene ID's for sequence strips - reload button in sequence header now reloads sounds as well. - redrawing the sequence image view didnt work while plaing (unless play was activated from that region) - generic functions for running a callback on sequence strips recursively. seqbase_recursive_apply() and seq_recursive_apply() - bind marker with camera was set to home key, use Ctrl+B instead.
This commit is contained in:
@@ -137,6 +137,10 @@ struct SeqEffectHandle {
|
||||
/* sequence.c */
|
||||
void printf_strip(struct Sequence *seq);
|
||||
|
||||
/* apply functions recursively */
|
||||
void seqbase_recursive_apply(struct ListBase *seqbase, int (*apply_func)(struct Sequence *seq, void *), void *arg);
|
||||
void seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence *, void *), void *arg);
|
||||
|
||||
// extern
|
||||
void seq_free_sequence(struct Scene *scene, struct Sequence *seq);
|
||||
void seq_free_strip(struct Strip *strip);
|
||||
|
||||
@@ -87,6 +87,20 @@ void printf_strip(Sequence *seq)
|
||||
fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), seq_tx_get_final_right(seq, 0));
|
||||
}
|
||||
|
||||
void seqbase_recursive_apply(ListBase *seqbase, int (*apply_func)(Sequence *seq, void *), void *arg)
|
||||
{
|
||||
Sequence *iseq;
|
||||
for(iseq= seqbase->first; iseq; iseq= iseq->next) {
|
||||
seq_recursive_apply(iseq, apply_func, arg);
|
||||
}
|
||||
}
|
||||
|
||||
void seq_recursive_apply(Sequence *seq, int (*apply_func)(Sequence *, void *), void *arg)
|
||||
{
|
||||
if(apply_func(seq, arg) && seq->seqbase.first)
|
||||
seqbase_recursive_apply(&seq->seqbase, apply_func, arg);
|
||||
}
|
||||
|
||||
/* **********************************************************************
|
||||
alloc / free functions
|
||||
********************************************************************** */
|
||||
@@ -252,7 +266,7 @@ void seq_free_editing(Scene *scene)
|
||||
{
|
||||
Editing *ed = scene->ed;
|
||||
MetaStack *ms;
|
||||
Sequence *seq, *nseq;
|
||||
Sequence *seq;
|
||||
|
||||
if(ed==NULL)
|
||||
return;
|
||||
@@ -689,28 +703,22 @@ void sort_seq(Scene *scene)
|
||||
}
|
||||
|
||||
|
||||
void clear_scene_in_allseqs(Scene *sce)
|
||||
static int clear_scene_in_allseqs_cb(Sequence *seq, void *arg_pt)
|
||||
{
|
||||
Scene *sce1;
|
||||
Editing *ed;
|
||||
Sequence *seq;
|
||||
if(seq->scene==(Scene *)arg_pt)
|
||||
seq->scene= NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void clear_scene_in_allseqs(Scene *scene)
|
||||
{
|
||||
Scene *scene_iter;
|
||||
|
||||
/* when a scene is deleted: test all seqs */
|
||||
|
||||
sce1= G.main->scene.first;
|
||||
while(sce1) {
|
||||
if(sce1!=sce && sce1->ed) {
|
||||
ed= sce1->ed;
|
||||
|
||||
SEQ_BEGIN(ed, seq) {
|
||||
|
||||
if(seq->scene==sce) seq->scene= 0;
|
||||
|
||||
}
|
||||
SEQ_END
|
||||
for(scene_iter= G.main->scene.first; scene_iter; scene_iter= scene_iter->id.next) {
|
||||
if(scene_iter != scene && scene_iter->ed) {
|
||||
seqbase_recursive_apply(&scene_iter->ed->seqbase, clear_scene_in_allseqs_cb, scene);
|
||||
}
|
||||
|
||||
sce1= sce1->id.next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2033,9 +2041,14 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
|
||||
Render *re;
|
||||
RenderResult rres;
|
||||
char scenename[64];
|
||||
int have_seq= (sce->r.scemode & R_DOSEQ) && sce->ed && sce->ed->seqbase.first;
|
||||
int sce_valid =sce && (sce->camera || have_seq);
|
||||
|
||||
int have_seq= FALSE;
|
||||
int sce_valid= FALSE;
|
||||
|
||||
if(sce) {
|
||||
have_seq= (sce->r.scemode & R_DOSEQ) && sce->ed && sce->ed->seqbase.first;
|
||||
sce_valid= (sce->camera || have_seq);
|
||||
}
|
||||
|
||||
if (se->ibuf == NULL && sce_valid && !build_proxy_run) {
|
||||
se->ibuf = seq_proxy_fetch(scene, seq, cfra, render_size);
|
||||
if (se->ibuf) {
|
||||
@@ -3217,6 +3230,23 @@ static void free_imbuf_seq_with_ipo(Scene *scene, struct Ipo *ipo)
|
||||
}
|
||||
#endif
|
||||
|
||||
static int seq_sound_reload_cb(Sequence *seq, void *arg_pt)
|
||||
{
|
||||
if (seq->type==SEQ_SOUND && seq->sound) {
|
||||
Scene *scene= (Scene *)arg_pt;
|
||||
if(seq->sound_handle)
|
||||
sound_delete_handle(scene, seq->sound_handle);
|
||||
|
||||
seq->sound_handle = sound_new_handle(scene, seq->sound, seq->start, seq->start + seq->strip->len, 0);
|
||||
return 0;
|
||||
}
|
||||
return 1; /* recurse meta's */
|
||||
}
|
||||
void seqbase_sound_reload(Scene *scene, ListBase *seqbase)
|
||||
{
|
||||
seqbase_recursive_apply(seqbase, seq_sound_reload_cb, (void *)scene);
|
||||
}
|
||||
|
||||
/* seq funcs's for transforming internally
|
||||
notice the difference between start/end and left/right.
|
||||
|
||||
|
||||
@@ -4232,6 +4232,7 @@ static void lib_link_scene(FileData *fd, Main *main)
|
||||
if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
|
||||
if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
|
||||
if(seq->sound) {
|
||||
seq->sound_handle= NULL;
|
||||
if(seq->type == SEQ_HD_SOUND)
|
||||
seq->type = SEQ_SOUND;
|
||||
else
|
||||
@@ -11281,6 +11282,16 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
|
||||
if(sce->gpd)
|
||||
expand_doit(fd, mainvar, sce->gpd);
|
||||
|
||||
if(sce->ed) {
|
||||
Sequence *seq;
|
||||
|
||||
SEQ_BEGIN(sce->ed, seq) {
|
||||
if(seq->scene) expand_doit(fd, mainvar, seq->scene);
|
||||
if(seq->sound) expand_doit(fd, mainvar, seq->sound);
|
||||
}
|
||||
SEQ_END
|
||||
}
|
||||
|
||||
#ifdef DURIAN_CAMERA_SWITCH
|
||||
{
|
||||
TimeMarker *marker;
|
||||
|
||||
@@ -1062,7 +1062,6 @@ void ED_marker_keymap(wmKeyConfig *keyconf)
|
||||
|
||||
WM_keymap_add_item(keymap, "MARKER_OT_move", GKEY, KM_PRESS, 0, 0);
|
||||
#ifdef DURIAN_CAMERA_SWITCH
|
||||
WM_keymap_add_item(keymap, "MARKER_OT_camera_bind", HOMEKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "MARKER_OT_camera_bind", BKEY, KM_PRESS, KM_CTRL, 0);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -2332,6 +2332,14 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws)
|
||||
if(spacetype==SPACE_TIME)
|
||||
return 1;
|
||||
}
|
||||
else if (regiontype==RGN_TYPE_PREVIEW) {
|
||||
switch (spacetype) {
|
||||
case SPACE_SEQ:
|
||||
if(redraws & (TIME_SEQ|TIME_ALL_ANIM_WIN))
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1672,6 +1672,8 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *op)
|
||||
|
||||
free_imbuf_seq(scene, &ed->seqbase, FALSE);
|
||||
|
||||
seqbase_sound_reload(scene, &ed->seqbase);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
||||
@@ -235,9 +235,9 @@ static int rna_Sequence_name_length(PointerRNA *ptr)
|
||||
static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
Scene *scene= (Scene*)ptr->id.data;
|
||||
Editing *ed= seq_give_editing(scene, FALSE);
|
||||
// Editing *ed= seq_give_editing(scene, FALSE);
|
||||
Sequence *seq= (Sequence*)ptr->data;
|
||||
Sequence *iseq;
|
||||
// Sequence *iseq;
|
||||
BLI_strncpy(seq->name+2, value, sizeof(seq->name)-2);
|
||||
|
||||
seqUniqueName(&scene->ed->seqbase, seq);
|
||||
|
||||
Reference in New Issue
Block a user