Bug 403576

Summary: Cannot edit transparency masks as greyscale images when using pixel brush with wash mode.
Product: [Applications] krita Reporter: Brendan <abcd_z>
Component: GeneralAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, griffinvalley, halla, tamtamy.tymona
Priority: NOR Keywords: regression, triaged
Version: 4.1.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Video showing the problem

Description Brendan 2019-01-25 00:42:52 UTC
SUMMARY

Cannot click the greyscale preview of a mask, just to the left of the mask layer in the Layers docker, to bring up the mask as a greyscale image on the main canvas.

STEPS TO REPRODUCE
1. Create a new file.
2. Create a new transparency mask.
3. Click on the BW preview box to the left of the transparency mask in the layers docker.
4. Draw onto the canvas.

OBSERVED RESULT
The image remains blank.  When you mouseover the image preview of the transparency mask, a preview of the scribble shows up.  So the mask is taking the drawing, it's just not showing it on the canvas in any capacity.

EXPECTED RESULT
The transparency mask should show up as a greyscale image in the main canvas window.

SOFTWARE/OS VERSIONS
Lubuntu 16.04.3 LTS
Krita Appimage 4.1.5

ADDITIONAL INFORMATION

https://www.youtube.com/watch?v=itW9wfPMyWc

In this video from about 3 years ago at around 0:30, the author (apparently) just clicked on the small B&W preview box for a selection mask and it popped up on screen. I'm using the Krita 4.1.5 appimage for Linux and I can't do that. The closest I can get is isolating the layer and painting on it that way, but that's very laggy for me (a known bug that was apparently fixed in 4.2) and rather inconvenient if I want to rapidly switch between the mask and the underlying image.

Isolating the layer works as a work-around, but doing so isn't very practical, since sometimes I want to quickly switch between the greyscale mask and the underlying image.  (Also, isolating a transparency mask has a really bad lag bug, but that's already been reported and is apparently fixed in 4.2.)

Note that a Windows user independently confirmed the same bug with a windows build of 4.1.5 at this url: 

https://www.reddit.com/r/krita/comments/ajafs2/question_is_it_possible_to_pull_up_a_mask_as_a/?st=jrbasnpb&sh=bfc3ac91
Comment 1 Halla Rempt 2019-01-25 12:05:34 UTC
No, the video doesn't show anything to do with transparency masks. It shows the global selection feature. Go to Select/Show Global Selection Mask, then the selection will appear in the layer docker where you can select it and paint on it.
Comment 2 Brendan 2019-01-25 20:54:58 UTC
I can't do that either. When I click on the preview for the global selection mask, the exact same problem occurs; I can paint to the mask but not see it in greyscale. I thought they were similar enough to fall under the same bug, but I can setup a separate bug if you think it won't just get closed as duplicate.
Comment 3 wolthera 2019-04-08 15:26:06 UTC
I can reproduce this: It seems to be caused in specific by indirect painting again. The color smudge brush which has no indirect painting for example does update immidiately, but pixel brushes with 'wash mode'(which uses indirect painting) don't seem to cause an update of the view.

reproduced on

Krita

 Version: 4.2.0-pre-alpha (git c5838c0)
 Languages: en_US, en_GB, nl
 Hidpi: false

Qt

  Version (compiled): 5.12.0
  Version (loaded): 5.12.0

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.15.0-46-generic
  Pretty Productname: KDE neon User Edition 5.15
  Product Type: neon
  Product Version: 18.04
Comment 4 Tiar 2019-04-12 07:09:54 UTC
Wolthera confirmed it, so I change the status (also, REOPENED suggest it was fixed once and now the issue appears again; but in this case the report was just closed as NOT A BUG, so 'reopening' just confirms it is in fact a bug).
Comment 5 Dmitry Kazakov 2019-05-01 09:34:42 UTC
Hi, Wolthera and Brendan!

Could you please share an image and a brush preset (at least name), in which I could reproduce the problem? I cannot get it here :(

I tried painting on a transparency mask with a pixel brush in both Wash and BuildUp modes and it seem to work :(
Comment 6 wolthera 2019-05-01 10:44:37 UTC
Created attachment 119764 [details]
Video showing the problem

Video showing the problem with a basic brush. I guess the trick here is isolate mode.
Comment 7 Dmitry Kazakov 2019-05-01 11:19:48 UTC
Ah, I should have isolated the node first! Thank you for the video! :)
Comment 8 Brendan 2019-05-02 06:56:09 UTC
I'm pretty sure Wolthera is describing a different, albeit probably related bug.  

My problem is that I cannot view any transparency mask without isolating the layer first.  There is nowhere on the node that I can click to bring up the greyscale image that represents the mask, and I'm pretty sure there should be.
Comment 9 Brendan 2019-05-02 07:02:55 UTC
According to the guy in this video: 
https://www.youtube.com/watch?v=hLW6ulXZ9GM
in Krita 3.0.1 you could access the mask by holding "alt" and clicking on the thumbnail.
Comment 10 Dmitry Kazakov 2019-05-04 16:54:42 UTC
Git commit 0ed30208c97a8374b8c2b0b04f8d51b9b119d83b by Dmitry Kazakov.
Committed on 04/05/2019 at 16:53.
Pushed by dkazakov into branch 'master'.

Implement a projection store for masks (for indirect painting)

We have implemented correct painting on masks, but we have never
implemented a projection for them. Indeed, for normal rendering
process they don't need it. But when a mask is selected in isolated
mode, it still needs a projection, so that the use could see the result
of the painting.

M  +1    -0    libs/image/CMakeLists.txt
M  +8    -9    libs/image/KisRecycleProjectionsJob.cpp
M  +4    -3    libs/image/KisRecycleProjectionsJob.h
A  +283  -0    libs/image/KisSafeNodeProjectionStore.cpp     [License: GPL (v2+)]
A  +109  -0    libs/image/KisSafeNodeProjectionStore.h     [License: GPL (v2+)]
M  +14   -5    libs/image/kis_base_node.cpp
M  +2    -1    libs/image/kis_base_node.h
M  +16   -122  libs/image/kis_layer.cc
M  +0    -12   libs/image/kis_layer.h
M  +26   -12   libs/image/kis_mask.cc
M  +20   -2    libs/image/kis_node.cpp
M  +4    -1    libs/image/kis_node.h
M  +5    -0    sdk/tests/testing_nodes.h

https://invent.kde.org/kde/krita/commit/0ed30208c97a8374b8c2b0b04f8d51b9b119d83b