Bug 377289 - playback does not work well with masks - resets every time
Summary: playback does not work well with masks - resets every time
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 4.0
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-06 13:30 UTC by Bollebib
Modified: 2020-03-23 13:31 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Kra turntable animation that shows the cache regeneration problem. (3.32 MB, application/x-krita)
2017-04-20 12:38 UTC, wolthera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bollebib 2017-03-06 13:30:44 UTC
during playback when cache is loaded,if masks are present the cache will be refreshed every time
Comment 1 Dmitry Kazakov 2017-03-06 14:11:28 UTC
Hi, Bollebib!

What types of masks cause such behavior? Only Transformation Mask or any 
type of mask?

On 06.03.2017 16:30, Bollebib wrote:
> https://bugs.kde.org/show_bug.cgi?id=377289
>
>              Bug ID: 377289
>             Summary: playback does not work well with masks - resets every
>                      time
>             Product: krita
>             Version: 3.1.2
>            Platform: Other
>                  OS: Linux
>              Status: UNCONFIRMED
>            Severity: normal
>            Priority: NOR
>           Component: Animation
>            Assignee: krita-bugs-null@kde.org
>            Reporter: kwadraatnope@hotmail.com
>    Target Milestone: ---
>
> during playback when cache is loaded,if masks are present the cache will be
> refreshed every time
>
Comment 2 Halla Rempt 2017-03-14 09:20:40 UTC
Needinfo.
Comment 3 Bollebib 2017-03-17 12:43:08 UTC
Transform masks, blur filter and colorchanging filters so far;so i would assume most if not all filters.
Comment 4 Bollebib 2017-03-26 14:23:29 UTC
reopening so it can get triaged again
Comment 5 wolthera 2017-04-20 12:38:53 UTC
Created attachment 105112 [details]
Kra turntable animation that shows the cache regeneration problem.

I can confirm, and even have a file to reproduce with.

This is technically already a known bug, as it is partially why the transformation masks animation cannot be exposed to the gui.

However, it also happens without animated transform masks.

Steps to reproduce:
1. Open the attached kra file.
2. Hide the layer with the transform mask.
3. Press play and let the animation play about 10 times(that's only 10 seconds)
4. This should go smoothly. This is normal behaviour.
5. Then, stop, turn on the top layer with transform mask.
6. Press play and watch the animation run for 10 times.
7. For me, the cache is regenerated every 4th run.
Comment 6 Bollebib 2018-03-28 15:52:46 UTC
the problems seem worse now in 4.0 
playback is stuck in a loop and does not work.
Comment 7 Dmitry Kazakov 2020-03-03 19:39:19 UTC
The problem might be caused caused by two reasons:

1) We have KisDelayedUpdateNodeInterface, which KisTransformMask and KisShapeLayer inherit from. These types of layers asynchronously generate KisSpontaneousJob to regenerate themselves after several seconds of user's inactivity. This might cause the cancellation of the playback.

2) Some background jobs, like Instant Preview generation may also cause cancellation of the playback.

To debug this bug one should do two things:

1) Add debugging output (ENTER_FUNCTION()) to KisRecalculateTransformMaskJob and see if it correlates with playback cancellation.

2) Add debugger breakpoint to KisAnimationPlayer::slotCancelPlaybackSafe() and see where it comes from. Some code seem to emit sigStrokeEndRequested(). And it should be catched.
Comment 8 Eoin O'Neill 2020-03-09 17:23:38 UTC
Git commit 78dfc72797320fe616934edff28b42467afc122d by Eoin O'Neill.
Committed on 09/03/2020 at 17:22.
Pushed by eoinoneill into branch 'master'.

Fix Animation Cache Clear for Transform Masks

This was triggered during spontaneous job updates where transforms masks
would inappropriately flush all frames in because the frames were marked
dirty.

requestProjectUpdateNoFilthy now has a method that allows the refreshing
of projection without triggering an animation update.

M  +8    -1    libs/image/kis_image.cc
M  +2    -0    libs/image/kis_image.h
M  +1    -0    libs/image/kis_image_animation_interface.cpp
M  +9    -3    libs/image/kis_recalculate_transform_mask_job.cpp

https://invent.kde.org/kde/krita/commit/78dfc72797320fe616934edff28b42467afc122d
Comment 9 Halla Rempt 2020-03-23 13:31:57 UTC
Git commit 8a2e13662bce28a52864c91570f4afbacff516f6 by Boudewijn Rempt, on behalf of Eoin O'Neill.
Committed on 23/03/2020 at 13:01.
Pushed by rempt into branch 'krita/4.2'.

Fix Animation Cache Clear for Transform Masks

This was triggered during spontaneous job updates where transforms masks
would inappropriately flush all frames in because the frames were marked
dirty.

requestProjectUpdateNoFilthy now has a method that allows the refreshing
of projection without triggering an animation update.

M  +8    -1    libs/image/kis_image.cc
M  +2    -0    libs/image/kis_image.h
M  +1    -0    libs/image/kis_image_animation_interface.cpp
M  +9    -3    libs/image/kis_recalculate_transform_mask_job.cpp

https://invent.kde.org/kde/krita/commit/8a2e13662bce28a52864c91570f4afbacff516f6