[Bf-blender-cvs] [6786ef6] master: Fix T43986: VSE Mask Modifier don't move with video-Clip.

Bastien Montagne noreply at git.blender.org
Fri Mar 20 12:42:52 CET 2015


Commit: 6786ef6783fa924d1ad0625d557f0c1fcb5d9ede
Author: Bastien Montagne
Date:   Fri Mar 20 12:39:25 2015 +0100
Branches: master
https://developer.blender.org/rB6786ef6783fa924d1ad0625d557f0c1fcb5d9ede

Fix T43986: VSE Mask Modifier don't move with video-Clip.

Now mask animation is offset to start of strip, instead of staying at frame 1!

Warning: this may break existing files, in case some would be using (hacking around!)
current bad behavior...

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

M	source/blender/blenkernel/BKE_sequencer.h
M	source/blender/blenkernel/intern/seqmodifier.c
M	source/blender/blenkernel/intern/sequencer.c

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

diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index c936ce5..5649e76 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -449,7 +449,9 @@ void BKE_sequence_modifier_list_copy(struct Sequence *seqn, struct Sequence *seq
 int BKE_sequence_supports_modifiers(struct Sequence *seq);
 
 /* internal filters */
-struct ImBuf *BKE_sequencer_render_mask_input(const SeqRenderData *context, int mask_input_type, struct Sequence *mask_sequence, struct Mask *mask_id, int cfra, bool make_float);
+struct ImBuf *BKE_sequencer_render_mask_input(
+        const SeqRenderData *context, int mask_input_type, struct Sequence *mask_sequence, struct Mask *mask_id,
+        int cfra, int fra_offset, bool make_float);
 void BKE_sequencer_color_balance_apply(struct StripColorBalance *cb, struct ImBuf *ibuf, float mul, bool make_float, struct ImBuf *mask_input);
 
 #endif  /* __BKE_SEQUENCER_H__ */
diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c
index edd3d8e..b9d096f 100644
--- a/source/blender/blenkernel/intern/seqmodifier.c
+++ b/source/blender/blenkernel/intern/seqmodifier.c
@@ -77,9 +77,9 @@ typedef struct ModifierThread {
 } ModifierThread;
 
 
-static ImBuf *modifier_mask_get(SequenceModifierData *smd, const SeqRenderData *context, int cfra, bool make_float)
+static ImBuf *modifier_mask_get(SequenceModifierData *smd, const SeqRenderData *context, int cfra, int fra_offset, bool make_float)
 {
-	return BKE_sequencer_render_mask_input(context, smd->mask_input_type, smd->mask_sequence, smd->mask_id, cfra, make_float);
+	return BKE_sequencer_render_mask_input(context, smd->mask_input_type, smd->mask_sequence, smd->mask_id, cfra, fra_offset, make_float);
 }
 
 static void modifier_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
@@ -667,7 +667,7 @@ ImBuf *BKE_sequence_modifier_apply_stack(const SeqRenderData *context, Sequence
 			continue;
 
 		if (smti->apply) {
-			ImBuf *mask = modifier_mask_get(smd, context, cfra, ibuf->rect_float != NULL);
+			ImBuf *mask = modifier_mask_get(smd, context, cfra, seq->start, ibuf->rect_float != NULL);
 
 			if (processed_ibuf == ibuf)
 				processed_ibuf = IMB_dupImBuf(ibuf);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index cb23b1e..c45db30 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1920,7 +1920,10 @@ static void *color_balance_do_thread(void *thread_data_v)
 	return NULL;
 }
 
-ImBuf *BKE_sequencer_render_mask_input(const SeqRenderData *context, int mask_input_type, Sequence *mask_sequence, Mask *mask_id, int cfra, bool make_float)
+/* cfra is offset by fra_offset only in case we are using a real mask. */
+ImBuf *BKE_sequencer_render_mask_input(
+        const SeqRenderData *context, int mask_input_type, Sequence *mask_sequence, Mask *mask_id,
+        int cfra, int fra_offset, bool make_float)
 {
 	ImBuf *mask_input = NULL;
 
@@ -1939,7 +1942,7 @@ ImBuf *BKE_sequencer_render_mask_input(const SeqRenderData *context, int mask_in
 		}
 	}
 	else if (mask_input_type == SEQUENCE_MASK_INPUT_ID) {
-		mask_input = seq_render_mask(context, mask_id, cfra, make_float);
+		mask_input = seq_render_mask(context, mask_id, cfra - fra_offset, make_float);
 	}
 
 	return mask_input;




More information about the Bf-blender-cvs mailing list