Fix T68700: Incorrect 'absolute' timing of animated masks in the Video

Sequence Editor

Code in 'seq_render_mask' will effectively do
BKE_mask_evaluate(mask_temp, mask->sfra + (cfra - fra_offset), true)
where 'fra_offset' is zero for absolute and seq->start for relative.

If we really want the scene's current frame (as advertised) if Mask Time
is set to Absolute (effectively ignoring the Mask Settings start/end) we
need to change the fra_offset from zero to mask->sfra.

Also BKE_animsys_evaluate_animdata should take mask->sfra into account
as well (otherwise mask animation [points] and other animation [e.g.
opacity] will run out of sync)

Reviewers: campbellbarton, ISS

Maniphest Tasks: T68700

Differential Revision: https://developer.blender.org/D5495
This commit is contained in:
Philipp Oeser 2019-08-15 20:23:13 +02:00
parent fa76f08db5
commit b77da65e8c
Notes: blender-bot 2023-02-14 01:13:22 +01:00
Referenced by commit 3e4e346e59, Fix T71489: Video editor crash
Referenced by commit 391b652be4, Cleanup: clang format for rBb77da65e8c4d
Referenced by issue #68700, Incorrect timing of animated masks in the Video Sequence Editor
2 changed files with 3 additions and 2 deletions

View File

@ -34,6 +34,7 @@
#include "BLT_translation.h"
#include "DNA_mask_types.h"
#include "DNA_sequence_types.h"
#include "DNA_scene_types.h"
@ -1044,7 +1045,7 @@ ImBuf *BKE_sequence_modifier_apply_stack(const SeqRenderData *context,
frame_offset = seq->start;
}
else /*if (smd->mask_time == SEQUENCE_MASK_TIME_ABSOLUTE)*/ {
frame_offset = 0;
frame_offset = ((Mask *)smd->mask_id)->sfra;
}
ImBuf *mask = modifier_mask_get(smd, context, cfra, frame_offset, ibuf->rect_float != NULL);

View File

@ -3340,7 +3340,7 @@ static ImBuf *seq_render_mask(const SeqRenderData *context, Mask *mask, float nr
/* anim-data */
adt = BKE_animdata_from_id(&mask->id);
BKE_animsys_evaluate_animdata(context->scene, &mask_temp->id, adt, nr, ADT_RECALC_ANIM, false);
BKE_animsys_evaluate_animdata(context->scene, &mask_temp->id, adt, mask->sfra + nr, ADT_RECALC_ANIM, false);
maskbuf = MEM_mallocN(sizeof(float) * context->rectx * context->recty, __func__);