Bug 469881

Summary: Animation Curve Issues on Resize
Product: [Applications] krita Reporter: Jesse J. Jones <mortalpoet>
Component: AnimationAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: emmetoneill.pdx, harrynft, rosetta.jpeg, ryanbwillingham
Priority: NOR    
Version First Reported In: 5.1.5   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jesse J. Jones 2023-05-17 06:09:51 UTC
SUMMARY
***
While animating with layers that used Animation Curves, resizing the image did not resize considering the Animation Curves, so the animation was positioned off-screen. Undo did not fix it and the animation layer had been permanently moved down and to the right. Could have ruined all of my work had I not saved beforehand.
***


STEPS TO REPRODUCE
1. Make a frame by frame animation, set position keyframes moving the X and Y position at different intervals.
2. Resize the image (notice the animation is not in the correct place)
3. Undo resize (notice animation is still not in the correct place)

OBSERVED RESULT
Animation curve information is not calculated properly on image resize, and undo doesn't reset it properly.

EXPECTED RESULT
Resize and undo after should not change animation curve's position.

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

ADDITIONAL INFORMATION
Easily reproducible.
Comment 1 Emmet O'Neill 2025-06-04 23:54:43 UTC
Hey there. I recognize this is a pretty old bug report at this point, but I'm slowly working through the backlog.

I can't reproduce this currently, though I tested it on Linux and not Windows. (Doesn't seem like it should matter, but we can do further testing if needed.) Having run your script I did come across an unrelated issue with the script itself, at least as it pertains to my specific test file, but nothing on the Krita side.

Is this still something that you can reproduce on your system? Are you still affected by this?
Comment 2 Emmet O'Neill 2025-06-05 22:48:08 UTC
(I'm sorry. I posted that response into the wrong ticket. I'm reopening this report for now.)
Comment 3 Emmet O'Neill 2025-06-05 23:26:21 UTC
Ok, I'm confirming this bug for real this time, and I think I know what the issue is: It seems that when we scale an image with curves, we are not only scaling the values of the keyframes but also scaling the interpolated values and creating new keyframes out of those values.
Comment 4 Emmet O'Neill 2025-06-05 23:28:23 UTC
*** Bug 475336 has been marked as a duplicate of this bug. ***
Comment 5 Emmet O'Neill 2025-06-11 22:57:50 UTC
Git commit 1d04a5f2f4cb8924b35d73cae448e86aefbb5e75 by Emmet O'Neill.
Committed on 11/06/2025 at 22:52.
Pushed by emmetoneill into branch 'master'.

BUGFIX: Fixed incorrect scaling of animated transform mask values.

It seems that when scaling a canvas that contains an
animated transform mask, the transform parameter scaling
function was creating new keyframes out of the previously
interpolated in-between values, which was causing
the transform mask to act in an unpredictable and
undesirable way.

Now we simply scale the scalar keyframes as needed.
Related: bug 475336

M  +0    -2    plugins/tools/tool_transform2/KisAnimatedTransformMaskParamsHolder.cpp

https://invent.kde.org/graphics/krita/-/commit/1d04a5f2f4cb8924b35d73cae448e86aefbb5e75
Comment 6 Emmet O'Neill 2025-06-11 23:14:55 UTC
*** Bug 500558 has been marked as a duplicate of this bug. ***
Comment 7 Emmet O'Neill 2025-06-11 23:16:32 UTC
*** Bug 496665 has been marked as a duplicate of this bug. ***
Comment 8 Emmet O'Neill 2025-06-18 23:54:13 UTC
Git commit 1c04b47b35a188bb073740b1ff399767a523d41e by Emmet O'Neill.
Committed on 18/06/2025 at 23:53.
Pushed by emmetoneill into branch 'krita/5.2'.

BUGFIX: Fixed incorrect scaling of animated transform mask values.

It seems that when scaling a canvas that contains an
animated transform mask, the transform parameter scaling
function was creating new keyframes out of the previously
interpolated in-between values, which was causing
the transform mask to act in an unpredictable and
undesirable way.

Now we simply scale the scalar keyframes as needed.
Related: bug 475336
(cherry picked from commit 1d04a5f2f4cb8924b35d73cae448e86aefbb5e75)

M  +0    -2    plugins/tools/tool_transform2/KisAnimatedTransformMaskParamsHolder.cpp

https://invent.kde.org/graphics/krita/-/commit/1c04b47b35a188bb073740b1ff399767a523d41e