Bug 423851 - Custom color smudge engine brush doesn't blend while there is selection
Summary: Custom color smudge engine brush doesn't blend while there is selection
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.2.8
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
: 396479 426929 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-03 20:15 UTC by soitismyankh
Modified: 2020-09-28 09:44 UTC (History)
4 users (show)

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


Attachments
Brush that was used in reproducing the bug (11.50 KB, image/png)
2020-07-03 20:15 UTC, soitismyankh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soitismyankh 2020-07-03 20:15:18 UTC
Created attachment 129883 [details]
Brush that was used in reproducing the bug

SUMMARY
I created two custom color smudge engine based brushes, and while they work perfectly fine when there is no selection, as soon as I make any selection, these brushes stop blending inside a selection. I tested it with standard Blender_Basic brush, and it blends just fine inside selection, but mine just don't work.


STEPS TO REPRODUCE
1. Take any opaque layer to test blending on
2. Make any selection inside of said layer
3. Use attached brush

OBSERVED RESULT

GIF demonstration:
https://imgur.com/a/mGXNGca

Barely smudges, it takes around 10 strokes to visually register the blending effect, and it's very subtle

EXPECTED RESULT
Smudging in one stroke


SOFTWARE/OS VERSIONS
Windows 7 Home Basic
Comment 1 Lynx3d 2020-07-23 01:24:10 UTC
I'm seeing it here with the bundled "k)_Blender_Blur" brush, no custom brush required. It hardly does anything inside a selection with 4.3 git (Linux)...

I'm alsmost sure it used to work, screams for some regression testing.
Comment 2 Lynx3d 2020-07-25 21:00:48 UTC
Sorry, I need to pull back the confirmation, at least if version 4.2.8 as affection version is correct. Bisecting revealed a similar problem caused by 2b5ed5a0bdb23812c4b64e4ed7d657a5acff85ca but this commit is not in any released version yet, and it broke several brush engines entirely.

And I'm afaid something went wrong when attaching the brush preset, it says "Soft_smudge.kpp (image/png)" so it's not a .kpp file but just the brush icon, I can't reproduce the issue that way or figure out what's different about your brush.

Also, try the latest krita release please.
Comment 3 Lynx3d 2020-07-25 22:29:18 UTC
Okay I'm stupid, .kpp files are just PNGs with additional metadata, browser just confused me...

So, due to the regression currently in git code, I tested with 4.3.0 appimage and eliminated all brush settings until I found  the issue.
The problem is clearly the Smudge Lenght => Strength parameter. When lowered to ~15% or lower, the difference with and wihout selection becomes very obvious with all smudge brushes that don't add color.

Shape/size/type of the selection doesn't seem to matter, even selecting the whole canvase (Ctrl+A) drastically reduces the smudge effect.

I guess it just hasn't been discovered earlier because such low values are not very common for smear/blender brushes and it's hard to notice at higher values and/or when the brush adds color too.
Comment 4 Dmitry Kazakov 2020-07-27 14:12:22 UTC
Git commit a899f2f42800f546105e2fbe53d37e4b1b355b45 by Dmitry Kazakov.
Committed on 27/07/2020 at 14:08.
Pushed by dkazakov into branch 'master'.

Fix painting with colorsmudge brush when a selection is active

Selection crops destination rect, not the source one
Related: bug 394439

M  +17   -8    libs/image/kis_painter.cc

https://invent.kde.org/graphics/krita/commit/a899f2f42800f546105e2fbe53d37e4b1b355b45
Comment 5 Dmitry Kazakov 2020-07-27 14:23:08 UTC
Git commit c4d0924a66b8dbc6e61f38aa5fb61cc5c03ac444 by Dmitry Kazakov.
Committed on 27/07/2020 at 14:13.
Pushed by dkazakov into branch 'krita/4.3'.

Fix painting with colorsmudge brush when a selection is active

Selection crops destination rect, not the source one
Related: bug 394439

M  +17   -8    libs/image/kis_painter.cc

https://invent.kde.org/graphics/krita/commit/c4d0924a66b8dbc6e61f38aa5fb61cc5c03ac444
Comment 6 Dmitry Kazakov 2020-07-27 14:24:11 UTC
The commit fixed painting is general, though there is still a bit weird behavior, because selection makes smudging effect much lighter. I don't know what causes it yet.
Comment 7 wolthera 2020-07-27 15:03:32 UTC
*** Bug 396479 has been marked as a duplicate of this bug. ***
Comment 8 wolthera 2020-09-25 11:32:31 UTC
*** Bug 426929 has been marked as a duplicate of this bug. ***
Comment 9 Dmitry Kazakov 2020-09-28 09:44:20 UTC
Git commit 4463699df4c5d8d9ddc9e056286568b40d5fbc99 by Dmitry Kazakov.
Committed on 28/09/2020 at 09:43.
Pushed by dkazakov into branch 'krita/4.3'.

Fix double application of selection in ColorSmudge brush

When doing bitBltWithFixedSelection() the passed mask is merged with
the current selection. We shouldn't try to reuse d->paramInfo for the
merge because it may have a custom opacity/flow set.

M  +30   -18   libs/image/kis_painter.cc

https://invent.kde.org/graphics/krita/commit/4463699df4c5d8d9ddc9e056286568b40d5fbc99
Comment 10 Dmitry Kazakov 2020-09-28 09:44:31 UTC
Git commit 3f8f763bdbb9cf1b73cd365f1d972574b724f975 by Dmitry Kazakov.
Committed on 28/09/2020 at 09:44.
Pushed by dkazakov into branch 'master'.

Fix double application of selection in ColorSmudge brush

When doing bitBltWithFixedSelection() the passed mask is merged with
the current selection. We shouldn't try to reuse d->paramInfo for the
merge because it may have a custom opacity/flow set.

M  +30   -18   libs/image/kis_painter.cc

https://invent.kde.org/graphics/krita/commit/3f8f763bdbb9cf1b73cd365f1d972574b724f975