Bug 445265 - Animation cache not updated correctly
Summary: Animation cache not updated correctly
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 5.0.0-beta2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-11-10 09:57 UTC by David Garcia
Modified: 2021-11-11 03:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Animation cache not refresh/updated demonstration (1.81 MB, video/x-matroska)
2021-11-10 09:57 UTC, David Garcia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Garcia 2021-11-10 09:57:10 UTC
Created attachment 143400 [details]
Animation cache not refresh/updated demonstration

SUMMARY

The animation cache is sometimes not updated when moving a frame, then moving the timeline cursor with the mouse: The canvas is not update/refresh and it can cause weird effect when painting on it (well, it updates only a "brush size" rectangle on the canvas, have a look on the video attached).

STEPS TO REPRODUCE
1. Create three spaced frames on timeline (should be same layer)
2. Make sure the middle frame looks different from the two other to highlight the bug
3. Move the middle frame on the timeline
4. Move the timeline cursor with your mouse and stop between the second and last frame

OBSERVED RESULT
The canvas is not updated and shows the first frame, painting on it refresh only where we paint.

EXPECTED RESULT
The canvas shows the second frame content

SOFTWARE/OS VERSIONS
Windows: Windows 10.0.19042
Linux/KDE Plasma: Linux Mint 21
Comment 1 Ahab Greybeard 2021-11-10 20:15:10 UTC
I can confirm this for the Nov 10 5.1.0-prealpha (git 17a3a4c) appimage on Debian 10.
It does not happen with the 4.4.8 appimage.

The second/middle frame content is removed from the cache and does not appear anywhere when moving the timeline cursor manually at the top of the Timeline docker.

When the cursor is first moved forward, past the new second frame position, the contents of the second frame are displayed as they used to be.
After the cursor is moved back before the new second frame position, the second frame is not displayed anywhere.

However, if the timeline cursor is manually scrubbed over the range a few times, the correct content appears.
Also, selecting the frame by clicking on it makes the correct content appear.
Comment 2 Eoin O'Neill 2021-11-11 03:58:25 UTC
Git commit 014f33b517fe4b8b83e518dbd7445bf1e9cf7e4c by Eoin O'Neill.
Committed on 11/11/2021 at 03:51.
Pushed by eoinoneill into branch 'master'.

Fix caching bug when scrubbing from cached to uncached frame.

An optimization to prevent unnecessary refreshes was causing a
regression. Since scrubbing on cached frames doesn't trigger a
time change, but uncached frames do, an optimization where
we check if the last frame and the current frame exist within
the same "timeframe" would lock users out from seeing the
uncached frames properly when scrubbing.

We now force at least one time switch call when switching from
uncached to cached frames to prevent this issue. Now, it will
properly recognize that the last frame and the 'current frame'
are different and refresh their contents.

M  +23   -6    plugins/dockers/animation/KisTimeBasedItemModel.cpp
M  +1    -0    plugins/dockers/animation/KisTimeBasedItemModel.h

https://invent.kde.org/graphics/krita/commit/014f33b517fe4b8b83e518dbd7445bf1e9cf7e4c
Comment 3 Eoin O'Neill 2021-11-11 03:59:24 UTC
Git commit f7bd2832f3414f4222f1f0e8812dbf8919b4579b by Eoin O'Neill.
Committed on 11/11/2021 at 03:58.
Pushed by eoinoneill into branch 'krita/5.0'.

Fix caching bug when scrubbing from cached to uncached frame.

An optimization to prevent unnecessary refreshes was causing a
regression. Since scrubbing on cached frames doesn't trigger a
time change, but uncached frames do, an optimization where
we check if the last frame and the current frame exist within
the same "timeframe" would lock users out from seeing the
uncached frames properly when scrubbing.

We now force at least one time switch call when switching from
uncached to cached frames to prevent this issue. Now, it will
properly recognize that the last frame and the 'current frame'
are different and refresh their contents.
(cherry picked from commit 014f33b517fe4b8b83e518dbd7445bf1e9cf7e4c)

M  +23   -6    plugins/dockers/animation/KisTimeBasedItemModel.cpp
M  +1    -0    plugins/dockers/animation/KisTimeBasedItemModel.h

https://invent.kde.org/graphics/krita/commit/f7bd2832f3414f4222f1f0e8812dbf8919b4579b