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
Confirmed. Thanks. (Note: May or may not be related to this https://bugs.kde.org/show_bug.cgi?id=438768)
(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)
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".
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.
Hi, Grum! I have a feeling that this bug is actually an expected behavior. The animation cache that you see on the timeline is only the GUI cache. It has nothing related to the cache in a transformation mask. In your example, when you change the time, you do actually change the content of the layer (and its mask), so the mask must be recalcualted to show the correct result. There is a small missed optimization opportunity when a non-animated transformation mask is situated on a non-animated layer, and even in this case, the mask is still regenerated on the time change. That is just how the system is designed to work right now (we have no way of distinguishing the source and destination time points of the update). Speaking truly, I have a feeling that it would be better to rewirte transform masks to use GPU instead of just trying to cut off a few extra updates. I will close the bug right now (as it waits for the GPU-transform masks rewrite). If you think that your bug is different or critical, please reopen the bug.