Bug 389022 - Switching between stylus eraser tip and regular tip messes up brush settings of both presets
Summary: Switching between stylus eraser tip and regular tip messes up brush settings ...
Status: ASSIGNED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords: triaged
: 388973 412741 413623 414435 417799 419335 447878 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-01-15 18:49 UTC by wolthera
Modified: 2022-01-04 08:58 UTC (History)
18 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
(Video example) (695.50 KB, video/mp4)
2018-01-16 12:00 UTC, mvowada
Details
Gif showing the behaviour. (2.37 MB, image/gif)
2019-03-12 17:00 UTC, wolthera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wolthera 2018-01-15 18:49:37 UTC
Okay, this one is a bit weird.

1. Start krita, create canvas.
2. take a brush, note its size, increase it to 100px or so. Make a stroke.
3. Flip stylus, note the eraser preset size, erase a bit.
4. Flip stylus again, now, the preset should have the radius of the eraser.
5. Change size, flip again, and the eraser has the size of the main preset, etc.

This can also happen for values like opacity or whether the eraser mode is on.
Comment 1 wolthera 2018-01-15 19:08:45 UTC
NB: It seems that the main preset and the eraser preset need to be of the same engine, I cannot seem to reproduce it with eraser-preset: pixel brush and main-preset: sketch brush.
Comment 2 mvowada 2018-01-16 12:00:54 UTC
Created attachment 109909 [details]
(Video example)

Hi wolthera. Maybe I overlooked something (see video), however I seem to recall I had noticed a similar behaviour before...
(Tested on "Ubuntu 14.04" with "Krita 4.0.0-beta1.1.appimage". Both the main and the eraser preset sharing the same "Pixel" engine)
Comment 3 Halla Rempt 2018-01-17 11:16:53 UTC
Hm, I don't see this happen on OpenSUSE or Neon. It might be useful to attach a tablet log.
Comment 4 Halla Rempt 2018-01-24 11:13:07 UTC
*** Bug 388973 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Crouthamel 2018-09-15 16:17:17 UTC
wolthera, could you attach logs as requested, or more information on your device?
Comment 6 wolthera 2018-09-22 16:56:35 UTC
Unfortunately, I have switched devices, and my new device does not have an eraser end tip(And due the way this device is configured, I cannot plugin my intuous to get the log, the drivers won't be able to see it).

Someone else with a tablet needs to create the log, I'm afraid. It is still relevant, we had a donation with someone complaining about it in the comment.
Comment 7 Dmitry Kazakov 2019-03-12 11:01:56 UTC
Here the problem happens only when "the same preset" is assigned to both sides of the stylus. We have only one copy of the preset stored in the brush shooser, so the changes happen on all the tips. It can be fixed of course.
Comment 8 wolthera 2019-03-12 11:57:24 UTC
No, the preset was a pixel engine brush, much like the eraser preset, but they were different presets.
Comment 9 wolthera 2019-03-12 17:00:35 UTC
Created attachment 118749 [details]
Gif showing the behaviour.

Okay, I've just reproduced the behaviour consistently with a quickbrush on the drawing end, and a pixel engine eraser on the eraser end, with a gif to show the behaviour.

What is required:

1. Start Krita
2. Without changing presets, lower the opacity of the current brush.
3. Switch to eraser, notice how the opacity is taken over.
4. Switch back, drawing tip is now back at 100%, eraser tip now has the opacity.
Comment 10 M 2019-09-02 02:15:22 UTC
Thanks to a user reporting on reddit, I could reproduce this behavior:
1. Start a fresh Krita instance
2. Use a brush with the regular tip
3. Flip to the eraser tip, then back to the regular one
4. The brush preset with the regular tip now has the opacity set to 0%

If I flip to the eraser again, there is at least a chance it also gets 0% opacity. It still occurs most of the time if I adjust opacity first. This seems to work only once initially per session, but I could repeat the behavior using the Line Tool in the same session.

Tested in master and 4.2.5.
Comment 11 Tiar 2019-10-03 08:58:16 UTC
Important: I could reproduce the bug using steps from Wolthera's comment *only* by using Decrease Opacity shortcut (I). It didn't work for me when using only the top bar slider.
Comment 12 Tiar 2019-10-09 10:20:40 UTC
*** Bug 412741 has been marked as a duplicate of this bug. ***
Comment 13 Halla Rempt 2019-10-28 10:43:55 UTC
Agata reports that the base cause of this issue is the opacity-per tool patch.
Comment 14 Halla Rempt 2019-10-30 09:14:41 UTC
*** Bug 413623 has been marked as a duplicate of this bug. ***
Comment 15 Tiar 2019-10-30 17:50:32 UTC
1) The directly responsible code for the bug is in

void KisToolPaint::activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes)

and 

void KisToolPaint::deactivate()

- if you comment out the lines that changes the opacity, it will work correctly.

2) It works if you first change the to the eraser, then to the pen and then change the opacity - I believe the bug is because of initialization of the eraser tip. But that's quite complex - there are several layers of switch canvas data/switch tool/activate tool code to get through...

3) Dmitry suggested to implement it using EffectiveOpacity: compare with EffectiveZoom and CurrentEffectiveCompositeOp in kis_canvas_resource_provider.h
Comment 16 Tiar 2019-11-23 20:35:32 UTC
*** Bug 414435 has been marked as a duplicate of this bug. ***
Comment 17 Léo 2020-03-05 22:20:46 UTC
Same problem here, especially with the opacity settings:
SOFTWARE/HARDWARE/OS VERSIONS 
- Ubuntu 18.04.4 LTS with Gnome 3.28.2
- Nvidia graphic card: GK208B [GeForce GT 730]
- Graphical tablet Wacom Cintiq 13HD
Comment 18 Tiar 2020-03-28 12:54:09 UTC
*** Bug 419335 has been marked as a duplicate of this bug. ***
Comment 19 Halla Rempt 2020-05-04 08:25:15 UTC
*** Bug 417799 has been marked as a duplicate of this bug. ***
Comment 20 kasasprigames 2020-05-16 22:08:06 UTC
I have the same problem. It seems to occur only once per run and again after restarting Krita.

1. start Krita
2. create Canvas
3. flip stylus from brush to eraser and back (you don't have to draw)
4. brush opacity is now 0%

I don't know if this is helpful but I tried starting Krita with the eraser tip. It seems to not occur then.

1. doubletap Krita icon on desktop with eraser tip
2. create canvas
3. flip stylus to brush, brush has 100% opacity
4. flip back to eraser, still has 100% opacity

System/Software:
• Krita 4.2.9 (Steam)
• Windows 10 Pro, 64bit (Build 18363)
• Nvidia GeForce 1070
• Wacom Cintiq 21UX (1st gen. Model DTZ-2100)
Comment 21 tomtomtomreportingin 2020-06-05 01:30:44 UTC
This isn't limited to the stylus eraser behavior. This also happens when switching brush presets using the tenbrushes plugin.
Comment 22 tomtomtomreportingin 2020-06-06 01:09:10 UTC
Oh, I found a way to reproduce it with neither the stylus eraser nor the tenbrushes plugin.
Steps to reproduce:
1. Select any preset. Make note of which one.
2. Select the move tool.
3. Select another preset.
4. Select the freehand brush tool.
5. The preset you selected in step 1 is now at 0% opacity.
No stylus eraser necessary, no drawing necessary, no tenbrushes necessary. Happens with any brush preset, but the bug still only occurs once per session.
Notably, selecting the move tool in step 2 changes the opacity slider to 0%. Once you reproduce this bug in the current session, selecting the move tool changes the opacity slider to 100%. 
I hope that this comment helps in more correctly diagnosing the root cause of the issue. Would be nice to see this issue resolved soon.
Comment 23 Justin Zobel 2020-11-13 03:13:31 UTC
Removing assigned tag as no commits or merge requests posted.
Comment 24 Halla Rempt 2020-11-13 08:36:03 UTC
Do not change the status of bugs, Justin.
Comment 25 Jonathan Poncelet 2020-12-05 19:05:25 UTC
I'd also like to say that I'm experiencing this, and have been since I started using Krita. It's particularly noticeable on brushes like Pencil3_Large_4B, which start on a low opacity.

Reproduction steps for me:

1. Start Krita, open blank canvas
2. Select Pencil3_Large_4B as above. Note that the opacity is 15%.
3. Hover the tablet pen over the canvas (no need to draw). The opacity remains at 15%.
4. Flip to hover the eraser over the canvas. The opacity remains at 15% (as far as I can see it should be 100%).
5. Flip back to hover the normal pen tip over the canvas. The pencil's opacity is now 100% instead of the previous 15%, which is definitely wrong and defeats the point of using the pencil tool.
Comment 26 Halla Rempt 2022-01-04 08:58:00 UTC
*** Bug 447878 has been marked as a duplicate of this bug. ***