Bug 475550 - Request: make merging layers safer when working with animations
Summary: Request: make merging layers safer when working with animations
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (other bugs)
Version First Reported In: 5.2.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-13 05:57 UTC by rebuilderster
Modified: 2024-02-08 11:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rebuilderster 2023-10-13 05:57:46 UTC
Currently, using a workflow where you create layers and merge them a lot is dangerous in animations. It's easy to lose hours of work if you do not remember to create a blank keyframe for each new layer you create.

Say you have an animation timeline with several frames and you're working on one of the frames.
If you create a new layer in animation mode, paint on it, then merge it down, you will overwrite whatever was on the layer you merged to in every frame in the project. There’s no warning, you may not notice this until much later. This is particularly difficult to avoid if your workflow is to create temp layers that you then merge down into a master layer, as ctrl+e to merge down has become automatic.

IMO the default should be for a new layer to start with a single blank keyframe, so you’re only editing a specific frame and avoid this destructive problem. If the user needs to have a layer’s contents propagate over multiple frames, they can go and change those settings. It’s more cumbersome for those use cases, but it’s much safer.
Comment 1 wolthera 2023-10-18 11:23:56 UTC
Assigning to dmitry as pr his request.
Comment 2 Dmitry Kazakov 2023-10-18 13:44:08 UTC
How about the following solution:

1) When merging a non-animated layer over the top of an animated one, the layer is merged into the **current frame** (potentially, with auto-keyframing)

2) The user will also see a floating message telling "To merge the layer into all the frames create at least one frame in the source layer"
Comment 3 Bug Janitor Service 2023-10-18 15:09:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1962
Comment 4 rebuilderster 2023-10-19 06:50:14 UTC
(In reply to Dmitry Kazakov from comment #2)
> How about the following solution:
> 
> 1) When merging a non-animated layer over the top of an animated one, the
> layer is merged into the **current frame** (potentially, with
> auto-keyframing)
> 
> 2) The user will also see a floating message telling "To merge the layer
> into all the frames create at least one frame in the source layer"

This sounds good to me, as long as the floating message is relatively unobtrusive and doesn't require user interaction to dismiss.
Comment 5 Dmitry Kazakov 2023-10-20 15:40:03 UTC
Git commit d259fa1066f8c95b0b99bfd6a0f64393050c9046 by Dmitry Kazakov.
Committed on 20/10/2023 at 17:39.
Pushed by dkazakov into branch 'master'.

[new-string] Fix merge down of an non-animated layer to an animated one

1) When merging a non-animated layer over the top of an animated one,
   the layer is merged into the **current frame** (at the current time
   position)

2) The user also sees a floating message telling to create a new frame
   to fall back to the old behavior.

M  +2    -2    libs/image/kis_group_layer.cc
M  +1    -1    libs/image/kis_group_layer.h
M  +15   -11   libs/image/kis_layer.cc
M  +1    -1    libs/image/kis_layer.h
M  +29   -6    libs/image/kis_layer_utils.cpp
M  +2    -2    libs/ui/flake/kis_shape_layer.cc
M  +1    -1    libs/ui/flake/kis_shape_layer.h
M  +17   -6    libs/ui/kis_layer_manager.cc

https://invent.kde.org/graphics/krita/-/commit/d259fa1066f8c95b0b99bfd6a0f64393050c9046
Comment 6 Dmitry Kazakov 2023-10-20 15:40:30 UTC
Git commit b21ca440a6658be2869fe0d6084702f1a30b0b11 by Dmitry Kazakov.
Committed on 20/10/2023 at 17:40.
Pushed by dkazakov into branch 'krita/5.2'.

[new-string] Fix merge down of an non-animated layer to an animated one

1) When merging a non-animated layer over the top of an animated one,
   the layer is merged into the **current frame** (at the current time
   position)

2) The user also sees a floating message telling to create a new frame
   to fall back to the old behavior.


(cherry picked from commit d259fa1066f8c95b0b99bfd6a0f64393050c9046)

M  +2    -2    libs/image/kis_group_layer.cc
M  +1    -1    libs/image/kis_group_layer.h
M  +15   -11   libs/image/kis_layer.cc
M  +1    -1    libs/image/kis_layer.h
M  +29   -6    libs/image/kis_layer_utils.cpp
M  +2    -2    libs/ui/flake/kis_shape_layer.cc
M  +1    -1    libs/ui/flake/kis_shape_layer.h
M  +17   -6    libs/ui/kis_layer_manager.cc

https://invent.kde.org/graphics/krita/-/commit/b21ca440a6658be2869fe0d6084702f1a30b0b11
Comment 7 rebuilderster 2024-02-08 11:01:38 UTC
Thank you for the fix. This is safer now, but it's still not perfect. For one thing, if you create a layer to paint on, then scrub around the timeline, the contents of that layer are displayed on other frames than the one you painted on as well. This is first of all confusing because it looks like you're going to overwrite layer contents on other frames if you merge down, and it also makes it hard to compare frames because you have to either create keyframes on the layer being painted on, turn it off, or merge it down before you can see what the other frames should actually look like.

I continue to suggest creating a single keyframe for every layer created, on the frame the user is viewing at the time, and letting the user manually specify which layers they want to be held over multiple frames. I feel that is a better default than the current one.