Sequencer: Add option to use absolute mask animation time
[blender.git] / source / blender / blenkernel / intern / seqmodifier.c
index 84d1c1bc414af43e8adc98f18b60a68964bf43f4..2c46cf128444e8fdddcaf142fafa2238d5298f1e 100644 (file)
@@ -978,7 +978,19 @@ ImBuf *BKE_sequence_modifier_apply_stack(const SeqRenderData *context, Sequence
                        continue;
 
                if (smti->apply) {
                        continue;
 
                if (smti->apply) {
-                       ImBuf *mask = modifier_mask_get(smd, context, cfra, seq->start, ibuf->rect_float != NULL);
+                       int frame_offset;
+                       if (smd->mask_time == SEQUENCE_MASK_TIME_RELATIVE) {
+                               frame_offset = seq->start;
+                       }
+                       else /*if (smd->mask_time == SEQUENCE_MASK_TIME_ABSOLUTE)*/ {
+                               frame_offset = 0;
+                       }
+
+                       ImBuf *mask = modifier_mask_get(smd,
+                                                       context,
+                                                       cfra,
+                                                       frame_offset,
+                                                       ibuf->rect_float != NULL);
 
                        if (processed_ibuf == ibuf)
                                processed_ibuf = IMB_dupImBuf(ibuf);
 
                        if (processed_ibuf == ibuf)
                                processed_ibuf = IMB_dupImBuf(ibuf);