Bug 408421

Summary: Safe Assert when copy/pasting animated frames between different open file timelines
Product: [Applications] krita Reporter: Ahab Greybeard <ahab.greybeard>
Component: AnimationAssignee: vanyossi <ghevan>
Status: RESOLVED FIXED    
Severity: normal CC: ghevan, halla
Priority: NOR    
Version: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Safe Assert error when copying animated transparancy mask frame
circles animated layer and transparency
squares animated layer and transparency

Description Ahab Greybeard 2019-06-07 15:23:11 UTC
Created attachment 120662 [details]
Safe Assert error when copying animated transparancy mask frame

SUMMARY
This bug happens on 4.2.1 and the 06 June 4.3.0 nightly build 4.3.0-prealpha (git 3dfad53)

STEPS TO REPRODUCE
1. Open or create two images with animated layers with animated transparency masks.
2. Try to copy/paste (via the Clipboard) a frame of an animated transparency mask from one image to the other. Note that an error is shown as in the attached screenshot file. This error can be Ignored to continue.
3. Note that copying a transparency mask frame from one location to another within the same image is possible.
4, You can even copy a transparency mask frame from one image to an animated picture layer frame of the other open image - and a picture layer frame from one image to a transparency mask frame of the other image.

OBSERVED RESULT
See above

EXPECTED RESULT
It should be possible to copy/paste an animated transparency mask frame from one open image to another open image

SOFTWARE/OS VERSIONS
Krita

 Version: 4.3.0-prealpha (git 3dfad53)
 Languages: en_GB, en
 Hidpi: true

Qt

  Version (compiled): 5.12.3
  Version (loaded): 5.12.3


ADDITIONAL INFORMATION
Comment 1 vanyossi 2019-07-02 02:41:24 UTC
In fact Im getting this assert on any copy paste operation between timeline frames of different files. The where this happen seems to indicate the paste operation tries to get the information to paste from current image, which causes the assert.
Comment 2 Ahab Greybeard 2019-07-02 12:10:03 UTC
Created attachment 121283 [details]
circles animated layer and transparency
Comment 3 Ahab Greybeard 2019-07-02 12:11:05 UTC
Created attachment 121284 [details]
squares animated layer and transparency
Comment 4 Ahab Greybeard 2019-07-02 12:12:35 UTC
I've attached two simple animations that I find useful for testing this. It's become complicated:

With 4.2.1, I get Safe Assert when trying to paste the clipboard to another open image, for any kind of frame transfer between images.

With 4.2.2 onwards, I do not get a Safe Assert but the pasting action does not work between open images.

I can't understand why my noted observation 4. is no longer repeatable for 4.2.1 (It may be that I totally misunderstood what was happening but I'd find that surprising. However, moving on and using 4.2.2 and later versions ....)

It seems that the contents of the animation frame clipboard are not transferable between images. Also, if you do a copy to clipboard in one image, the previous contents of the clipboard in the other image are no longer present (or it's no longer valid).

As a workaround, it is possible to copy an entire animated layer, of either kind, from one image to another and then do the copy/paste actions on those frames in the target image, as required.

It would be useful if frames could be copy/pasted between open images.
Comment 5 vanyossi 2019-07-02 20:06:43 UTC
Im working on a fix for this one.

Right now on my patch/fix in progress it is now possible to copy frames from one image to another image. Im curently testing I did not break anything.


In 4.2.2 I can't copy paste from the timeline using keyboard shortcuts Ctrl + C, Ctrl + V, the events are not passing trough or ignored (I'll fix this one after). however I still get the safe assert when copying between images if using the context menu. Probably running krita from terminal will show you the assert.

Also afaik, Clipboard contents are global on an OS level, and gets rewritten on any copy operation.
Comment 6 vanyossi 2019-07-03 00:54:47 UTC
Interesting, this was already reported Marking as duplicate :/

*** This bug has been marked as a duplicate of bug 404595 ***
Comment 7 vanyossi 2019-07-10 05:42:26 UTC
Git commit 5b8660d22fbec0e838f03b853cdcf6e3cf2988a7 by Ivan Yossi.
Committed on 10/07/2019 at 04:51.
Pushed by ivany into branch 'master'.

Fix copy/paste frames to clipboard

This does not work if source was closed inbetween operations or
source is in another krita instance.
Related: bug 404595

M  +34   -1    plugins/dockers/animation/timeline_frames_model.cpp

https://invent.kde.org/kde/krita/commit/5b8660d22fbec0e838f03b853cdcf6e3cf2988a7
Comment 8 Halla Rempt 2019-07-10 07:50:03 UTC
Git commit aa1b086860c77b498af8aea3914a2c1d21ddea34 by Boudewijn Rempt, on behalf of Ivan Yossi.
Committed on 10/07/2019 at 07:49.
Pushed by rempt into branch 'krita/4.2'.

Fix copy/paste frames to clipboard

This does not work if source was closed inbetween operations or
source is in another krita instance.
Related: bug 404595

M  +34   -1    plugins/dockers/animation/timeline_frames_model.cpp

https://invent.kde.org/kde/krita/commit/aa1b086860c77b498af8aea3914a2c1d21ddea34