Bug 424910 - Flatten layers with animation frame provide a strange result
Summary: Flatten layers with animation frame provide a strange result
Status: RESOLVED WORKSFORME
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 4.3.0
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Emmet O'Neill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-02 07:38 UTC by grum999
Modified: 2021-04-06 04:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Before layer has been flattened (484.91 KB, image/jpeg)
2020-08-02 07:39 UTC, grum999
Details
Result after layer has been flattened (496.79 KB, image/jpeg)
2020-08-02 07:39 UTC, grum999
Details

Note You need to log in before you can comment on or make changes to this bug.
Description grum999 2020-08-02 07:38:36 UTC
SUMMARY

According to this topic (https://krita-artists.org/t/animation-and-tools/10406/2?u=grum999):
"is only possible with a workaround using transform mask. Move frames to another layer, add transform mask, merge. If it loses frames, please do complain to me since it’s the main workaround and it must be working correctly."

The workaround don't work properly.

STEPS TO REPRODUCE
1. Create an animated layer
2. Duplicate layer
3. On duplicated layer, select frames and shift them to right
4. On duplicated layer, add a sub-layer 'transform mask'
5. With tranform mask, do (for example) a translation
6. Flatten the duplicated layer


OBSERVED RESULT
1. An unexpected keyframe has been created (frame #1) with unexpected content
2. Some frames contains some unexpcted content


EXPECTED RESULT
When layer is flattened:
1. Defined keyframes must not change
2. Content of flattened layer must match content of unflattened layer


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

ADDITIONAL INFORMATION
Comment 1 grum999 2020-08-02 07:39:23 UTC
Created attachment 130568 [details]
Before layer has been flattened
Comment 2 grum999 2020-08-02 07:39:39 UTC
Created attachment 130569 [details]
Result after layer has been flattened
Comment 3 Ahab Greybeard 2020-08-02 09:42:31 UTC
I can confirm this for the 4.3.0 and 5.0.0 Aug01 prealpha (git a72eb74) appimages on Debian 10.

It's not neccessary to shift the duplicated layer frames to the right. The artifacts appear for a transformed non-shifted duplicate or for a transformed original layer.

The artifacts are fragments of past or future frames. They are permanent parts of the image. They are created by the layer flattening operation.
Comment 4 Ahab Greybeard 2020-08-02 10:00:55 UTC
I was concentrating on the artifacts in Comment 3.

I also see the spurious keyframe at frame-0 which is a copy of the first frame of the original layer, usually with a part missing.

After shifting frames, a blank keyframe is created at frame-0 and this can not be removed. The layer flattening operation creates the spurious content of frame-0 which then is a not-empty keyframe.
Again, a duplicate layer is not needed. This happens for a frames shift and transform of the original layer followed by layer flattening.
Comment 5 Tiar 2020-08-03 14:59:43 UTC
This bug report is somewhat of a high priority because this is the only way to move/transform multiple frames at once. Merging down later is important (to be able to transform later, too, or to be able to just transform some keys and then go back etc.), and it shouldn't introduce any artifacts.
Comment 6 Eoin O'Neill 2021-04-06 04:20:32 UTC
We've changed some of the way merging animated content works and it seems like it may have resulted in this being fixed. I've tried to reproduce it on a handful of test files in my collection and can't seem to get the artifacts anymore. 

If you come across this error again, please save, reopen this issue, and submit a example file!