Changeset View
Standalone View
source/blender/editors/space_sequencer/sequencer_edit.c
| Context not available. | |||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, pj->scene); | WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, pj->scene); | ||||
| } | } | ||||
| static void seq_proxy_build_job(const bContext *C, ReportList *reports) | static void seq_proxy_build_job(const bContext *C, ReportList *reports, wmOperator *op) | ||||
ISS: parameter `op` is unused, forgot to mention last time. | |||||
| { | { | ||||
| wmJob *wm_job; | wmJob *wm_job; | ||||
| ProxyJob *pj; | ProxyJob *pj; | ||||
Not Done Inline ActionsThere is already a loop that goes through all strips, so don't iterate twice. ISS: There is already a loop that goes through all strips, so don't iterate twice. | |||||
| Context not available. | |||||
| } | } | ||||
| file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list"); | 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) { | SEQP_BEGIN (ed, seq) { | ||||
| if ((seq->flag & SELECT)) { | if ((seq->flag & SELECT)) { | ||||
| bool success = BKE_sequencer_proxy_rebuild_context( | selected = true; | ||||
| pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue); | if (ELEM(seq->type, | ||||
| if (!success) { | SEQ_TYPE_MOVIE, | ||||
| BKE_reportf(reports, RPT_ERROR, "Could not build proxy for strip %s", seq->name); | SEQ_TYPE_IMAGE, | ||||
| SEQ_TYPE_META, | |||||
| SEQ_TYPE_SCENE, | |||||
| SEQ_TYPE_MULTICAM)) { | |||||
| if (!(seq->flag & SEQ_USE_PROXY)) { | |||||
| BKE_reportf(reports, RPT_ERROR, "Proxy is not enabled for %s", seq->name); | |||||
| } | |||||
ISSUnsubmitted Not Done Inline ActionsI am not sure if this is useful to check. This should definitely not throw error. Personally RPT_INFO would be appropriate with message Proxy is not enabled for %s, skipping. ISS: I am not sure if this is useful to check. This should definitely not throw error. Personally… | |||||
| else if (seq->strip->proxy->build_size_flags == 0) { | |||||
| BKE_reportf(reports, RPT_WARNING, "Resolution is not selected for %s", seq->name); | |||||
| } | |||||
| else if ((seq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) != 0) { | |||||
| BKE_reportf(reports, RPT_WARNING, "Overwrite is not checked for %s", seq->name); | |||||
| } | |||||
ISSUnsubmitted Not Done Inline ActionsYou can only do this check if success is false. bool success = BKE_sequencer_proxy_rebuild_context(
pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue);
if (!success) {
if ((seq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) != 0) {
BKE_reportf(reports, RPT_WARNING, "Overwrite is not checked for %s", seq->name);
}
else { /* Unknown error */
BKE_reportf(reports, RPT_ERROR, "Could not build proxy for %s", seq->name);
}
}ISS: You can only do this check if `success` is false.
```
bool success =… | |||||
| else { /* Rebuild */ | |||||
Not Done Inline ActionsThis check should not be necessary, because it is checked in BKE_sequencer_proxy_rebuild_context and if strip hasn't got this member initialized, it will return success = true Therefore even else {...} branch will never be executed and should be removed. ISS: This check should not be necessary, because it is checked in… | |||||
| bool success = BKE_sequencer_proxy_rebuild_context( | |||||
| pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue); | |||||
| if (!success) { /* Unknown error */ | |||||
| BKE_reportf(reports, RPT_ERROR, "Could not build proxy for %s", seq->name); | |||||
| } | |||||
Not Done Inline ActionsThis flag is set in build_flags not build_size_flags ISS: This flag is set in `build_flags` not `build_size_flags` | |||||
| } | |||||
| } | |||||
| else { | |||||
| BKE_reportf(reports, RPT_WARNING, "Proxy not supported for strip type %s", seq->name); | |||||
| } | } | ||||
ISSUnsubmitted Not Done Inline ActionsThis can generate too much noise if you select all strips and rebuild proxies. What I was suggesting was to only run WM_jobs_start(CTX_wm_manager(C), wm_job); if there is at least 1 valid strip in selection. You could throw this error in case there isn't. ISS: This can generate too much noise if you select all strips and rebuild proxies.
What I was… | |||||
| } | } | ||||
Not Done Inline ActionsThis condition is incorrect. it should be if (!overwrite) ISS: This condition is incorrect. it should be `if (!overwrite)` | |||||
| } | } | ||||
| SEQ_END; | SEQ_END; | ||||
| if (!selected) { | |||||
| BKE_reportf(reports, RPT_WARNING, "Select one or more strips"); | |||||
| return; | |||||
| } | |||||
| BLI_gset_free(file_list, MEM_freeN); | BLI_gset_free(file_list, MEM_freeN); | ||||
| if (!WM_jobs_is_running(wm_job)) { | if (!WM_jobs_is_running(wm_job)) { | ||||
| Context not available. | |||||
| wmOperator *op, | wmOperator *op, | ||||
| const wmEvent *UNUSED(event)) | const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| seq_proxy_build_job(C, op->reports); | seq_proxy_build_job(C, op->reports, op); | ||||
ISSUnsubmitted Not Done Inline Actionsparameter op is unused, forgot to mention last time. ISS: parameter `op` is unused, forgot to mention last time. | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| Context not available. | |||||
parameter op is unused, forgot to mention last time.