Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2020-06-18 06:25:20 +0300
committerRichard Antalik <richardantalik@gmail.com>2020-06-18 06:53:25 +0300
commit47f98a38d0f8a83648c13a54adc717d49d0898f1 (patch)
treef9c9815b817de8eeff2566dd3c4a4a2ef67c64ec /source/blender/editors/space_sequencer/sequencer_edit.c
parent8df99b1c0c750b90a1568cd61c916d05e3693deb (diff)
VSE: Fix assigning effect strip inputs
Partialy fixes T73828 Currently all 3 effect inputs were assigned even if not all 3 were used. This causes problems with reassigning effects in python, because 3rd input is not accessible. This patch will only assign inputs that are necessary for effect to work properly. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D6868
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 4a8bea11b41..cbc4d9e51f1 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -673,6 +673,14 @@ int seq_effect_find_selected(Scene *scene,
*r_selseq2 = seq2;
*r_selseq3 = seq3;
+ /* TODO(Richard): This function needs some refactoring, this is just quick hack for T73828. */
+ if (BKE_sequence_effect_get_num_inputs(type) < 3) {
+ *r_selseq3 = NULL;
+ }
+ if (BKE_sequence_effect_get_num_inputs(type) < 2) {
+ *r_selseq2 = NULL;
+ }
+
return 1;
}
@@ -2222,6 +2230,11 @@ 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) {
+ BKE_report(op->reports, RPT_ERROR, "Cannot reassign inputs: strip has no inputs");
+ return OPERATOR_CANCELLED;
+ }
+
if (!seq_effect_find_selected(
scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg)) {
BKE_report(op->reports, RPT_ERROR, error_msg);