Fix T81594: Unable to reassign effect inputs

This was caused by canceling operator if strip has more than 0 inputs.
Logic should be reversed - cancel only if strip has 0 inputs.

BKE_sequencer_render_loop_check() arguments had to be sanitized because
seq_effect_find_selected() can set seq1,2,3 to NULL

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9197
This commit is contained in:
Richard Antalik 2020-10-17 07:01:12 +02:00
parent e2c5439cb4
commit 2c14a950a7
Notes: blender-bot 2023-02-14 07:47:59 +01:00
Referenced by issue #81594, Unable to reassign input for effect strips in the Sequencer
Referenced by issue #80717, Crash after "Reassigning Inputs" to newly created Effect Clip
2 changed files with 5 additions and 1 deletions

View File

@ -2134,7 +2134,7 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
Sequence *seq1, *seq2, *seq3, *last_seq = BKE_sequencer_active_get(scene);
const char *error_msg;
if (BKE_sequence_effect_get_num_inputs(last_seq->type) != 0) {
if (BKE_sequence_effect_get_num_inputs(last_seq->type) == 0) {
BKE_report(op->reports, RPT_ERROR, "Cannot reassign inputs: strip has no inputs");
return OPERATOR_CANCELLED;
}

View File

@ -6085,6 +6085,10 @@ bool BKE_sequencer_check_scene_recursion(Scene *scene, ReportList *reports)
/* Check if "seq_main" (indirectly) uses strip "seq". */
bool BKE_sequencer_render_loop_check(Sequence *seq_main, Sequence *seq)
{
if (seq_main == NULL || seq == NULL) {
return false;
}
if (seq_main == seq) {
return true;
}