From 102a7ae2d95f4c6869cd77944bf110f5127bfb3d Mon Sep 17 00:00:00 2001 From: Peter Fog Date: Mon, 1 Jun 2020 04:41:52 +0200 Subject: VSE: Add warnings for failed proxy encoding Add more descriptive warnings if building proxy fails. Prevent progressbar from showing if no valid strip is selected. Reviewed By: ISS Differential Revision: https://developer.blender.org/D7689 --- .../editors/space_sequencer/sequencer_edit.c | 42 +++++++++++++++------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 232bb1d66e8..7898c7fa8d0 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -214,20 +214,41 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports) } file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list"); + bool selected = false; /* Check for no selected strips */ + SEQP_BEGIN (ed, seq) { - if ((seq->flag & SELECT)) { - bool success = BKE_sequencer_proxy_rebuild_context( - pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue); - if (!success) { - BKE_reportf(reports, RPT_ERROR, "Could not build proxy for strip %s", seq->name); - } + if (!ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_META) || + (seq->flag & SELECT) == 0) { + continue; + } + + selected = true; + if (!(seq->flag & SEQ_USE_PROXY)) { + BKE_reportf(reports, RPT_WARNING, "Proxy is not enabled for %s, skipping.", seq->name); + continue; + } + else if (seq->strip->proxy->build_size_flags == 0) { + BKE_reportf(reports, RPT_WARNING, "Resolution is not selected for %s, skipping.", seq->name); + continue; + } + + bool success = BKE_sequencer_proxy_rebuild_context( + pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue); + + if (!success && (seq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) != 0) { + BKE_reportf(reports, RPT_WARNING, "Overwrite is not checked for %s, skipping.", seq->name); } } SEQ_END; + if (!selected) { + BKE_reportf(reports, RPT_WARNING, "Select movie or image strips."); + return; + } + BLI_gset_free(file_list, MEM_freeN); - if (!WM_jobs_is_running(wm_job)) { + if (selected && !WM_jobs_is_running(wm_job)) { G.is_break = false; WM_jobs_start(CTX_wm_manager(C), wm_job); } @@ -3757,12 +3778,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) SEQP_BEGIN (ed, seq) { if ((seq->flag & SELECT)) { - if (ELEM(seq->type, - SEQ_TYPE_MOVIE, - SEQ_TYPE_IMAGE, - SEQ_TYPE_META, - SEQ_TYPE_SCENE, - SEQ_TYPE_MULTICAM)) { + if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_META)) { BKE_sequencer_proxy_set(seq, turnon); if (seq->strip->proxy == NULL) { continue; -- cgit v1.2.3