diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_proxy.c | 7 | ||||
-rw-r--r-- | source/blender/sequencer/intern/effects.c | 28 | ||||
-rw-r--r-- | source/blender/sequencer/intern/prefetch.c | 17 |
3 files changed, 36 insertions, 16 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_proxy.c b/source/blender/editors/space_sequencer/sequencer_proxy.c index b04363a4f33..b208f320591 100644 --- a/source/blender/editors/space_sequencer/sequencer_proxy.c +++ b/source/blender/editors/space_sequencer/sequencer_proxy.c @@ -145,8 +145,7 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports) bool selected = false; /* Check for no selected strips */ SEQ_CURRENT_BEGIN (ed, seq) { - if (!ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_META) || - (seq->flag & SELECT) == 0) { + if (!ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE) || (seq->flag & SELECT) == 0) { continue; } @@ -284,7 +283,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) SEQ_CURRENT_BEGIN (ed, seq) { if ((seq->flag & SELECT)) { - if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_META)) { + if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) { SEQ_proxy_set(seq, turnon); if (seq->strip->proxy == NULL) { continue; @@ -339,7 +338,7 @@ void SEQUENCER_OT_enable_proxies(wmOperatorType *ot) /* Identifiers. */ ot->name = "Set Selected Strip Proxies"; ot->idname = "SEQUENCER_OT_enable_proxies"; - ot->description = "Enable selected proxies on all selected Movie, Image and Meta strips"; + ot->description = "Enable selected proxies on all selected Movie and Image strips"; /* Api callbacks. */ ot->invoke = sequencer_enable_proxies_invoke; diff --git a/source/blender/sequencer/intern/effects.c b/source/blender/sequencer/intern/effects.c index e8e80c8da83..1631a4534d6 100644 --- a/source/blender/sequencer/intern/effects.c +++ b/source/blender/sequencer/intern/effects.c @@ -3150,6 +3150,18 @@ static void store_icu_yrange_speed(Sequence *seq, short UNUSED(adrcode), float * } } +/* Generator strips with zero inputs have their length set to 1 pernamently. In some cases it is + * useful to use speed effect on these strips because they can be animated. This can be done by + * using their length as is on timeline as content length. See T82698. */ +int seq_effect_speed_get_strip_content_length(const Sequence *seq) +{ + if (SEQ_effect_get_num_inputs(seq->type) == 0) { + return seq->enddisp - seq->startdisp; + } + + return seq->len; +} + void seq_effect_speed_rebuild_map(Scene *scene, Sequence *seq, bool force) { int timeline_frame; @@ -3184,9 +3196,11 @@ void seq_effect_speed_rebuild_map(Scene *scene, Sequence *seq, bool force) fallback_fac = 1.0; + const int target_strip_length = seq_effect_speed_get_strip_content_length(seq->seq1); + if (seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) { - if ((seq->seq1->enddisp != seq->seq1->start) && (seq->seq1->len != 0)) { - fallback_fac = (float)seq->seq1->len / (float)(seq->seq1->enddisp - seq->seq1->start); + if ((seq->seq1->enddisp != seq->seq1->start) && (target_strip_length != 0)) { + fallback_fac = (float)target_strip_length / (float)(seq->seq1->enddisp - seq->seq1->start); flags = SEQ_SPEED_INTEGRATE; fcu = NULL; } @@ -3216,8 +3230,8 @@ void seq_effect_speed_rebuild_map(Scene *scene, Sequence *seq, bool force) cursor += facf; - if (cursor >= seq->seq1->len) { - v->frameMap[timeline_frame] = seq->seq1->len - 1; + if (cursor >= target_strip_length) { + v->frameMap[timeline_frame] = target_strip_length - 1; } else { v->frameMap[timeline_frame] = cursor; @@ -3239,12 +3253,12 @@ void seq_effect_speed_rebuild_map(Scene *scene, Sequence *seq, bool force) } if (flags & SEQ_SPEED_COMPRESS_IPO_Y) { - facf *= seq->seq1->len; + facf *= target_strip_length; } facf *= v->globalSpeed; - if (facf >= seq->seq1->len) { - facf = seq->seq1->len - 1; + if (facf >= target_strip_length) { + facf = target_strip_length - 1; } else { v->lastValidFrame = timeline_frame; diff --git a/source/blender/sequencer/intern/prefetch.c b/source/blender/sequencer/intern/prefetch.c index e658b99236a..4317fa3a850 100644 --- a/source/blender/sequencer/intern/prefetch.c +++ b/source/blender/sequencer/intern/prefetch.c @@ -55,6 +55,7 @@ #include "SEQ_prefetch.h" #include "SEQ_render.h" +#include "SEQ_sequencer.h" #include "image_cache.h" #include "prefetch.h" @@ -358,18 +359,23 @@ void seq_prefetch_free(Scene *scene) scene->ed->prefetch_job = NULL; } -static bool seq_prefetch_do_skip_frame(Scene *scene) +/* Skip frame if we need to render 3D scene strip. Rendering 3D scene requires main lock or setting + * up render job that doesn't have API to do openGL renders which can be used for sequencer. */ +static bool seq_prefetch_do_skip_frame(PrefetchJob *pfjob, ListBase *seqbase) { - Editing *ed = scene->ed; - PrefetchJob *pfjob = seq_prefetch_job_get(scene); float cfra = seq_prefetch_cfra(pfjob); Sequence *seq_arr[MAXSEQ + 1]; - int count = seq_get_shown_sequences(ed->seqbasep, cfra, 0, seq_arr); + int count = seq_get_shown_sequences(seqbase, cfra, 0, seq_arr); SeqRenderData *ctx = &pfjob->context_cpy; ImBuf *ibuf = NULL; /* Disable prefetching 3D scene strips, but check for disk cache. */ for (int i = 0; i < count; i++) { + if (seq_arr[i]->type == SEQ_TYPE_META && + seq_prefetch_do_skip_frame(pfjob, &seq_arr[i]->seqbase)) { + return true; + } + if (seq_arr[i]->type == SEQ_TYPE_SCENE && (seq_arr[i]->flag & SEQ_SCENE_STRIPS) == 0) { int cached_types = 0; @@ -457,7 +463,8 @@ static void *seq_prefetch_frames(void *job) */ pfjob->scene_eval->ed->prefetch_job = pfjob; - if (seq_prefetch_do_skip_frame(pfjob->scene)) { + ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(pfjob->scene, false)); + if (seq_prefetch_do_skip_frame(pfjob, seqbase)) { pfjob->num_frames_prefetched++; continue; } |