[Bf-blender-cvs] [58bea005c58] master: VSE: add movie strips on top of audio

Richard Antalik noreply at git.blender.org
Sun May 19 20:55:50 CEST 2019


Commit: 58bea005c58956674c7f4a9a7a85ff943c140f03
Author: Richard Antalik
Date:   Sun May 19 11:21:37 2019 -0700
Branches: master
https://developer.blender.org/rB58bea005c58956674c7f4a9a7a85ff943c140f03

VSE: add movie strips on top of audio

- add movies to channel above free slot (no check for 2 free slots),
  add sound to the free slot
- don't override channel settings if `channel` property is set

This is just a hack. Propper implementation should be done along with T59540

Reviewed By: brecht

Differential Revision: https://developer.blender.org/T59540

===================================================================

M	source/blender/blenkernel/intern/sequencer.c
M	source/blender/editors/space_sequencer/sequencer_add.c

===================================================================

diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 99536b979b6..c7dd5db27e1 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -5668,12 +5668,12 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
 
   if (seq_load->flag & SEQ_LOAD_MOVIE_SOUND) {
     int start_frame_back = seq_load->start_frame;
-    seq_load->channel++;
+    seq_load->channel--;
 
     seq_load->seq_sound = BKE_sequencer_add_sound_strip(C, seqbasep, seq_load);
 
     seq_load->start_frame = start_frame_back;
-    seq_load->channel--;
+    seq_load->channel++;
   }
 
   /* can be NULL */
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index b5bb79fb430..e8f18eeebc7 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -149,7 +149,7 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
   int proximity = INT_MAX;
 
   if (!ed || !ed->seqbasep) {
-    return 1;
+    return 2;
   }
 
   for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -161,9 +161,9 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
   }
 
   if (tgt) {
-    return tgt->machine;
+    return tgt->machine + 1;
   }
-  return 1;
+  return 2;
 }
 
 static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, int flag, int type)
@@ -173,7 +173,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i
   int cfra = (int)CFRA;
 
   /* effect strips don't need a channel initialized from the mouse */
-  if (!(flag & SEQPROP_NOCHAN)) {
+  if (!(flag & SEQPROP_NOCHAN) && RNA_struct_property_is_set(op->ptr, "channel") == 0) {
     RNA_int_set(op->ptr, "channel", sequencer_generic_invoke_xy_guess_channel(C, type));
   }



More information about the Bf-blender-cvs mailing list