Bug 424111

Summary: Rescaling an animated layer leads to inconsistent scaling.
Product: [Applications] krita Reporter: Marie Kalouguine <marie.kalouguine>
Component: AnimationAssignee: Eoin O'Neill <eoinoneill1991>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard, eoinoneill1991
Priority: NOR    
Version: 4.3.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Example file for animated layer scaling

Description Marie Kalouguine 2020-07-11 20:51:25 UTC
SUMMARY
Rescaling an animated layer leads to inconsistent scaling.

STEPS TO REPRODUCE
1. Select an layer with multiple time frames.
2. Go to Layer -> Transform -> Scale layer to new size.
3. Change the size of the layer.
4. Observe that the layer changed it's size on all time frames.
5. Launch the animation.

OBSERVED RESULT
In the animation, the layer hasn't changed it's size, although when the animation stops it looks like it has.

EXPECTED RESULT
The layer looks the same when animated and when not.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.19.2
KDE Frameworks Version: 5.71.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
The bug was reproduced several times when I did these steps, but not every time, so reproducing is not guaranteed.
Comment 1 Ahab Greybeard 2020-07-14 20:01:37 UTC
Created attachment 130127 [details]
Example file for animated layer scaling

I can confirm that this happens for the 4.3.0 appimnage and the Jul-12 5.0.0 prealpha (git dd8d748).

Steps to Reproduce:
1. Open the attached Layer-scaling.kra file and duplicate animated Layer1.
2. Turn off visiblilty of Layer 1 and work on the duplicate.
2. Do a Layer Transform Scale to 80%
NOTE: The circle gets larger and every frame is the larger size..
3. Play the animation.
NOTE: Sometimes, when playing, some frames are at the previous smaller size. This may not happen.
4. Undo the Layer Transform.
NOTE: The circle returns to the original size on each frame.
5. Play the animation.
NOTE: Sometimes, when playing, some frames are at the previous larger size. This may not happen.
6. If it doesn't happen, repeat the Steps. 
7. When it happens, turn on visibility of layer 1.
NOTE: The incorrect size variations of the duplicate layer playback go away.
OR
8. When it happens, Save, Close and re-Open the file and play.
NOTE: The size variations don't happen.
Comment 2 Eoin O'Neill 2020-08-05 04:48:10 UTC
Git commit 0d5585a35ef7fab6cae198b8ba29a9d0b35105ff by Eoin O'Neill.
Committed on 05/08/2020 at 04:45.
Pushed by eoinoneill into branch 'krita/4.3'.

Correctly flush cache after layer > resize operations.

Note to future self: A lot of transform cache woes might stem
from kis_processing_applicator. Keep in mind when implementing
transform masks.

M  +4    -0    libs/image/kis_processing_applicator.cpp
M  +0    -1    libs/image/processing/KisSelectionBasedProcessingHelper.cpp
M  +0    -1    libs/image/processing/kis_transform_processing_visitor.cpp

https://invent.kde.org/graphics/krita/commit/0d5585a35ef7fab6cae198b8ba29a9d0b35105ff
Comment 3 Eoin O'Neill 2020-08-05 04:51:40 UTC
Git commit a14f26f56e4fd1b62f791c6a80a102c88dd79071 by Eoin O'Neill.
Committed on 05/08/2020 at 04:51.
Pushed by eoinoneill into branch 'master'.

Correctly flush cache after layer > resize operations.

Note to future self: A lot of transform cache woes might stem
from kis_processing_applicator. Keep in mind when implementing
transform masks.
(cherry picked from krita/4.3 commit 0d5585a35ef7fab6cae198b8ba29a9d0b35105ff)

M  +4    -0    libs/image/kis_processing_applicator.cpp
M  +0    -1    libs/image/processing/KisSelectionBasedProcessingHelper.cpp
M  +0    -1    libs/image/processing/kis_transform_processing_visitor.cpp

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