Bug 438768 - Animated transform masks regenerate on every time change unconditionally
Summary: Animated transform masks regenerate on every time change unconditionally
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-16 20:02 UTC by grum999
Modified: 2023-10-18 16:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
example with activity on transform mask even when cache is generated (383.16 KB, video/webm)
2021-06-16 20:02 UTC, grum999
Details

Note You need to log in before you can comment on or make changes to this bug.
Description grum999 2021-06-16 20:02:04 UTC
Created attachment 139412 [details]
example with activity on transform mask even when cache is generated

SUMMARY


Even if cache is rendered, when going to another frame, transformation mask is calculated.
On simple animation, it's not really a problem, but on complex animation with many animated transform mask...

STEPS TO REPRODUCE
1. Create a document with a paint layer and an animated transform mask
2. click "Play" to render cache
3. Stop playing
4. Go manually to other frames

OBSERVED RESULT
Even if cache is rendered, calculation are computed.
We can see activity on transform layer mask


EXPECTED RESULT
If frame is in cache, no calculation should be computed


SOFTWARE/OS VERSIONS
krita-5.0.0-prealpha-949e869-x86_64.appimage

ADDITIONAL INFORMATION
Occurs when cache is in memory or on-disk
Occurs is region of interest is active or not
Comment 1 Emmet O'Neill 2021-06-17 01:39:04 UTC
Confirmed. Thanks.

(Note: May or may not be related to this https://bugs.kde.org/show_bug.cgi?id=438768)
Comment 2 Emmet O'Neill 2021-06-17 01:40:46 UTC
(Whoops... I meant may be related to THIS: https://bugs.kde.org/show_bug.cgi?id=438538 Krita is doing some calculations on hidden layers)
Comment 3 Eoin O'Neill 2021-07-07 20:47:13 UTC
There's a small issue with this -- that the recalculate mask job can't get information about the cache state of the animation system (since caching happens on the GUI level.)

For now, recalculate mask no longer occurs when dealing with animated transform masks so they no longer update on a timer. This should help iron out other issues with the transform mask not fully rendering the whole desired "region".
Comment 4 Dmitry Kazakov 2023-10-16 14:53:38 UTC
The problem happens due to two weird reasons:

1) On the end of animation playback we call switchCurrentTimeAsync() with forced image regeneration, instead of just just repopulating the openGL textures.

2) On every time change we force image regeneration in KisRegenerateFrameStrokeStrategy::doStrokeCallback, which, in turn causes transformation mask to be regenerated with FILTHY position, which causes the mask's cache to be reset, even when the layer and mask don't actually change.