Fix #144432: VSE scopes sometimes stop updating during playback

Address it by not only checking whether the image pointer is the same,
but also whether the timeline frame is the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/144433
This commit is contained in:
Aras Pranckevicius
2025-08-12 14:02:50 +02:00
committed by Aras Pranckevicius
parent b06d534148
commit 9fbc1a5259
3 changed files with 8 additions and 3 deletions

View File

@@ -775,7 +775,8 @@ static void sequencer_draw_scopes(const SpaceSeq &space_sequencer, ARegion &regi
static bool sequencer_calc_scopes(const SpaceSeq &space_sequencer,
const ColorManagedViewSettings &view_settings,
const ColorManagedDisplaySettings &display_settings,
const ImBuf &ibuf)
const ImBuf &ibuf,
const int timeline_frame)
{
if (space_sequencer.mainb == SEQ_DRAW_IMG_IMBUF && space_sequencer.zebra == 0) {
@@ -783,7 +784,7 @@ static bool sequencer_calc_scopes(const SpaceSeq &space_sequencer,
}
SeqScopes *scopes = &space_sequencer.runtime->scopes;
if (scopes->reference_ibuf != &ibuf) {
if (scopes->reference_ibuf != &ibuf || scopes->timeline_frame != timeline_frame) {
scopes->cleanup();
}
@@ -1494,7 +1495,8 @@ static void sequencer_preview_draw_overlays(const bContext *C,
bool has_scopes = false;
if (overlay_ibuf &&
sequencer_calc_scopes(space_sequencer, view_settings, display_settings, *overlay_ibuf))
sequencer_calc_scopes(
space_sequencer, view_settings, display_settings, *overlay_ibuf, timeline_frame))
{
/* Draw scope. */
sequencer_draw_scopes(space_sequencer, region);

View File

@@ -50,6 +50,8 @@ void SeqScopes::cleanup()
vector_ibuf = nullptr;
}
histogram.data.reinitialize(0);
reference_ibuf = nullptr;
timeline_frame = 0;
}
static blender::float2 rgb_to_uv_normalized(const float rgb[3])

View File

@@ -43,6 +43,7 @@ struct SeqScopes : public NonCopyable {
static constexpr float VECSCOPE_V_SCALE = 0.5f / 0.615f;
const ImBuf *reference_ibuf = nullptr;
int timeline_frame = 0;
ImBuf *zebra_ibuf = nullptr;
ImBuf *waveform_ibuf = nullptr;
ImBuf *sep_waveform_ibuf = nullptr;