Bug 431431 - Merging to hidden layer discards hidden layer
Summary: Merging to hidden layer discards hidden layer
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 5.2.6
Platform: unspecified Unspecified
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-11 11:27 UTC by Dodger
Modified: 2024-12-14 18:54 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dodger 2021-01-11 11:27:14 UTC
SUMMARY
When merging a layer down, if the layer underneath is hidden, the hidden layer is discarded completely.

This is counterintuitive and prone to accidents, sometimes ones that end up being discovered long after the action has exceeded the undo limit and becomes unrecoverable (because it can happen to layers not being used and thus not missed). Further, it violates the "follow the same rules" principle: You cannot paint on a hidden layer; therefore you should not be able to merge to a hidden layer (especially if the contents are thus discarded). If someone wants to delete a layer, just actually deleting the layer is a more sensible way to go about doing so.

STEPS TO REPRODUCE
1. Create a new document
2. Paint on a layer (Layer 1) and hide it.
3. Add a new layer (Layer 2) and paint on that.
4. Merge Layer to to Layer 1 (without unhiding Layer 1)

OBSERVED RESULT
Layer 1 is just gone. Completely obliterated, exactly as if it had been deleted.

EXPECTED RESULT
ONE OF:
1: Layer 1 and Layer 2 are merged, and the resulting layer is unhidden
2: Layer 1 and Layer 2 are merged, and the resulting layer is hidden
3: User is prohibited from merging down (option is greyed out) when the layer below is hidden, or if any of the layers being merged are hidden.

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

ADDITIONAL INFORMATION
It's going to take me a bloody hour to paint that droid again, because autosave didn't happen, either.
Comment 1 David REVOY 2021-01-11 13:49:01 UTC
Hi Dodger, I can reproduce here and I understand it can be problematic to loose the content of the hidden (Layer 1). 

> EXPECTED RESULT
> 3: User is prohibited from merging down (option is greyed out) when the layer below 

At a first glance: Yes. This is a similar solution than what is happening to a merge with a "Locked:Yes" layer underneath. That sounds like a safe solution, leading users to ask themselves why nothing is done and merged. It might attracts their attention to the situation of the layer stack to notice a hidden layer is involved in the process.

But also let's wait for other feedback, especially about how other software handle this as convention and workflow might also already exists about that.
Comment 2 Halla Rempt 2021-01-11 13:53:14 UTC
Given layers 1, 2, 3 with 3 being topmost, and 2 invisble, and the active layer is 3:

* Corel Painter, Photoshop and GIMP merge 3 onto 1, skipping 2, which is on top of the merged layer
* Autodesk Sketch warns the user that the invisible layer's content will be gone, then merges 3 with 2, effectively just removing 2
* MyPaint merges 3 onto 2, making 2 visible
* Clip Studio disables the Merge with layer below action if the 2 is invisible.
Comment 3 Halla Rempt 2021-01-11 14:06:33 UTC
* The latest version of photoshop behaves like Krita: it deletes the hidden layer without warninng.
Comment 4 Halla Rempt 2021-01-11 14:28:11 UTC
* PS 2021 doesn't seem to do anything if 2 is hidden.
Comment 5 Tiar 2022-01-06 20:04:12 UTC
I think if the current behaviour is confusing, the best course of action would be just do nothing in case the layers selected have one visible layer and one or more invisible ones. I think it wouldn't be that much of a problem for old users since they can just remove it, and could prevent mistakes.

Personally I find the current Krita's behaviour logical, consistent and expected, but I *think* I wouldn't mind too much if it was changed to doing nothing. Sometimes preventing mistakes is better than sticking to the rules to the letter.

But I think that might need a discussion on KA.
Comment 6 marty 2023-07-05 00:39:22 UTC
This particular issues loves to get me.  It feels inconsistent to allow a user to merge a visible layer and an invisible layer.

Considering the following behavior
- try to apply a filter (Blur) to an invisible layer, I get error: "Cannot apply filter to locked layer"
- try to draw on the invisible layer, I get error: "Layer is invisible"
- try to merge 2 invisible layers, nothing changes

I'd like to also add another perspective.  When we merge an invisible layer, it isn't empty, it's hidden.   Shouldn't a merge maintain that information that's within the layer (ignoring the layer property)?
Comment 7 Dodger 2023-09-29 09:56:17 UTC
And here we are two years later, and I just lost another 2 hours of work to this. Perhaps I should just use PS.
Comment 8 Vitamorus 2024-12-12 20:18:51 UTC
Re-confirming for 5.2.6.

Personally I think I would prefer it if, when trying to merge layers and at least one of them are hidden, there would be a dialog prompting the user what to do (discard hidden layers, unhide and merge, or skip hidden layers). Second best option IMO would be to treat hidden layers as locked by default and leave them untouched in the layer stack.
Comment 9 Vitamorus 2024-12-14 18:54:47 UTC
Started discussion + poll on KA: https://krita-artists.org/t/poll-what-should-happen-when-merging-hidden-layers/109426